Table of contents
TOC
Collapse the table of content
Expand the table of content

DROP FUNCTION (U-SQL)

Michael Rys|Last Updated: 5/15/2018
|
4 Contributors

The DROP TABLE statement drops the specified function.

Warning

This operation cannot be undone!

Syntax
Drop_Function_Statement :=                                                                               
    'DROP' 'FUNCTION' ['IF' 'EXISTS'] Identifier.

Semantics of Syntax Elements

  • Identifier
    Specifies the name of the table-valued function. If the Identifier is a three-part identifier, the function will be dropped in the specified database and schema. If it is a two-part identifier, then the function will be dropped in the specified schema of the current database context. If the identifier is a simple identifier, then the function will be dropped in the current database and schema context.

    If a function of the given name does not exist, or the user has no permissions to drop the function, an error is raised.

  • IF EXISTS
    If the optional IF EXISTS is specified, then the statement drops the function if it already exists, or succeeds without changes if the function does not exist or the user has no permission to at least enumerate all existing functions.

Example

  • The example can be executed in Visual Studio with the Azure Data Lake Tools plug-in.
  • The script can be executed locally. An Azure subscription and Azure Data Lake Analytics account is not needed when executed locally.

The following statement drops the TVF with the name SearchLogPerRegion in the TestReferenceDB’s dbo schema if it exists and the user has permission to drop it:

DROP FUNCTION IF EXISTS TestReferenceDB.dbo.SearchLogPerRegion;

See Also

© 2018 Microsoft