It is possible?
DECLARE @vTableName varchar(50)
SET @vTableName = (SELECT TableName FROM qms_Types WHERE Id = 1)
SELECT * FROM @vTableName
I have this error:
Msg 1087, Level 16, State 1, Line 3 Must declare the table variable "@vTableName".
my solution for this:
EXECUTE('SELECT * FROM ' + TableName + '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With