OBJECT_NAME
Returns the database object name for schema-scoped objects.
Syntax
OBJECT_NAME ( object_id [, database_id ] )
Arguments
object_id
Is the ID of the object to be used. object_id is int and is assumed to be a schema-scoped object in the specified database, or in the current database context.
database_id
Is the ID of the database where the object is to be looked up. database_id is int.
Return types
sysname
Examples
SELECT DISTINCT OBJECT_NAME(object_id) FROM master.sys.objects;