Drop all stored procedures
May 3, 2011 at 11:26 am Leave a comment
USE DBNAME
GO
declare @procName sysname
declare someCursor cursor for
select name from sysobjects where type = ‘P’ and objectproperty(id, ‘IsMSShipped’) = 0
open someCursor
fetch next from someCursor into @procName
while @@FETCH_STATUS = 0
begin
exec(‘drop proc ‘ + @procName)
fetch next from someCursor into @procName
end
close someCursor
deallocate someCursor
go
Advertisement
Entry filed under: MSSQL SERVER. Tags: Drop all stored procedures, SQL.

Trackback this post | Subscribe to the comments via RSS Feed