go
declare @tbname varchar(250)declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1open #tbfetch next from #tb into @tbnamewhile @@fetch_status=0begin exec('drop table ['+@tbname+']') fetch next from #tb into @tbnameendclose #tbdeallocate #tb