By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
4 rows affected
1 rows affected
ID | UserName | Gateway | Code | ActiveTo | OrgId | IgnoreThisDuplicate |
---|---|---|---|---|---|---|
1 | user1 | gateway | 50 | null | 100 | null |
2 | user1 | gateway | 50 | null | 101 | 2 |
3 | user2 | gateway2 | 51 | null | 102 | null |
4 | user3 | gateway3 | 52 | 17/08/2012 00:00:00 | 103 | null |
1 rows affected
Msg 2601 Level 14 State 1 Line 2
Cannot insert duplicate key row in object 'dbo.Example' with unique index 'UNQ_Example_UniqueNewUsernameGatewayCode'. The duplicate key value is (user2, gateway2, 51, <NULL>).
Msg 3621 Level 0 State 0 Line 2
The statement has been terminated.
1 rows affected