ForeignKey referenced table not filled in

Aug 6, 2014 at 5:13 PM
In MSSQL, constraint.RefersToTable doesn't seem to work properly when you have schema names involved. I have a bunch of tables in dbo and some others in Orders. The FKs either (1) pointing to the tables in Orders (from dbo) OR (2) being of tables in Orders, don't have any value in RefersToTable.

RefersToConstraint is populated in all cases.
Aug 6, 2014 at 5:26 PM
Additionally, FK constraints might refer to tables in different schemas. It seems there's a property missing: RefersToSchema.

Aug 7, 2014 at 7:23 AM
The sql to get the constraints joins various tables using the schema. The different schema revealed a flaw in one of the joins. I'll fix that shortly.

I've already added databaseContraint.RefersToSchema.