clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 582686 fiddles created (13285 in the last week).

create table t ( a int, b int, c int, d int) ;
 hidden batch(es)


alter table t add unique(b, c);
 hidden batch(es)


insert into t (a, b, c, d) values (1, 1, 1, 1), (2, 2, null, 2), (3, 2, null, null);
Msg 2627 Level 14 State 1 Line 1 Violation of UNIQUE KEY constraint 'UQ__t__A86D1816EDACB3D3'. Cannot insert duplicate key in object 'dbo.t'. The duplicate key value is (2, <NULL>). Msg 3621 Level 0 State 0 Line 1 The statement has been terminated.
 hidden batch(es)


select * from t;
a b c d
 hidden batch(es)