Home Forums SQL Server 2008 T-SQL (SS2K8) The value of variable is disappearing in stored procedure RE: The value of variable is disappearing in stored procedure

  • David Webb-200187 (4/30/2010)


    Just a shot in the dark without being able to see the code, but if you're using the variable in any concatenation operation, you might want to set the CONCAT_NULL_YIELDS_NULL option off and try it again. With the option on, any concatenation with a NULL will change the entire string to NULL.

    Oh... absolutely correct but I wouldn't do it that way especially since it's already known that future versions of SQL Server will not have the option of turning it off. Better to use ISNULL() for such things.

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