tsql - Do I need to drop or deallocate a temporary table in SQL Server? -
i've written few scripts declare table , cursor. @ end of script, deallocate cursor. supposed deallocate table?
declare @mytable table (columns); insert @mytable(columns) values (values) insert @mytable(columns) values (values) ... declare workorders scroll cursor select (rest of statement); ... work... close workorders; deallocate workorders;
the scope of table variable in specific batch. don't have explicitly drop/deallocate space occupied table variable.
the space occupied table variable automatically dropped in end of batch got created
Comments
Post a Comment