From: Aaron Bertrand [SQL Server MVP] on
You might find this article I wrote useful.


http://sqlblog.com/blogs/aaron_bertrand/archive/2008/09/09/keeping-sysdepend
s-up-to-date-in-sql-server-2008.aspx



On 12/15/08 11:35 AM, in article ewCQnMtXJHA.5272(a)TK2MSFTNGP04.phx.gbl, "Sam
Bendayan" <sam_bendayan(a)ultimatesoftware.com> wrote:

> Any luck? Are you seeing what I'm seeing?
>
> Thanks,
>
> Sam Bendayan
> DB Architect
> Ultimate Software
> sam.bendayan(a)gmail.com
>
> *** Sent via Developersdex http://www.developersdex.com ***

From: Aaron Bertrand [SQL Server MVP] on
> The problem was that I was using the OBJECT_NAME() function
> while doing cross-database calls....which doesn't work with
> this function.

In SQL Server 2005 SP2 and above you can say:

SELECT OBJECT_NAME(object_id, database_id)

This way you don't need to issue a USE command first.

From: Erland Sommarskog on
Sam Bendayan (sam_bendayan(a)ultimatesoftware.com) writes:
> Any luck? Are you seeing what I'm seeing?

Sorry! I saw your code, but did not have the time right then, and
thought I should come back to it later. But apparently I forgot to unmark
your article as read.

Anyway, I see that you were able to resolve the issue on your own.

--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx