views:

44

answers:

5

Is there Boolean data in sql server like mysql?

What is the alternative in sqlserver

+1  A: 

SQL Server uses Bit

HackedByChinese
+1  A: 

You can use Bit DataType in slq server to store boolean data.

Pranay Rana
+1  A: 

You could use the BIT datatype to represent boolean data (a BIT field's value is either 1 or 0)

kristian
+1  A: 

Use the Bit datatype. It has values 1 and 0 when dealing with it in native t-sql

Rodrick Chapman
+2  A: 

You may want to use the BIT data type, probably setting is as NOT NULL:

Quoting the MSDN article:

bit (Transact-SQL)

An integer data type that can take a value of 1, 0, or NULL.

The SQL Server Database Engine optimizes storage of bit columns. If there are 8 or less bit columns in a table, the columns are stored as 1 byte. If there are from 9 up to 16 bit columns, the columns are stored as 2 bytes, and so on.

The string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.

Daniel Vassallo