Lengthy procedure vs Split procedure

  • Hi All,

    Will there be any differences in terms of execution if i write complex functionality in single procedure or can i split them into multiple procedures.

  • ManoharV (11/23/2009)


    Hi All,

    Will there be any differences in terms of execution if i write complex functionality in single procedure or can i split them into multiple procedures.

    Nope... usually no difference what so ever. But, it's really worthwhile if you can reuse some of those multiple procedures or you just want to split up some of the functionality so that you don't have to regression test a monster sproc if you make a change to just one part of it. Whatever you do, make those procedures handle more than one row at a time. They should solve problems as result sets... not individual rows.

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

  • Thanks Jeff.

  • Also splitting it up across multiple stored procedures will be more conducive to concurrent development within a team of developers.

  • Unfortunately, that's not been my particular experience. I usually experience the ol' "too many cooks spoil the broth" syndrome.

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

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