I have a table with these columns:
create unique index t_ix_Customer_Number_Is_Deleted_0 on t (Customer_Number) where Is_Deleted = 0
insert into t (ID,Customer_Number,Is_Deleted) values (1,1,1),(2,1,0),(3,1,1),(4,1,1)
(4 row(s) affected)
update t set Is_Deleted = 0 where ID = 1
Msg 2601, Level 14, State 1, Line 5
Cannot insert duplicate key row in object 'dbo.t' with unique index 't_ix_Customer_Number_Is_Deleted_0'. The duplicate key value is (1).
The statement has been terminated.