pdvsa
asked on
Update query help
Experts,
I have the below SQL.
I need to update blLetterOfCredit.[Guarante eCode] to the value in Import-csm.[Guarantor Code]
I think I have it right but it gives me an error that basically says it cant update due to key violations.
Import-csm.[Guarantor Code] and tblLetterOfCredit.Guarante eCode are both the same property in the tables as Double, General Number and Indexed No duplicates. I initially had Import-csm.[Guarantor Code] as a Primary Key thinking that might be the issue but I removed it and still have the same error.
What do you think could be the cause of this error?
here is the SQL:
UPDATE [Import-CSM] INNER JOIN tblLetterOfCredit ON [Import-CSM].[Reference Number] = tblLetterOfCredit.LCNo SET tblLetterOfCredit.Guarante eCode = [Guarantor Code];
I have the below SQL.
I need to update blLetterOfCredit.[Guarante
I think I have it right but it gives me an error that basically says it cant update due to key violations.
Import-csm.[Guarantor Code] and tblLetterOfCredit.Guarante
What do you think could be the cause of this error?
here is the SQL:
UPDATE [Import-CSM] INNER JOIN tblLetterOfCredit ON [Import-CSM].[Reference Number] = tblLetterOfCredit.LCNo SET tblLetterOfCredit.Guarante
Is tblLetterOfCredit.Guarante eCode involved in any indexes that may be defined as unique?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Specifically check for duplicate [Import-CSM].[Reference Number] or tblLetterOfCredit.LCNo. If either of these tables contain duplicates the the update will fail since there is more than one match in the inner join.
ASKER
darn duplicates. thx
ASKER