• My head spins...

    If I understand it correctly, you have a table with bit values and you want to make some sort of comparison, and you think that a varbinary(MAX) is not what you need. But I'd say that most likely it isn't.

    Why don't you present your original problem instead, and might be able to find a solution. A tip: you help yourself enormously if you post:

    1) CREATE TABLE statements for your table(s).

    2) INSERT statements with sample data.

    3) The desired result given the sample.

    4) A short description of the business rules.

    This way can copy the script you post to develop a tested solution.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]