• You can use the link below which has a script for the same.

    http://www.sql-articles.com/index.php?page=Scripts/orphan_id.html

    Cheers,
    Sugeshkumar Rajendran
    SQL Server MVP
    http://sugeshkr.blogspot.com