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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-01-16 : 09:51:29
|
| priya writes "I want to create a generic stored procedure which takes the table name as an input parameter and queries it. So how to use the input variable in the INSERT statement?" |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-01-16 : 10:13:04
|
| i would suggest you to go thru this Article's by Merkin on Dynamic Sqlhttp://www.sqlteam.com/item.asp?ItemID=4599http://www.sqlteam.com/item.asp?ItemID=4619this should do what you are looking forcreate table query_res(@m varchar(255))asdeclare @mvar as varchar(600)Set nocount onselect @mvar="select * from "+ @mexec (@mvar)Go----------------------------------"True love stories don't have endings." |
 |
|
|
|
|
|