One big stored procedure?

Discussion in 'ASP General' started by Dominic Marsat, Nov 1, 2004.

  1. Hi,

    I'm calling a series of stored procedures from ASP in the format

    sqlString = "SPROC_1 @param=1 "
    Conn.Execute sqlString, , 129

    sqlString = "SPROC_2 @param=2 "
    Conn.Execute sqlString, , 129

    sqlString = "SPROC_3 @param=2 "
    Conn.Execute sqlString, , 129

    sqlString = "SPROC_4 @param=2 "
    Conn.Execute sqlString, , 129

    Permforming various UPDATEs and INSERTs on a number of different tables in
    the same database.

    Is it better to group all the procedures together as one big SP?

    Cheers, Dominic
     
    Dominic Marsat, Nov 1, 2004
    #1
    1. Advertising

  2. Dominic Marsat wrote:
    > Hi,
    >
    > I'm calling a series of stored procedures from ASP in the format
    >
    > sqlString = "SPROC_1 @param=1 "
    > Conn.Execute sqlString, , 129
    >
    > sqlString = "SPROC_2 @param=2 "
    > Conn.Execute sqlString, , 129
    >
    > sqlString = "SPROC_3 @param=2 "
    > Conn.Execute sqlString, , 129
    >
    > sqlString = "SPROC_4 @param=2 "
    > Conn.Execute sqlString, , 129
    >
    > Permforming various UPDATEs and INSERTs on a number of different
    > tables in the same database.
    >
    > Is it better to group all the procedures together as one big SP?
    >
    > Cheers, Dominic


    Yes. Or at least call a single stored procedure that runs each individual
    one. You are not taking advantage of one of the biggest benefits of using
    stored procedures: code encapsulation. Make one call to the database instead
    of 4.

    Bob Barrows

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Nov 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike P
    Replies:
    0
    Views:
    3,384
    Mike P
    Jun 19, 2006
  2. Shaguf
    Replies:
    0
    Views:
    565
    Shaguf
    Dec 24, 2008
  3. Shaguf
    Replies:
    0
    Views:
    514
    Shaguf
    Dec 26, 2008
  4. Shaguf
    Replies:
    0
    Views:
    281
    Shaguf
    Dec 26, 2008
  5. Shaguf
    Replies:
    0
    Views:
    261
    Shaguf
    Dec 24, 2008
Loading...

Share This Page