Suppose we need to check the dependencies for the table tbl_Customer
Sample Query:
DECLARE @Objectname varchar(100)
SET @Objectname='tbl_Customer'
SELECT O1.name,O2.name FROM sys.sql_dependencies D INNER JOIN Sys.Objects O1 ON O1.object_id=D.object_id
INNER JOIN Sys.Objects O2 ON O2.object_id=D.referenced_major_id
WHERE O1.name=@Objectname OR O2.name=@Objectname
No comments:
Post a Comment