For a general way, use this and you will get all tables with a foreign key, and then you can do a loop to check all the tables in the list. This way you can add foreign keys, and no changes to the code are needed ...
SELECT sys.sysobjects.name, sys.foreign_keys.* FROM sys.foreign_keys inner join sys.sysobjects on sys.foreign_keys.parent_object_id = sys.sysobjects.id WHERE referenced_object_id = OBJECT_ID(N'[dbo].[TableName]')
Diego vieira
source share