Groups | Blog | Home
all groups > sql server programming > august 2003 >

sql server programming : do we need to explicity drop temp tables in stored procedures



Hassan
8/16/2003 9:59:40 PM
If a temp table is created within a stored proc, do we need to explicitly
drop it within a stored procedure. I believe that they get dropped
automatically after the stored proc completes.. But am not too sure. Please
let me know the good practises. I am using SQL 2000

Thank you


Andrew J. Kelly
8/17/2003 9:18:16 AM
The temp table will be dropped automatically after the batch is completed.
It's usually a good idea though to explicitly drop them when done as it is
more self documenting and less prone to mistakes. You can also free up some
resources if your finished with it before the rest of the batch ends.

--

Andrew J. Kelly
SQL Server MVP


[quoted text, click to view]

AddThis Social Bookmark Button