What do we mean by Bit data type?

 Posted by vishalneeraj-24503 on 7/1/2014 | Category: Sql Server Interview questions | Views: 1279 | Points: 40

'Bit' is one of the integer or numeric data types in SQL Server that can have either 1, 0, or NULL value.

Actually,Bit datatype is used for storing boolean value like 1 or 0.1 for true and 0 for false.

Generally,we use Bit data type to check whether user account or employee is Active or In-Active.

We can use it like a BOOLEAN variable.

For Example:-
create table Employee_Master

employee_id int,
employee_name varchar(200) not null,
is_active bit

When we insert a record in Employee_Master table,SQL Server stores 0,1 or Null value in the is_active column.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response