Programming in MS SQL Server 2012

Boolean Data Type

Boolean data value is a piece of information stated like True or False, On or Off, Yes or No and 1 or 0. BIT data type is used to stores Boolean data value in SQL Server. The following example describes a Boolean Data Type.

-- Example 73 --


DECLARE @IsMarried bit

SET @IsMarried = 1

SELECT @IsMarried AS [Is Married?]

Query Output Screen

* * * * *

Email Your Comment To AUTHOR