Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variable Substitution
Message
From
27/12/2000 19:26:26
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Variable Substitution
Miscellaneous
Thread ID:
00457197
Message ID:
00457197
Views:
62
I want to write a select statement where I can use a variable to store the table name, then use that variable in my select statement. For example:

Instead of:
Select * from Mytable

I want to:
Set @SomeTableName = 'Mytable'
Select * from @SomeTableName

but, I can't get it to work. Can you tell me how I should approach this problem.
Next
Reply
Map
View

Click here to load this message in the networking platform