首頁 >資料庫 >mysql教程 >请问SQLSERVER2005如何删除所有存储过程

请问SQLSERVER2005如何删除所有存储过程

WBOY
WBOY原創
2016-06-07 15:33:231124瀏覽

declare @procName varchar(500) declare cur cursor for select [name] from sys.objects where type = 'p' open cur fetch next from cur into @procName while @@fetch_status = 0 begin if @procName 'DeleteAllProcedures' exec('drop procedure ' + @p

declare @procName varchar(500)

declare cur cursor

for select [name] from sys.objects where type = 'p'

open cur

fetch next from cur into @procName

while @@fetch_status = 0

begin

if @procName 'DeleteAllProcedures'

exec('drop procedure ' + @procName)

fetch next from cur into @procName

end

close cur

deallocate cur

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn