Since you didn't provide your table structure it is hard to give you more options. But, if your table as a numeric key, you might be able to use a computed column and unique constraint.CREATE TABLE dbo.Test( ID INT NOT NULL IDENTITY(1,1) PRIMARY KEY, IsDefault BIT NOT NULL DEFAULT(0), Uniqifier AS (CASE WHEN IsDefault = 0 THEN -1 * ID ELSE IsDefault END) PERSISTED NOT NULL)ALTER TABLE dbo.Test ADD CONSTRAINT UC_Test UNIQUE (Uniqifier ASC)go INSERT dbo.Test (IsDefault) VALUES (0)INSERT dbo.Test (IsDefault) VALUES (1)INSERT dbo.Test (IsDefault) VALUES (1)-- FailsUPDATE dbo.Test SET IsDefault = 1 WHERE ID = 1 --FailsUPDATE dbo.Test SET IsDefault = 0 WHERE ID = 2 INSERT dbo.Test (IsDefault) VALUES (1)
EDIT: Forgive the spelling errors, I jsut ripped this out.