SQL server reverse task : correctly retrieve table foreign keys