开发者

Simulating Boolean Return Values in SQL Server 2005

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 bei开发者_开发知识库ng, 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.
Boolean is not a directly usable data type. You must compare the value to something.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜