drop function

Description

Removes one or more user-defined functions from the current database.

Syntax

drop function{ [ owner_name . ] function_name } [ ,...n ] 

Parameters

owner_name

is the name of the user ID that owns the user-defined function. Must be an existing user ID.

function_name

is name of the user-defined function to be removed. Specifying the owner name is optional; the server name and database name cannot be specified.

Examples

Example 1

Drops the bonus function:

drop function bonus

Usage

drop function drops scalar SQL user-defined functions from your current database.

Permissions

The permission checks for drop function differ based on your granular permissions settings.

Granular permissions enabled

With granular permissions enabled, you must be the function owner or a user with drop any function privilege.

Granular permissions disabled

With granular permissions disabled, you must be the function owner or a user with sa_role.

Permissions are not transferable.