Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Dynamic Where Clause In Stored Procedure
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00634614
Message ID:
00645544
Vues:
26
Are the Multi-value Yes/No fields true binary columns or character columns filled with 0's and 1's?

Are there too many Yes/No fields that you can't break them into seperate columns?

Maybe instead of using all the SUBSTRING() functions, you could combine all the required Yes/No fields into a single constant literal. For example, say that the user wants the all the columns where the value in position 2 and 3 are set. Instead of doing:

WHERE SUBSTRING(field, 2, 1) = '1' AND SUBSTRING(field, 3, 1) = '1' ...

You could do something like this:

WHERE field = '011000 ... 0'

Same thing with true binary values.

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform