all groups > sql server programming > september 2004 >
You're in the

sql server programming

group:

All stored procedures...



All stored procedures... Marius Ropotică
9/20/2004 11:43:10 PM
sql server programming: Hi,

I want to delete all the stored procedures from a database, but not the
system procs. How can I do this?

SELECT * FROM sysobjects WHERE xtype = 'P' gives all the stored procedures.

Thanks,

RE: All stored procedures... John Bell
9/21/2004 12:03:03 AM
Hi Marius

Use
SELECT * FROM sysobjects WHERE xtype = 'P' and
OBJECTPROPERTY(id,'IsMSShipped') = 0

John

[quoted text, click to view]
Re: All stored procedures... Adi
9/21/2004 12:03:32 AM
You can use the objectproperty function to discover if the stored
procedure is a system stored procedure or a user stored procedure.
Here is an example:

select name from sysobjects where type = 'P' and
objectproperty(id,'IsMSShipped') = 0
Re: All stored procedures... Tibor Karaszi
9/21/2004 8:57:45 AM
Here's a quick one. Copy the result into the query window and execute it. But make sure you go
through it first so you don't drop anything vital.

SELECT 'DROP PROC "' + name + '"' + CHAR(13) + CHAR(10) + 'GO'
FROM sysobjects WHERE xtype = 'P'

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/


[quoted text, click to view]

Re: All stored procedures... Jonathan Chong
9/21/2004 2:55:30 PM
Try this:
SELECT * FROM sysobjects WHERE xtype = 'P' and category=0

[quoted text, click to view]

AddThis Social Bookmark Button