I'm trying a simple update of T_ADDRESS to get our addresses in line according to the USPS standards. the problem is I get the following error message:
The UPDATE statement conflicted with the FOREIGN KEY constraint "FK_T_ADDRESS_TR_STATE_state". The conflict occurred in database "Impresario", table "dbo.TR_STATE".
While I understand the concept of the foreign key constraint error, I don't understand how specifically changing the state to something else (in the case where people have moved out of state) in an upddate. Do I have to inactivate the current primary address, then add the new address as a new primary address? A little explanation of the error and what can be done about it would be very helpful.
Thanks, Tessiturians.
April Fool's Trivia: Apple Computer was founded on this day in 1976.
Hi Matt
No, it's most likely telling you that the state that you're trying to update the record to doesn't exist in the tr_state table (so it's violating the FK constraint.)
Ken
Matt,
What Ken said.
I would also mention the time wasting problem I have had in the past. Some of the entries in our TR_STATE table had trailing spaces. So when I queried it and saw "KS" as a value I couldn't understand why I wasn't allowed to update T_ADDRESS with "KS". In reality, the TR_STATE record said "KS ".