you can check for foreign key constraints using this query-
UPDATE
SET A.deleted = 1
FROM tblParent A
LEFT JOIN tblChild B ON A.PID = B.PID
WHERE B.PID IS NULL
_______________________________________________________________
To get quick answer follow this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/