I know that the closest one can get to a boolean data type in SQL Server 2005 is the BIT data type. However, SQL Server obviously works continously with boolean values (after all, it can handle comparisons). That being, is there any way one can “simulate” a boolean return value from an UDF? For example, I would like to be able to make a CHECK constraint using the syntax
(...) CHECK (dbo.FunctionReturningTrue())
instead of
(...) CHECK (dbo.FunctionReturningBit() = 1).
Is that possible?
In MS SQL Server, no.
Booleanis not a directly usable data type. You must compare the value to something.