Search

Object_name should work across databases by Kalen Delaney

Closed
as Fixed Help for as Fixed

26
1
Sign in
to vote
Type: Suggestion
ID: 163373
Opened: 7/13/2006 1:45:31 PM
Access Restriction: Public
0
Workaround(s)
Please enhance the object_name function to allow the database id to be passed as a parameter. There are many of the new DMVs that return an object ID, but if we want to display the name of the object when querying the view, we can only do that for objects in the current database.

Sybase added this feature in System 10, which was 15 years ago.

Being able to specify the database id (which frequently also shows up in the DMV output) would make the DMVs orders of magnitude more flexible and powerful.
Details (expand)
Product Language
English
Version
SQL Server 2005 Service Pack 1 (32)
Category
SQL Engine
Operating System
Windows XP Professional
Operating System Language
US English
Proposed Solution
Enhance the object_name function to allow the database id to be passed as a parameter.
Benefits
Faster Development
Improved User Interface
Improved Administration
Improved Performance
Other Benefits
Enhanced flexibility
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 10/23/2007 at 1:06 PM
This issue has been fixed now. Thanks for providing feedback to the SQL Server team on this.

Srini Acharya
Senior Program Manager, Relational Engine
Posted by Microsoft on 9/13/2006 at 10:34 AM
These changes will appear in SQL SERVER 2005 SP2
Posted by Microsoft on 9/13/2006 at 10:34 AM
We have extended object_name() function to take an optional second parameter which the database id.
We have also introduced a new function object_schema_name() which returns the schema name of the object.
Sign in to post a workaround.