This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In the previous post, I Have provided three different scripts to find Object Dependency in the current database.
In this post I share one SQL script to find Cross Database Object Dependency in SQL Server.
1 2 3 4 5 6 7 8 |
SELECT OBJECT_NAME (referencing_id) AS ReferencedObjects ,referenced_database_name ,referenced_schema_name ,referenced_entity_name FROM sys.sql_expression_dependencies WHERE referenced_database_name IS NOT NULL AND is_ambiguous = 0; |