当前位置: 代码迷 >> SQL >> Sqlserver剔除多表操作
  详细解决方案

Sqlserver剔除多表操作

热度:12   发布时间:2016-05-05 11:04:41.0
Sqlserver删除多表操作
DECLARE c2 cursor for
    select 'drop table ['+name +']; '
    from sysobjects
    where xtype = 'u' and name not like 'TRT_%'
open c2
declare @c2 varchar(8000)
fetch next from c2 into @c2
while(@@fetch_status=0)
    begin
        exec(@c2)
        fetch next from c2 into @c2
    end
close c2
  相关解决方案