T-SQL Tutorial

T-SQL Object_Name() Metadata Function


The T-SQL Object_Name() metadata function returns the database object name for schema objects.

Object_Name() Syntax:

OBJECT_NAME ( object_id [, database_id ] )

Object_Name() Example:

SELECT OBJECT_NAME(279672044) AS 'Object name of View',
OBJECT_NAME(245575913,2) AS 'Object name of Table';

Object name of ViewObject name of Table
products_listproducts

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