Wednesday, March 7, 2012

Drop all strored procedures

Hello,
How do I write an sql query that drops all stored procedures
in a database if I do not know how many there are or what
they are called?
--
Mikael EngdahlYou could use a cursor and loop through INFORMATION_SCHEMA.ROUTINES WHERE
ROUTINE_TYPE='PROCEDURE', then EXEC('DROP PROC '+@.routine_name) within the
loop...
"Mikael Engdahl" <mikael-l@.engdahl.no.spam.com> wrote in message
news:eyvDqK0ZDHA.2668@.TK2MSFTNGP09.phx.gbl...
> Hello,
> How do I write an sql query that drops all stored procedures
> in a database if I do not know how many there are or what
> they are called?
>
> --
> Mikael Engdahl
>

No comments:

Post a Comment