Dropping all temp tables

 In SQL Forum one of the posters asked a question about dropping all the temporary tables
There are many ways to do this
One of the ways to to run the following code

declare @sql varchar(8000)
set @sql=''
select @sql = @sql+' drop table '+name from tempdb..sysobjects where xtype='u'
exec(@sql)

Published 18 September 2009 15:49 by Madhivanan
Filed under: , ,

Comments

No Comments