In SQL Server the data type that resembles the most to Boolean is bit and the values allowed are 1,0 and NULL:
CREATE TABLE #test (
ID int,
Col_1 varchar(10),
Col_2 varchar(10),
Boolean_Col bit
)
That said, you have some options:
Filtered Unique Index
CREATE UNIQUE NONCLUSTERED INDEX UQ_Boolean_Col
ON #test(Boolean_Col)
WHERE Boolean_Col = 1;
Indexed View
You can see a sample of this technique here. In this case it wouldn't do anything different from a filtered index, but it would work in SQL Server 2005 (filtered indexes were introduced in 2008)
Scalar function in CHECK constraint
A summary of this technique can be found here. I discourage the use of this technique, because it would be incredibly slow. BTW, sorry for linking my blog again.
Trigger
I'm not a big fan of this solution because, again, it would be slow and non-declarative. However, it would/could work.
If you're interested in using the filtered index, here's a script to demonstrate how it would work:
-- test table using the definition you posted
CREATE TABLE #test (
ID int,
Col_1 varchar(10),
Col_2 varchar(10),
Boolean_Col bit
)
-- create the filtered unique index
CREATE UNIQUE NONCLUSTERED INDEX UQ_Boolean_Col
ON #test(Boolean_Col)
WHERE Boolean_Col = 1;
-- insert the sample data you provided
INSERT INTO #test VALUES(1,'Data','More Data',0)
INSERT INTO #test VALUES(2,'Data','More Data',1)
INSERT INTO #test VALUES(3,'Data','More Data',0)
-- Insert one more row that violates the constraint
INSERT INTO #test VALUES(4,'Data','More Data',1)
-- Msg 2601, Level 14, State 1, Line 2
-- Cannot insert duplicate key row in object 'dbo.#test' with unique index 'UQ_Boolean_Col'. The duplicate key value is (1).
-- The statement has been terminated.