Monday, August 12, 2013

Find Dependency of an Object in SQL Server.

If we want to know dependency of Object in MSSQL it is very easy to find out by using following query.
It is very useful because of if we want to modify/delete any object like Function/Procedure then it is necessary to know where actually it is used.

USE TEST_DB
SELECT * FROM SYS.DM_SQL_REFERENCING_ENTITIES ('DBO.MY_FUNCTION', 'OBJECT');