OBJECT_SCHEMA_NAME Metadata Function TSQL Tutorial

Returns the database schema name of objects.

OBJECT_SCHEMA_NAME Syntax:

OBJECT_SCHEMA_NAME ( object_id [, database_id ] )

OBJECT_SCHEMA_NAME Example:

SELECT OBJECT_SCHEMA_NAME(279672044) AS 'Schema object name of View',
OBJECT_SCHEMA_NAME(245575913,2) AS 'Schema object name of Table';

Schema object name of ViewSchema object name of Table
dbodbo

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