• nazaninahmady_sh (12/22/2013)


    Hi

    what is the difference between these 2 variables in store procedure:

    1- the variables before As

    2- the variable with declare after As

    thanks alot

    The variables before the "AS" are paremeters that you can pass into the stored procedure.

    The variables with the DECLARE that come after the "AS" are local variables to the procedure.

    I strongly recommend that you get into SSMS , press the {f1} key to get into "Books Online" (the help system that comes with SQL Server), and do a search for "CREATE PROCEDURE" to learn more about the different parts of Stored Procedures and how to build them correctly.

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