Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Variables in Select Statements
Message
From
21/09/1999 13:16:53
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Variables in Select Statements
Miscellaneous
Thread ID:
00267214
Message ID:
00267214
Views:
66
I am trying to use a select statement using a variable for the database in the from clause.. ie

declare @MyVariable varchar(40)

select ColumnName
From @MyVariable

But it wont accept it.. I have tried putting the variable in [ ] but it still does the same thing.

The database name is in the varaible so it should work, and I take the variable out and put the database name in it works.



Thanks,
Jason
Next
Reply
Map
View

Click here to load this message in the networking platform