drop procedure

Description

Removes a procedure.

Syntax

drop proc[edure] [owner.]procedure_name 
	[, [owner.]procedure_name] ... 

Parameters

procedure_name

is the name of the Transact-SQL or SQLJ procedure to drop. Specify the owner’s name to drop a procedure of the same name owned by a different user in the current database. The default value for owner is the current user.

Examples

Example 1

Deletes the stored procedure showind:

drop procedure showind

Example 2

Unregisters the extended stored procedure xp_echo:

drop procedure xp_echo

Usage

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

drop procedure permission defaults to the procedure owner and is not transferable.

Auditing

Values in event and extrainfo columns of sysaudits are:

Event

Audit option

Command or access audited

Information in extrainfo

28

drop

drop procedure

  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if set proxy is in effect

See also

Commands create procedure, create procedure (SQLJ)

System procedures sp_depends, sp_dropextendedproc, sp_helpextendedproc, sp_helptext, sp_rename