Sunday, May 7, 2017

How to find Your SharePoint Database Cross References Objects

This is a bit of a DBA task.

I have come across with a situation which I want to check Cross Database Reference for SharePoint Service Application databases like

ReportingService_ServiceApplication_DB

You can use following SQL scripts to find database cross references and references with in the Database.


Database Cross References

SELECT  OBJECT_NAME (referencing_id) AS referencing_object, referenced_database_name, 
referenced_schema_name, referenced_entity_name
FROM sys.sql_expression_dependencies
WHERE 
referenced_database_name IS NOT NULLAND
is_ambiguous = 0; 


Object References with in the Database



SELECT  OBJECT_NAME (referencing_id) AS referencing_object, referenced_database_name, 
referenced_schema_name, referenced_entity_name
FROM sys.sql_expression_dependencies
WHERE is_ambiguous = 0; 

Post a Comment