Delete All Procedures from a database in SQL Server


Sometime we need to delete the all the stored procedures in particular database .For this use the below script to generate to drop the all the store procedures. After execute this query it will gives script for drop store procedures with schema name.

SELECT    

 ‘DROP PROCEDURE ‘ +SCHEMA_NAME(schema_id)+‘.’+name+”

  as ‘CopyThisColumnAndExecuteToDeleteAllProcedures

  FROM     sys.procedures 

 WHERE      [type] = ‘P‘      AND  is_ms_shipped = 0

AND [name] NOT LIKE ‘sp[_]%diagram%

ORDER BY       [name] ASC

Advertisements
This entry was posted in Articles and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s