Friday, September 23, 2011

Query which will show all the tables which is referenced by the table

  • The following example lists the database objects that depend on the Sales.Customer table in the AdventureWorks2008R2 database. Both the schema name and table name are specified.

USE AdventureWorks2008R2;
GO
EXEC sp_depends @objname = N'Sales.Customer' ;
 
  • The following example lists the database objects on which the trigger iWorkOrder depends. 
 
EXEC sp_depends @objname = N'AdventureWorks2008R2.Production.iWorkOrder' ;
 

No comments:

Post a Comment