Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Boolean across technologies
Message
From
21/02/2008 03:16:31
 
 
To
21/02/2008 00:38:50
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01294595
Message ID:
01294619
Views:
18
>If I would be back in time, when designing a table in VFP, I would have avoided any logical type and used a numeric 1 to hold 0 for False and 1 for True. Despite the fact that we have a Bit type in SQL Server, when doing the query, we have to consider using something like MyField=1 or MyField=0. The numeric value should seem more universal in SQL commands that a logical/boolean type. Is that correct?

correct

>As is the case now, in order to support those two environments, when comes time to deal with a SQL Server backend, I have to convert, at the framework level, any boolean parameter into a bit 0/1 if I hit a SQL Server backend. But, if that parameter would have been originally a numeric 1, I wouldn't have to deal with that at all and simply pass 0 or 1 in my parameter without worrying to convert based on the backend, if applicable, as the numeric 1 would be universal.

But you would have to worry that "newer" trends in backends might grow a boolean type. Thus it should be delegated to the adapter between business and data tier.

>Any feedback on how you negotiate with that when dealing with VFP/SQL Server environment?

If you have any kind of tiered approach I'd argue strongly against directly programming to [0,1].

regards

thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform