Just a couple of dummy rows that you can use for the inserts later before you add the constraint.create table parent (id int primary key, first_child int not null)create table child (id int primary key, parent int references parent(id))insert into parent(id, first_child) values (0, 0)insert into child(id, parent) values (0, 0)alter table parent add constraint fk_first_child foreign key (first_child) references child(id)
Now when you insert, just specify the first child as 0 in the parent insert, and then update it as you were.begin transactioninsert into parent(id, first_child) values (1, 0)insert into child(id, parent) values (1, 1)update parent set first_child = 1commit transaction