I am trying to drop a table but getting the following message:
Msg 3726, Level 16, State 1, Line 3
Could not drop object \'dbo.UserProfile\' bec
You can also return all the information about the Foreign Keys by adapating @LittleSweetSeas answer:
SELECT
OBJECT_NAME(f.parent_object_id) ConsTable,
OBJECT_NAME (f.referenced_object_id) refTable,
COL_NAME(fc.parent_object_id,fc.parent_column_id) ColName
FROM
sys.foreign_keys AS f
INNER JOIN
sys.foreign_key_columns AS fc
ON f.OBJECT_ID = fc.constraint_object_id
INNER JOIN
sys.tables t
ON t.OBJECT_ID = fc.referenced_object_id
order by
ConsTable