Partilhar via


DROP PACKAGE (U-SQL)

Summary

The DROP PACKAGE statement drops packages. As in the case with other meta data objects, a package gets dropped even if another package, table-valued function or procedure depends on it.

Syntax

Drop_Package_Statement :=                                                                                
    'DROP' 'PACKAGE' ['IF' 'EXISTS'] Identifier.

Remarks

  • IF EXISTS
    If a package of the given name does not exist, or the user has no permissions to drop the package, an error is raised. If the optional IF EXISTS is specified, then the statement drops the package if it already exists, or succeeds without changes if the package does not exist or the user has no permission to at least enumerate all existing packages.

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

Examples

  • The examples can be executed in Visual Studio with the Azure Data Lake Tools plug-in.

  • The scripts can be executed locally. An Azure subscription and Azure Data Lake Analytics account is not needed when executed locally.

  • The examples utilize the packages created from CREATE PACKAGE (U-SQL).

    // Will error if not exists
    USE DATABASE TestReferenceDB;
    DROP PACKAGE XMLFiles;
    
    // Will not error if not exists
    DROP PACKAGE IF EXISTS TestReferenceDB.dbo.XMLorJSON;
    

See Also