Export (0) Print
Expand All
ABS
ALL
AND
ANY
AVG
bit
COS
COT
DAY
EXP
GO
IN
LEN
LOG
MAX
MIN
NOT
OR
PI
SET
SIN
STR
SUM
TAN
USE
VAR
Expand Minimize

OBJECT_NAME

SQL Server 2000

Returns the database object name.

Syntax

OBJECT_NAME ( object_id )

Arguments

object_id

Is the ID of the object to be used. object_id is int.

Return Types

nchar

Remarks

When the parameter of a system function is optional, the current database, host computer, server user, or database user is assumed. Built-in functions must always be followed by parentheses.

System functions can be used in the select list, in the WHERE clause, and anywhere an expression is allowed. For more information, see Expressions and WHERE.

Examples

This example returns the OBJECT_NAME for the authors table in the pubs database.

USE pubs
SELECT TABLE_CATALOG, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = OBJECT_NAME(1977058079)

Here is the result set:

TABLE_CATALOG                  TABLE_NAME   
------------------------------ --------------
pubs                           authors       

(1 row(s) affected)

See Also

Metadata Functions

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft