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: , .

File Upload Code ASP.NET + C#

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 )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

May 2011
M T W T F S S
« Mar    
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Follow

Get every new post delivered to your Inbox.