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 |
sahu74
Posting Yak Master
100 Posts |
Posted - 2006-09-11 : 13:48:04
|
Is here a way to drop all Local temporary tables? I am having a stored procedure that creates several Local Temporary tables. I could drop them one after the other, but was wondering if there is a way to drop them all together at the end.Any help/suggestions will be appreciated.Thank you.PKS. |
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2006-09-11 : 13:54:55
|
You have to explicitly drop a specific table, there is no "drop all" type of statement.If you are talking about tempdb "#" tables as opposed to permenent tables you created in the working database then do you know sql server will drop the table for you when the procedure finishes?Be One with the OptimizerTG |
 |
|
sahu74
Posting Yak Master
100 Posts |
Posted - 2006-09-11 : 14:09:01
|
Thank you. I was not aware that the "#" tables get dropped after the SP finishes. I was assuming that the scope is still open. Thanks again.PKS.quote: Originally posted by TG You have to explicitly drop a specific table, there is no "drop all" type of statement.If you are talking about tempdb "#" tables as opposed to permenent tables you created in the working database then do you know sql server will drop the table for you when the procedure finishes?Be One with the OptimizerTG
|
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-09-11 : 20:39:10
|
One of the ways isDrop table #temp1,#temp2,etcMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|