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 |
|
frank2
Starting Member
35 Posts |
Posted - 2005-08-23 : 10:48:26
|
| I am a Visual FoxPro user moving over to SQL 2000. I have some SELECTs that I run against several tables. What I do is pass the procedure the name of the table and use that parameter in the SELECT statement. This works because VFP allows macro substitution.For example:SELECT * from DataDictInstead of using the literal table name I can load the name into a variablex = "DataDict"Then using macro substitution use the variable in place of the literal name.SELECT * from (x)orSELECT * from &xIn VFP macro substitution can be used to define the result field list or any other clause in a SELECT. Is a similar capability available in SQL? If so how do I do it and where can I find documentation? |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-08-23 : 10:49:18
|
| dynamic sql....search here. |
 |
|
|
|
|
|