This project has moved and is read-only. For the latest updates, please go here.

ForeignKey referenced table not filled in

Aug 6, 2014 at 6: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 6:26 PM
Additionally, FK constraints might refer to tables in different schemas. It seems there's a property missing: RefersToSchema.

Aug 7, 2014 at 8: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.