The DROP TABLE statement drops the specified function.


This operation cannot be undone!


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


  • 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 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.


  • 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