Option 1: Right-click on a table and choose 'View Dependencies'.
Option 2: For some reason if you want to do it programmatically check out the below code snippet
Select
S.[name] as 'Dependent_Tables'
From
sys.objects S inner join sys.sysreferences R on S.object_id = R.rkeyid
Where S.[type] = 'U' AND R.fkeyid = OBJECT_ID('Person.StateProvince')
Option 2: For some reason if you want to do it programmatically check out the below code snippet
Select
S.[name] as 'Dependent_Tables'
From
sys.objects S inner join sys.sysreferences R on S.object_id = R.rkeyid
Where S.[type] = 'U' AND R.fkeyid = OBJECT_ID('Person.StateProvince')
No comments:
Post a Comment