Hello,
Can someone please tell me what'd be the correct syntax in using:
When running this, I get error: "Must declare the variable '@familyName'" (even though it's been declared above)
Thanks for your help.
Can someone please tell me what'd be the correct syntax in using:
Code:
DECLARE @sqlStr varchar, @familyName varchar
SET @sqlStr = ('SELECT @familyName=LastName FROM someTable WHERE id=3')
EXEC(@sqlStr)
When running this, I get error: "Must declare the variable '@familyName'" (even though it's been declared above)
Thanks for your help.