Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic Where Clause In Stored Procedure
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00634614
Message ID:
00645544
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform