Share via


CREATE TABLE (U-SQL): Creating Managed Tables

Summary

U-SQL allows a table to be created by specifying a schema, or by specifying a query where the query’s result type implies the table’s schema. In both cases the table will have to have a clustered index specified in order to be able to contain data and both cases allow the table to be partitioned.

Note

All managed U-SQL tables are currently clustered tables where the cluster information is specified with a clustered index. In particular, other types of tables such as heaps and column store tables are not supported.

Syntax

Create_Managed_Table_Statement :=                                                                        
    'CREATE' 'TABLE' ['IF' 'NOT' 'EXISTS'] Identifier   
    (Table_With_Schema | Table_As_Query).

Remarks

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

    If a table or other object of the given name already exists in the specified database and schema context or the user has no permissions to create a table, an error is raised.

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

  • Table_With_Schema
    A table can be specified by means of declaring a schema. See CREATE TABLE (U-SQL): Creating a Table with Schema for more details.

  • Table_As_Query
    A table can be specified by means of declaring a schema. See CREATE TABLE (U-SQL): Creating a Table from a Query for more details.

See Also