Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Type

Author  Topic 

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-04-30 : 11:47:23
Can bit take Null value? If yes, in what sceniarios .

whitefang
Enterprise-Level Plonker Who's Not Wrong

272 Posts

Posted - 2009-04-30 : 11:53:10
It can but there is no reason for it to.
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-04-30 : 12:32:22
If That bit field is not set with any default value (Default constraint ) and you didn't insert value into that column.

For eg:

declare @test table ( id int identity(1,1), val varchar(30), ActiveYN bit)
insert into @test
select 'a', 1 union all
select 'b', 0 union all
select 'c' ,null

select * from @test
Go to Top of Page

sqlfresher2k7
Aged Yak Warrior

623 Posts

Posted - 2009-04-30 : 21:20:41
Thanks
Go to Top of Page

raky
Aged Yak Warrior

767 Posts

Posted - 2009-05-01 : 12:06:20
Welcome...
Go to Top of Page
   

- Advertisement -