How to get SQL Server schema name

To get SQL Server schema name uses function SCHEMA_NAME().

Syntax

SCHEMA_NAME ( )


Example

SELECT SCHEMA_NAME() ;

Results
dbo

See also: SCHEMA_NAME