I am writing a fairly simple SQL query in SQL 2005, but am running into an issue and can't figure out what is wrong.
For documentation purposes, the query has to be a dynamic sql
A snippet of my query is:
@RecCreatorID int
....
....
IF (@RRecCreatorID IS NOT NULL)
Begin
Set @strSQL = @strSQL + ' AND RecCreatorID = @RecCreatorID'
End
However, when I run PRINT @strSQL, what I get is
And RecCreatorID = @RecCreatorID
How can I get the actual value of @RecCreatorID to be displayed?