DROP DATABASE (U-SQL)
The statement drops the database and deletes all the data contained within from the system. If a database of the given name does not exist, or the user has no permissions to drop a database, an error is raised.
This operation cannot be undone!
Drop_Database_Statement := 'DROP' 'DATABASE' ['IF' 'EXISTS'] DB_Name.
DB_Name := Quoted_or_Unquoted_Identifier.
Specifies the name of the database to be dropped in form of a quoted or unquoted U-SQL identifier. If a database of the given name does not exist or the user has no permissions to drop a database, an error is raised.
If the optional
IF EXISTSis specified, then the statement drops the database if it already exists, or succeeds without changes if the database does not exist or the user has no permission to at least enumerate all existing databases.
- 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 script shows how the
TestReferenceDB database is deleted if it already exists before it is recreated:
DROP DATABASE TestReferenceDB; // with IF EXISTS DROP DATABASE IF EXISTS TestReferenceDB;