SCHEMA_NAME() Metadata Function TSQL Tutorial

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