SQL Server – boolean literal?

SQL Server doesn’t have a boolean data type. As @Mikael has indicated, the closest approximation is the bit. But that is a numeric type, not a boolean type. In addition, it only supports 2 values – 0 or 1 (and one non-value, NULL).

SQL (standard SQL, as well as T-SQL dialect) describes a Three valued logic. The boolean type for SQL should support 3 values – TRUE, FALSE and UNKNOWN (and also, the non-value NULL). So bit isn’t actually a good match here.

Given that SQL Server has no support for the data type, we should not expect to be able to write literals of that “type”.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)