Quick question concerning variables and recompiling

  • Hello all,

    Quick question from a newb :

    I've searched through BOL and here for an answer but can't seem to find one.  After a variable has been declared, if I change the SET @variable from = 120 to SET @variable = 70 does the stored procedure need to be recompiled or will it automatically use the updated variable when it runs the next time?  The proc has been in use for a while but I need to change this one value and need to know if I need to do anything else to let SQL know the change has been made.  Thanks in advance for any and all assistance.

  • I assume it recompiles since there is an explicit command alter procedure.

  • You don't need to explicity recompile it.

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

  • Thank you guys so much for the responses!

  •  

    quoteEveryday should be a good day to die

    There are no good days to die... it's over rated

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

  • True death is over rated, but if you're gonna do it you might as well have gotten in everything that you wanted to do! 

  • Heh... yeah, I knew what you meant... I was just teasin' for a minute 'cause I woke up this morning feeling great.   Sorry, Tao...

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

  • No worries at all Jeff. 

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

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