Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Drop table problem
Message
From
17/02/2005 09:56:45
 
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00986632
Message ID:
00987916
Views:
54
Sergey and Jayesh,

You both say that you don't need to drop a #TempTable, but it's good practice to do it. If I'm not mistaken, I think that you *do* have to drop the table, as I thought it persists even after it's gone out of scope.

As an example, in Query Analyzer, I write some code to create a temp table, insert some rows into it, select from it and then drop it ... I run that code all is good. But if I then highlight all the code except the DROP and run it more than once, I get the error "There is already an object named '#temp' in the database."

I guess my question would be then, what "scope" does it have to go out of?

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform