• I love bits... when you understand the bits, then all else falls into place.

    Also makes me think back to the good ol' M/L days on the 6502, 8088, Z80 .

    Thanks David for writing about the bits.

    In SQL Server there are 2 usefull bit functions supplied by MS in the Master DB and available in any current database.

    ( I do not like their "all lowercase" names )

     

    Select fn_replinttobitstring(65535) -- 32 bits of passed integer

    and

    select fn_replbitstringtoint('0000000000000011111111111111111') -- integer of passed bit string

     



    Once you understand the BITs, all the pieces come together