Information générale
Catégorie:
Bases de données
Versions des environnements
>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
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement