One big stored procedure?

D

Dominic Marsat

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
 
B

Bob Barrows [MVP]

Dominic said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top