Not quite sure how this relates to dotnet...
So is there any solution to this problem?
more usefully, how about:
WHERE ',' + SubCatId + ',' LIKE '%,1,%'
Obviously this is simpler if your csv starts and ends with ',' as you don't
need the extra concatenation (on the left-hand-side). However! This approach
should only be used if your CategoryID can limit the results fairly well;
LIKE with an open start can't really use the index (especially since we are
using a computed [concatenated] value, not the raw column value).
Personally I'd be inclined to store the data out into another table, or
(perhaps) use sqlxml which provides /a/ mechanism (perhaps not the best) to
store multiple values in a single field while retaining the ability to query
and index.
Marc
Leave a comment: