I know how to use bitwise operators to determine whether a particular bit is set or not. eg: to check if the third bit is set I might say (in psuedo code)
if myBitMask & 4 = 4 then TRUE
however, I have a bitmask of 2,000 bits, and i want count how many are set (the set bits represent a bad event occured, and i want to count how many bad events occurred in total.
00001000011100000001000000100001 should be "7"
i.e in pseudo code: countofSetFlags(myBitMask)
I'm hoping to do this efficiently. I'll be querying over a million rows,