Thursday, March 13, 2008

delete strored procedure at one shot : SQL Server 2005

Select * from sys.procedures where [type] = 'P' and is_ms_shipped = 0 and [name] not like 'sp[_]%diagram%'


Select 'Drop Procedure ' + name from sys.procedures Where [type] = 'P'
and is_ms_shipped = 0
and [name] not like 'sp[_]%diagram%'

Run the second query in your SQL Server 2005 after selecting database, then copy all output for the ran query and then runt those copied query.

All your stored procedure will get deleted.

No comments: