How do you create a yes/no boolean field in SQL server?

leora picture leora · Nov 22, 2009 · Viewed 841.3k times · Source

What is the best practice for creating a yes/no i.e. Boolean field when converting from an access database or in general?

Answer

Guffa picture Guffa · Nov 22, 2009

The equivalent is a BIT field.

In SQL you use 0 and 1 to set a bit field (just as a yes/no field in Access). In Management Studio it displays as a false/true value (at least in recent versions).

When accessing the database through ASP.NET it will expose the field as a boolean value.