declare @tablename varchar (100)
select name into #tables from sysobjects where type = 'U'
declare tables_cursor CURSOR FOR
select name from #tables
open tables_cursor
fetch next from tables_cursor into @tablename
while @@fetch_status = 0
begin
if @tablename >= 'THSJPOJUAL2000'
begin
print @tablename + ' will be deleted'
--exec ('drop table ' + @tablename)
end
fetch next from tables_cursor into @tablename
end
close tables_cursor
deallocate tables_cursor
drop table #tables
|