In this article I will explain with example the syntax to drop a Stored Procedure in SQL Server i.e. how to delete a Stored Procedure in SQL Server.
Using this tutorial you can easily delete (Drop) an existing Stored Procedure in all SQL Server versions i.e. 2000, 2005, 2008, 2008R2, 2012 and 2014.
Database
Here I am making use of Microsoft’s Northwind Database. The download and install instructions are provided in the following article.
Creating a Stored Procedure
In order to explain the syntax to delete (Drop) a Stored Procedure, I am first creating a Stored Procedure as shown below.
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE GetEmployeeDetails
@EmployeeID int = 0
AS
BEGIN
SET NOCOUNT ON;
SELECT FirstName, LastName, BirthDate, City, Country
FROM Employees WHERE EmployeeID=@EmployeeID
END
GO
Drop or Delete a Stored Procedure
Figure below displays how to drop a stored procedure. As you can see below to delete a stored procedure DROP keyword is used proceeded by the name of the stored procedure.
Example
DROP PROCEDURE GetEmployeeDetails