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 |
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2011-01-28 : 02:21:18
|
| Hi,select pivotname from #pivotdata My pivotname consist sql statement. How can i execute it using Stored Procedures?Please advise?Thank you.Regards,Micheale |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-01-28 : 02:25:33
|
| First explain what are you trying to do? so that we go in the same direction! |
 |
|
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2011-01-28 : 02:35:19
|
| TBUser Fieldname: SQLdata of the Fieldname eg: Select * from tbuser where id=1how to execute the SQL fieldname at the table TBUser?Thank you.Regards,Micheale |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-01-28 : 03:52:48
|
You will need some form of loop (cursor or while loop) to get record by record and then use Dynamic SQL to execute the statement.But seriously, are you sure you want to do this ? readhttp://www.sommarskog.se/dynamic_sql.html KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|