T-SQL Tutorial

T-SQL Schema_Name() - Metadata Function


The T-SQL Schema_Name() Metadata Function returns the schema name associated with a schema id.

Schema_Name() Syntax:

SCHEMA_NAME()
SCHEMA_NAME ( [ schema_id ] )

Schema_Name() Example:

SELECT SCHEMA_NAME() AS 'Schema name',
SCHEMA_NAME(1) AS 'Schema name by id';

Schema nameSchema name by id
dbodbo

See also: T-SQL Functions -> OBJECT_NAME | OBJECT_SCHEMA_NAME | SCHEMA_ID