您当前的位置: 首页 » mssql » sql批量删除表

sql批量删除表

declare @tbname varchar(250)
declare #tb cursor for select name from sysobjects where objectproperty(id,'IsUserTable')=1 and name like 'sc_RoomRatePlan_%' and name not like 'sc_RoomRatePlan_c%'
open #tb
fetch next from #tb into @tbname
while @@fetch_status=0
begin
exec('drop table ['+@tbname+']')
fetch next from #tb into @tbname
end
close #tb
deallocate #tb

留下脚印压缩包密码:sosuo8
名字:
全部评论:
loading...
申明:本站部分文章来自网络,由于各种原因对文章的来源无从考究,如果您是“ sql批量删除表 ”的原作者,若侵犯您的版权,请与我联系!联系方法:email:ahuinan@21cn.com  QQ:106494262
文章档案
  • 作者:佚名
  • 来源:转载
  • 日期:2013/7/26 13:59:00
  • 点击:loading...
网友投票(您觉得这篇文章怎样?)
loadding...请稍侯......