Поделиться через


CREATE DATABASE (U-SQL)

Summary

This statement creates a new U-SQL database with the specified name.

Syntax

Create_Database_Statement :=                                                                             
    'CREATE' 'DATABASE' ['IF' 'NOT' 'EXISTS'] DB_Name.
DB_Name := Quoted_or_Unquoted_Identifier.

Remarks

  • DB_Name
    Specifies the name of the database in form of a quoted or unquoted U-SQL identifier. If a database of the given name already exists or the user has no permissions to create a database, an error is raised.

  • IF NOT EXISTS
    If the optional IF NOT EXISTS is specified, then the statement creates the database if it does not already exist, or succeeds without changes if the database already exists and the user has permission to at least enumerate all existing databases.

Examples

  • 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 a user created a database called TestReferenceDB:

CREATE DATABASE TestReferenceDB; 

// with IF NOT EXISTS
CREATE DATABASE IF NOT EXISTS TestReferenceDB; 

See Also