Home Forums SQL Server 2008 SQL Server 2008 - General Store procedure variable RE: Store procedure variable
Ant-Green
SSC Guru
Points: 113445
More actions
February 5, 2013 at 8:28 am
#1584425
Because the query is dynamic, and without sp_executesql it will not expand the contents of the variable.
Dynamic queries like this are bad practice, I would highly recommend not doing this.