| Author |
Topic  |
|
|
Reji
Starting Member
India
2 Posts |
Posted - 07/19/2010 : 10:30:47
|
Hi,
I have one bit data type column in SQL Server 2008, I want to retrieve that value always 0 even if it containing NULL. can any one know like setting that we can do in db.
Thanks in Advance. Reji |
|
|
jimf
Flowing Fount of Yak Knowledge
USA
2868 Posts |
Posted - 07/19/2010 : 10:32:51
|
SELECT ISNULL(bitColumn,0)
Jim
Everyday I learn something that somebody else already knew |
 |
|
|
Sachin.Nand
Flowing Fount of Yak Knowledge
2937 Posts |
Posted - 07/19/2010 : 12:43:01
|
quote: Originally posted by Reji
Hi,
I have one bit data type column in SQL Server 2008, I want to retrieve that value always 0 even if it containing NULL. can any one know like setting that we can do in db.
Thanks in Advance. Reji
0 as your columname ex 0 as 'bit'
Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.
PBUH |
 |
|
|
Reji
Starting Member
India
2 Posts |
Posted - 07/22/2010 : 00:42:19
|
Thanks. My requirement is something diferent. I will describe the scenario. Due to one middle driver issue, earlier version of the driver was retrieved 0 in bit column even if value is NULL. But now updated driver rturning NULL for NULL. I want to supress this behaviore(Because UI code already done with respect to this behaviore). In left outer join also I want 0 value for NULL. I am not ready to change the UI code or procedure. Thanks, PRR |
 |
|
|
Sachin.Nand
Flowing Fount of Yak Knowledge
2937 Posts |
Posted - 07/22/2010 : 02:01:44
|
But in your previous post you stated that you wanted to display always 0 no matter what the values is.
Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.
PBUH |
 |
|
|
Lamprey
Flowing Fount of Yak Knowledge
3829 Posts |
Posted - 07/22/2010 : 14:48:06
|
quote: Originally posted by Reji
Thanks. My requirement is something diferent. I will describe the scenario. Due to one middle driver issue, earlier version of the driver was retrieved 0 in bit column even if value is NULL. But now updated driver rturning NULL for NULL. I want to supress this behaviore(Because UI code already done with respect to this behaviore). In left outer join also I want 0 value for NULL. I am not ready to change the UI code or procedure. Thanks, PRR
See Jims post from 07/19/2010 : 10:32:51 and use the ISNULL function or, if you want to be ANSI/ISO compiant, use the COALESCE function. |
Edited by - Lamprey on 07/22/2010 14:48:23 |
 |
|
| |
Topic  |
|