If I do this...
declare @TableName as varchar(50)
set @TableName = 'MyTable'
select * from @TableName
I got the follwing error...
Must declare the variable '@TableName'.
Why my variable is not recognized as table name?
Something wrong? How can I use a table name in variable?
Thank you!