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.
| Author |
Topic |
|
pop0v
Starting Member
5 Posts |
Posted - 2008-12-17 : 08:15:15
|
| SELECT * FROM @varWhere @var is string containing the name of the table i want to use.How can i do this ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-12-17 : 08:17:09
|
| [code]EXEC( 'SELECT * FROM '+ @var)[/code]but this is not a good approach |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-12-24 : 05:40:32
|
| www.sommarskog.se/dynamic_sql.htmlMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|