I have created a table variable and I am trying to reference the variable in my query string variable. The error is telling me to declare the variable when I think I already declared it. Can someone help me see where I am going wrong?
Error:
[42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]
Must declare the scalar variable "@Temp2"