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)
 Dynamic table names?

Author  Topic 

jhilb
Starting Member

22 Posts

Posted - 2001-10-26 : 15:59:20
I've got a table that is the same name, but different environments (servers). I am developing stored procs in which the table name might change.

How can I dynamically reference the table name (other than using exec).

I have:

select * from tbMyTable

I want:

set @MyTable = 'tbMyTable'
select * from @MyTable

possible?


   

- Advertisement -