• Kristen-173977 (9/29/2015)


    tshad (9/28/2015)


    in the same order as in the query.

    Order is not important. I would recommend that you change the call to your SProc from:

    EXEC R01OrderForm @Region, @District, ...

    to

    EXEC R01OrderForm @Region = @Region, @District = @District, ...

    because that means that the sequence of your parameters does not have to match the sequence that is defined for the SProc. Particularly important if someone modifies the Sproc to add a new parameter definition, in the middle of all the existing ones!

    Absolutely right. The exception to that being natively compiled stored procedures in SQL Server 2014 and greater. There the ordinal calls are preferred. Actually makes me crazy.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning