Create and Drop Stored Procedures as a Group

Ever created a bunch of stored procedures for testing purposes and went to drop them but couldn’t remember all the names you created? A way to avoid this is to group multiple stored procedures under a single name. The following is the syntax for grouping:

create procedure 1as .... .... GOcreate procedure ;2as .... .... GOExample:create procedure ;1as .... .... GOcreate procedure ;2as .... .... GO

The number assigned for each stored procedure will vary from 1 TO 32767. If you want to execute the stored procedure:

 exec test;1exec test;2 ... etc

Drop all stored procedures using the drop procedure test.

Note: This tip works for all MS SQL 2000 flavors.

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: