>use [MyDatabase] >go >begin transaction >update parent set employee = 'TEST34' where employee = 'TEST1' >update child set employee = 'TEST34' where employee = 'TEST1' >commit >I got the same error and it's explainable. Here is the test I just made - only after I added the setting key to NULL in the child table first it worked:
use tempdb create table Employee (EmpNo varchar(20) primary key, EmpName varchar(200)) insert into Employee values ('Test1','Naomi') create table Salaries (EmpNo varchar(20), Salary money) alter table Salaries add constraint FK_Salaries_Employee_EmpNo foreign key (EmpNo) references Employee (EmpNo) insert into Salaries values ('Test1', 1000) go begin transaction update Salaries set EmpNo = NULL where EmpNo = 'Test1' update Employee set EmpNo = 'Test32' where EmpNo = 'Test1' update Salaries set EmpNo = 'Test32' where EmpNo = 'Test1' commit transactionYou should either have CASCADE relation or set the FK value to NULL first. Otherwise it's a "catch 22" situation.