删除数据库中的空表

来源:互联网 发布:unistrong软件下载 编辑:程序博客网 时间:2024/05/19 02:02

删除数据库中的空表,虽然执行时会有错,但有效

declare @tbname varchar(100)declare cur_tmp cursor forselect object_name(id) from sysindexes where indid in (0,1) and rows=0open cur_tmpfetch next from cur_tmp into @tbnamewhile @@fetch_status=0beginexec('drop table '+@tbname)fetch next from cur_tmp into @tbnameendclose cur_tmpdeallocate cur_tmp
原创粉丝点击