Click here to Skip to main content
14,331,586 members
Rate this:
Please Sign up or sign in to vote.
Dear All,

my quation is one table relation to how many tables related. how to find out table relation. i need how to find out relation through sql command .
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

To view objects which are depend on a table :
EXEC sp_MSdependencies N'TableName', null, 1315327


To view objects on which a table depend on :
EXEC sp_MSdependencies N'TableName', null, 1053183


Extracted from here :
http://www.mssqltips.com/sqlservertip/1294/listing-sql-server-object-dependencies/[^]

Hope it helps.
   
Comments
Abhinav S 29-Jan-12 3:22am
   
Fair answer. 5.
Amir Mahfoozi 29-Jan-12 3:27am
   
Thanks Abhinav. :)
Rate this:
Please Sign up or sign in to vote.

Solution 2

ya above is right solution

<b>
EXEC sp_depends 'Customers'</b>
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100