I need to update a column called bk_number within two tables that appear to be linked. I am not able to run the SQL to update one table first and then to update the other table afterwards because of the relationship between the tables. When I do try to update just one table, I get the following error message:
ERROR [23000] [Microsoft][SQL Server Native Client 11.0][SQL Server]The UPDATE statement conflicted with the FOREIGN KEY constraint "bk_document_dtl_1". The conflict occurred in database "Production_finance", table
"dbo.bk_document_mstr".
ERROR [01000] [Microsoft][SQL Server Native Client 11.0][SQL Server]The statement has been terminated.
Here is the information for the update I need to make:
Table 1 = bk_document_dtl
Table 2 = bk_document_mstr
Column to be updated = bk_number (the column name is the same in both tables)
Condition = set bk_number = '00002952' where bk_number = '00005888' (in other words, I just need to change the check/bk number from 00005888 to 00002952 in both tables)
Any help would be greatly appreciated!
Thank you!
Iris