• Thank you for that.

    Those tables not involved in any relationships are not displayed (by design), but to display them simply add this snippet just before the script displays the final answer:

    -- Add to answer table those tables involved in no relationships (ie. what's left)

    -- Use -1 as Level

    INSERT INTO tblAnswer([Level], A)

    SELECT -1, name FROM dbo.sysobjects

    WHERE OBJECTPROPERTY(id, N'IsUserTable') = 1

    AND name NOT IN ('sysdiagrams','tblPreorder','tblAnswer')

    AND name NOT IN

    (

    SELECT DISTINCT A FROM tblAnswer

    )