Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Setting tablename in a variable

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-12 : 09:07:25
Lorenzo Barone writes "I simply want to set the table name of a select statement into a variable name e.g.

Declare @TableName as varchar(50)

set @Tablename = 'TestTable'

select * from @TableName

This does not work. The complier asks for the table name to explicitly specified. (ie. Select * from TestTable)

Is there a work-around for this?"
   

- Advertisement -