(Note:- There may be syntax errors in the code i write here)
I have a Table with 2 Fields
CREATE TABLE Traces ( TraceName VARCHAR(100), BlockVector VARCHAR(MAX), NumHits INT);
There are around 1 Millions Entries in the Table.
I want to achieve following things from that table:
1) For each row take a bitwise XOR of BlockVector column with another VARCHAR of same length and store the number of set bits in NumHits column
2) Finding Maximum Value of NumHits column.
For finding XOR in T-SQL , we can use '^' operator. How to find number of set bits.
Any help would be hightly appreciated.