i have a situation where i want to add unique constaint only when there is a certain value in other field for example the table is ID CategoryName Name Value CategoryID
Create a filtered unique index on Name for CategoryID = 0.
Name
CategoryID = 0