开发者

Delete all procedures except those which contain a string in their name

I want to drop a lot of SPs fro开发者_如何学Gom my SQL Server database. However, I want to write "Delete all procedures except those which contain a certain string in their name".

How can I do this? I am using SQL Server 2008 R2.

Thank


What about:

SELECT 'DROP PROCEDURE ' + name
FROM    sysobjects WHERE xtype = 'U' AND
        name LIKE 'usp_%'   -- Here you'll define your criteria

After running this, you just need to execute this command output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜