DROP FUNCTION#

Removes the function from the Querona instance.

Syntax#

DROP FUNCTION IF EXISTS function name ,

Arguments#

IF EXISTS

Conditionally drops the function only if it already exists. A name that does not match any function is skipped silently; the other functions named in the statement are still dropped.

function_name

Specifies the name of the function to be removed. Several functions can be named, separated by commas.

Remarks#

The functions are removed in the order they are named. When a name matches no function and the statement carries no IF EXISTS, the functions named before it are already removed and the statement then fails.

Naming an object that is not a function fails whether or not IF EXISTS is present: IF EXISTS covers a name that matches nothing, not a name that matches something else.

Permissions#

Requires function ownership or the CONTROL permission on the database.

Examples#

The following example removes the findPetsByStatus function.

DROP FUNCTION dbo.findPetsByStatus;

The following example removes the function only when it exists, so it can be run repeatedly.

DROP FUNCTION IF EXISTS dbo.findPetsByStatus;

See also#