删除数据库中的空表,虽然执行时会有错,但有效
declare @tbname varchar(100)
declare cur_tmp cursor for
select object_name(id) from sysindexes where indid in (0,1) and rows=0
open cur_tmp
fetch next from cur_tmp into @tbname
while @@fetch_status=0
begin
exec('drop table '+@tbname)
fetch next from cur_tmp into @tbname
end
close cur_tmp
deallocate cur_tmp