--create table aaa000 (col1 int)
--go
--create table bbb000 (col1 int)
--go
--create table ccc000 (col1 int)
--go
--create table ddd000 (col1 int)
--go
--create table eee0 (col1 int)
--go
declare @tname nvarchar(128)
while exists (select name from sys.tables where name like N'%000')
begin
select top 1 @tname = name from sys.tables where name like N'%000'
exec (N'drop table '+@tname)
end
--go
--create table bbb000 (col1 int)
--go
--create table ccc000 (col1 int)
--go
--create table ddd000 (col1 int)
--go
--create table eee0 (col1 int)
--go
declare @tname nvarchar(128)
while exists (select name from sys.tables where name like N'%000')
begin
select top 1 @tname = name from sys.tables where name like N'%000'
exec (N'drop table '+@tname)
end