(Flags & 0x8) != 0

  • hey all

    I ran across something in profiler today for a vendor product we are having issues with - I cannot find what this means:

    (

    Flags & 0x8) != 0

    I ran a top 10 on select on table, and the "flags" column has the following "flags"

    2392

    2424

    35160

    264520

    264524

    264552

    264776

    264780

    2359624

    2359656

    2361676

    So, what is this doing??

    TIA,

    Cory

    -- Cory

  • That field holds a bunch of bits that each denote some piece of information, and they're using the bitwise AND ( & ) with the hex value of "8" to see if that particular bit (the "1" in this 00001000) is set. If it is, that operation will be non-zero.

    It's set in:

    2392 100101011000

    2424 100101111000

    35160 1000100101011000

    ...and so on. No clue what that particular bit denotes in your app, though, but the vendor does. It's typically used for things like configuration settings, where a bunch of options are toggled on or off, etc, but could be just about anything where you have a bunch of different values that you want to store in a single column, and where each value has no more than two states.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply