Stored Procedures  «Prev  Next»

Lesson 7Deleting Stored Procedures
ObjectiveDescribe how to delete a user-defined stored procedure.

Deleting Stored Procedures

If you no longer need a stored procedure, you should delete it so that you free up space on the server.

Delete Stored Procedures using Enterprise Manager

To delete your stored procedure with Enterprise Manager:
  1. Right-click the name of the stored procedure shown in Enterprise Manager.
  2. Choose the Delete menu option.

Delete using Transact-SQL

To delete a stored procedure using Transact-SQL, use the DROP PROCEDURE statement, as shown below:
Delete using Transact-SQL

Delete example

To delete the usp_DeleteEmployee stored procedure, simply execute this Transact-SQL statement:
DROP PROCEDURE usp_DeleteEmployee

Two related concepts of user-defined stored procedures:
  1. the system and
  2. extended stored procedures.