HI,
while saving in bit field sometimes it is saved as true or false. sometimes it is saved as 0 or 1.
how to make it true or false when i needed.
if i set default value to 0 will it save 1 or 0 always.
with default 0 i need to store truee or false. how it is possible this way.
thanks
venp
Hi,
the bit data type always stores either 0 (which is false) or 1 (which is true). A default value is used if no value is explictly passed through.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
HI jens,
sometimes it stores the word True or False(bit field) thats why i'm confused.
i need to know when it stores 0 or False and 1 or True.
it is confusing me a lot.
venp
|||
Hi,
no the BIT data type is a INT type with the constraint of holding only 0 or 1. The true or false is a client presentation you are seeing, Excel will for example use this presentation for the boolean type.
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
Hi, 00 | True | False |
01 | True | False |
02 | True | False |
210 | True | False |
220 | True | False |
250 | True | False |
03 | False | False |
the above values i copied from table. true ,false fields are bit datatype.
venp--
|||Where did you copied the output from ?|||from sqlserver table .i opened the table in sql server and copied.
venp--
|||Do the same query in the query window of SSMS and you will see that this is just a question of presentation. SSMS will display BIT as true / false but SQL Server stores 1/0.-Jens.|||
you are right
venp--
No comments:
Post a Comment