I have an Error table which stores the names of the table in which the error occurred.
Now I want to query the table using the table name selected from the "Error" table.
I tried to store the table name in a variable and use this variable in the FROM clause in my query. But this doesn't work:
DECLARE @tableName VARCHAR(15)
select @tableName = TableName from SyncErrorRecords where Status = 'Unsynced'
select * from @tableName
Can anyone help me out on this. Thanks in advance.
Querythat you tried. @Ravi