declare @tab varchar(20)
while exists(select * from sysobjects where xtype='u')
begin
select top 1 @tab=name from sysobjects where xtype='u'
exec('drop table '+@tab)
end
删除当前数据库中的所有表
while exists(select * from sysobjects where xtype='u')
begin
select top 1 @tab=name from sysobjects where xtype='u'
exec('drop table '+@tab)
end
删除当前数据库中的所有表