By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
14 rows affected
Msg 547 Level 16 State 0 Line 2
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Test2_Test1Id_Test1_Id". The conflict occurred in database "fiddle_5ad5aec102724cefb3c3db748f12f062", table "dbo.Test1", column 'Id'.
Msg 3621 Level 0 State 0 Line 2
The statement has been terminated.
Id |
---|
1 |
3 |
Test1Id | OldTest1Id | Id |
---|---|---|
1 | 1 | 1 |
null | 2 | 2 |
1 | 1 | 3 |
null | 2 | 4 |
3 | 3 | 5 |