删除对应的存储过程

use master


DECLARE cursorname cursor for select 'drop PROCEDURE  '+name from sysobjects
where name like   'soildwater_%' and xtype = 'p' open cursorname
declare @curname sysname
fetch next from cursorname into @curname
while(@@fetch_status=0)
  begin
 exec(@curname)
fetch next from cursorname into @curname
end
close cursorname
deallocate cursorname

 

--删除对应的存储过程,利用相似程度来删除存储过程,这样做会比一个个去删除要快,前提是要有相似性,要是没有相似性就不适合,不知道有没有其他删除非系统存储过程的方法,请大家写下给我谢谢

posted on 2008-10-24 16:15  SUNJUNLIN  阅读(243)  评论(0编辑  收藏  举报

导航