删除存储

DECLARE proccur CURSOR
FOR
SELECT [name]
FROM sysobjects
WHERE type = 'P'
DECLARE @procname VARCHAR(100)
OPEN proccur
FETCH NEXT FROM proccur INTO @procname
WHILE ( @@FETCH_STATUS = 0 )
BEGIN
EXEC('drop proc ' + @procname)
PRINT ( @procname + '已被删除' )
FETCH NEXT FROM proccur INTO @procname
END
CLOSE proccur
DEALLOCATE proccur

posted @   傲三  阅读(181)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示