Navi's (5/1/2009)
Hi,DECLARE @query AS VARCHAR(20)
DECLARE @variable AS VARCHAR(5)
SELECT @variable = 'TEST' --> Command(s) completed successfully.
Only 2 and 3 is the right answer
SELECT @variable = 'TEST' is the value passed in variable.
Answer is right for question. 1,2,4 are correct answers.
Error on 3:
Msg 207, Level 16, State 1, Line 1
Invalid column name 'TEST'.
Error on 5:
Msg 105, Level 15, State 1, Line 1
Unclosed quotation mark after the character string ' + @variable'.
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ' + @variable'.
SQL DBA.