This is my target Table
T1
(
Id int not null PK,
Name nvarchar(10) not null
Flag bit not null
)
I need a Constraint check for check that in every row with same name just one row have a true flag, in other words I need a UK for (1-True value of flag , 2-Name), same names can have a false flags but just one of them can have a True flag. Does any one know about this script?
Use a filtered unique index