|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Syntax error in Stored Procedure
The code below gives me an Error 156: Incorrect Syntax near the keyword 'SELECT'.
Any assistance is greatly appreciated. Thank you. INSERT INTO [program_management].[dbo].[ecr_evaluations] ( [ecr_id], [user_id], [affected_item], [state], [user_id1], [time_stamp]) VALUES SELECT @ecrid, user_id, affected_item, 'Evaluate', @user_id1, @time_stamp FROM mt_program_ecr_evaluators WHERE program_id = @program_id AND all_ecrs = 'Yes' |
|
#2
|
|||
|
|||
|
SELECT @ecrid,
I an pretty sure you can't include a variable as a field that is being selected from the table, It needs to be seperate from the select statement S- |
|
#3
|
|||
|
|||
|
The fix was removing the keyword VALUES from the statement. Thank you for your assistance.
Rob |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Syntax error in Stored Procedure |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|