December 11, 2007 at 1:14 pm
sorry its deleted
December 11, 2007 at 1:23 pm
That is because it is inside of your string. When you execute the dynamic SQL string it executes in a seperate context than your outside query, so if you want to "pass a variable" to a dynamic string, you need to build your string with the variable.
Set @sql = 'Select from table where user = ''' + @user + ''''
December 11, 2007 at 2:18 pm
Mike Levan (12/11/2007)
sorry its deleted
That's just not nice... now we have an answer with no question.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply