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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-09-08 : 07:16:50
Swetha writes "How do you create a temporary table as a variable in a stored procedure and execute the string as a SQL statement?"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-09-08 : 07:36:16
You need to use Dynamic SQL although this type of queries are not recommended
Refer this for more details
http://www.sommarskog.se/dynamic_sql.html

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -