Decoding Set Options

  • Comments posted to this topic are about the item Decoding Set Options

  • I get it right, but I admit that the question is a little confusing: the value of 4 is the 3rd bit (starting from position ZERO, 2 is the right one). So, I understood you want to decod ANSI_WARNINGS that is GET_BIT(@@OPTION,3).

  • Yeah, I have to admit this one was a little confusing.  According to the documentation "Value 4" on the user options table is referring to CURSON_CLOSE_ON_COMMIT.  If you take it as the @@OPTIONS variable returns 4 (which is decimal) then you still end up with 0100 in binary which still indicates that value 4 of the user options table is set (CURSON_CLOSE_ON_COMMIT).  If you ignore that and only read it as "How do you determine if SET ANSI_WARNINGS is enabled/disabled?"; then it makes more sense.  At least to me...


    SELECT quote FROM brain WHERE original = 1
    0 rows returned

  • They do it in a lot of languages... I hate it when people number the bits differently than the exponent of "2".  😀

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • The whole 0 or 1 based thing seems incredibly annoying to me. Someone should have just stated everything is 0-based early on and demanded all languages stick to this.

  • +1000

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Once you actually get it that you need to work with OFFSET instead of pointers, handling bitwise operations will start working.

    I always have such problems when I'm in the US and people state they live on the first floor.

    At home this actually is groundlevel ( offset 0 ) - we only number and count the levels above or under ground level - and our first floor is called second floor in the US.

    But, as always, bitwise operations are fun once you start using operators.

     

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • Heh... I'm thinking about Left_Shift() and Right_Shift() (I always knew them as Shift-Left and Shift_right in the old days).  I can see that giving new meaning to the term RBAR.  I'd call it BBAB bit I've already assigned that term to "Befriended By A Bot".  Saw that happen last week on LinkedIn.  Really strange.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 8 posts - 1 through 7 (of 7 total)

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