Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 338 Bytes
SELECT
o.name Table_Name
,i.name Index_Name
,i.type_desc Index_Type
,fk.name Foreign_Key_Name
FROM sys.objects o
LEFT JOIN sys.indexes i
ON i.object_id = o.object_id
AND i.type <> 0
LEFT JOIN sys.foreign_keys fk
ON o.object_id = fk.parent_object_id
WHERE o.name IN ('PKTest_Main','PKTest_FK1','PKTest_FK2')