Deleting a SQL Server stored procedure

Overview

In addition to creating stored procedures there is also the need to delete stored procedures.  This topic shows you how you can delete stored procedures that are no longer needed.

Explanation

The syntax is very straightforward to drop a stored procedure, here are some examples.

Dropping Single Stored Procedure

To drop a single stored procedure you use the DROP PROCEDURE or DROP PROC command as follows.

DROP PROCEDURE dbo.uspGetAddress 
GO
-- or
DROP PROC dbo.uspGetAddress 
GO

Dropping Multiple Stored Procedures

To drop multiple stored procedures with one command you specify each procedure separated by a comma as shown below.

DROP PROCEDURE dbo.uspGetAddress, dbo.uspInsertAddress, dbo.uspDeleteAddress
GO
-- or
DROP PROC dbo.uspGetAddress, dbo.uspInsertAddress, dbo.uspDeleteAddress
GO

2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *