Closed bartread closed 8 years ago
Boom! Just added fix, along with a test case that generates this:
SELECT [ta0_suwsd].[UserKey],
[ta0_suwsd].[UserGUID],
[ta0_suwsd].[Username],
[ta0_suwsd].[EmailAddress],
[ta1_samd].[PhoneGuid],
[ta1_samd].[SipUserId],
[ta1_samd].[SipPassword],
[ta1_samd].[SipProxyUserId],
[ta1_samd].[SipProxyPassword],
[ta1_samd].[SipAccountTypeKey],
[ta1_samd].[RecStatusKey],
[ta1_samd].[VoicemailPhoneGuid],
[ta1_samd].[UserGuid]
FROM [user].USER_MST AS ta0_suwsd
LEFT OUTER JOIN dial.SIP_ACCOUNT_MST AS ta1_samd
ON ta1_samd.[UserGuid] = ta0_suwsd.[UserGUID]
WHERE ta0_suwsd.[UserKey] = @UserKey
;
I really need to wire in some logging and automated verification for these generated scripts. Will do today but for now we need this fix in.
For many to one relationships in SimpleSave it's possible to specify the target column for a foreign key relationship from the parent table. Unfortunately SimpleLoad doesn't respect this.
Here's an example query showing where it falls down:
Note the following erroneous
JOIN
:As the following shows, the column in both cases should be
UserGUID
: