Linked Object - bug with multi-column foreign keys

Avatar
  • updated
  • Completed
In the case of a foreign key based on > 1 columns, Add Linked Object seems to be not correctly interpreting the relation.  For example:

ALTER TABLE [dbo].[EQUIP_LEASE] ADD CONSTRAINT [FK_EQL_SUB_STATUS_CODE] FOREIGN KEY([STATUS_CODE], [SUB_STATUS_CODE])
REFERENCES [dbo].[EQUIP_SUB_STATUS_CODE] ([STATUS_CODE], [SUB_STATUS_CODE])

So, if we have EQUIP_LEASE on the query designer, and then click the Linked Objects button, I'd expect to see:
--> EQUIP_SUB_STATUS_CODE(STATUS_CODE,SUB_STATUS_CODE), and clicking it would add that table with a join on both columns.

However, what you actually see is two separate items:
--> EQUIP_SUB_STATUS_CODE(STATUS_CODE)
--> EQUIP_SUB_STATUS_CODE(SUB_STATUS_CODE)
....and when clicked, it adds the table, but only with a join on that single column.
Avatar
Anonymous
Hello, Trevor.

Thank you for your report.

We will correct this behavior in the next version.
Avatar
Anonymous
To what database server are connecting? 
Avatar
Trevor Gould
Microsoft SQL Server 2012 (SP1) - 11.0.3460.0 (X64) 
Avatar
Anonymous
Fixed now.
Avatar
Trevor Gould
Thanks, it is now creating the proper SQL.

The relationship representation in the "Add Linked Object" window is still a bit confusing, I think:

ForeignKeyTable(Column1,Column2)

...would make it more clear.
Avatar
Anonymous
Hello, Thank you for your suggestion. The tool displays fields there only if table appears more than once in in this menu.