@@OPTIONS

  • Comments posted to this topic are about the item @@OPTIONS

  • Heh... although it certainly does return a single integer (which is the answer I chose based on a coin flip between A and C), answer C is actually much more correct.  While an integer is certainly returned, that integer is a single element result set that identifies all of the SET options currently enabled for me as a user.  Just because it needs a little more work to figure out what the integer represents doesn't actually diminish the fact that it's a result set of 1 element that contains information as to all of the SET options that I have On or Off.

    And the explanation of the answer is technically incorrect, as well.  It states...

    @@OPTIONS returns a binary value that represents a bitmap of your SET options

    It patently is NOT a binary value.  It IS an integer value that represents a bitmap. 😉

    Still, great question.  I've never used @@OPTION before.

    --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)

  • Nice question, thanks Steve
    Agree with Jeff regarding the explanation, though...

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • One of those days when I know the right answer and click on the wrong answer.  I guess that makes up for the times when I click on the right answer for the wrong reason.

  • Well I had to guess as well but somehow I got it right. Thanks, Steve!

  • Apologies for the explanation. That is updated.
    For the  result set answer, expanded to note the answer is a multi-line result set.

    Technically, @@options returns an integer. You can get this with PRINT. If you use SELECT, you're choosing to cast the integer into a result set.

  • Steve Jones - SSC Editor - Tuesday, February 20, 2018 6:09 AM

    Apologies for the explanation. That is updated.
    For the  result set answer, expanded to note the answer is a multi-line result set.

    Technically, @@options returns an integer. You can get this with PRINT. If you use SELECT, you're choosing to cast the integer into a result set.

    Awesome and perfect!  Thanks, Steve!

    --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 7 posts - 1 through 6 (of 6 total)

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