Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SqlExec() syntax
Message
From
28/10/2005 12:58:46
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01062739
Message ID:
01063048
Views:
14
I guess we've got our own thread going on here, murkishly related to the original question. But nonetheless, let's carry on..

>Bit is integer data type not logical.

Agreed, in SS bit is of an integer data type in the way it was implemented. It's not a logical in the sense that it could contain a True or a False.

But: (you knew that was coming right?)
1- concept of a bit: value of 0 or 1, binary on or off. (the null value is more of a SQL thing, implementation I think)
2- consumption of a bit field: it's basically a flag.
2.a) If you import SQL data to most clients they will be interpreted as boolean. (excel, et. al)
2.b) SQL data providers will return bit fields as logical to the application layers, say in ADO the test for "adBoolean" in a bit field will be True.

I'd say it was meant as a replacement for a "True" logical data type.

>
>>So that's what you meant by integer field?
>>
>>I'd take the bit over the integer for a flag field. For all intents and purposes it is a logical type. (just don't allow nulls)
>>
>>>From BOL:
>>>
>>>bit
>>>Integer data type 1, 0, or NULL.
>>>
>>>
>>>>I would say the bit type is a logical data type in SQL Server. Only possible values of 0 or 1.
>>>>
>>>>>The datetime fields cannot be empty in SQL Server. Usually NULLs are used instead in which case IS NULL operator cabn be used.
>>>>>There're no logical data type in SQL Server. You can use any integer field instead.
>>>>>
IF someDateField IS NULL
>>>>>...
>>>>>IF someLogicalField = 0
>>>>>
>>>>>
Previous
Reply
Map
View

Click here to load this message in the networking platform