usql.schemas (U-SQL)


Contains a row for each database schema in the current database context.

Column name Data type Description
schema_id_guid Guid Schema's unique identifier (unique within a database)
name string Schema name (unique within a database)
database_id_guid Guid Identifier of the database that contains the schema


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

Query the usql.schemas view

USE TestReferenceDB;

OUTPUT usql.schemas
TO "/ReferenceGuide/CatalogViews/schemas.txt"
USING Outputters.Tsv(outputHeader:true);

Query the usql.schemas view with usql.databases view

@schemas =
    SELECT AS dbName,
    FROM usql.schemas AS s
    JOIN usql.databases AS d
    ON s.database_id_guid == d.database_id_guid;

OUTPUT @schemas
TO "/ReferenceGuide/CatalogViews/schemas_databases.txt"
USING Outputters.Tsv(outputHeader:true);  

See Also