Click here to Skip to main content
15,902,899 members
Please Sign up or sign in to vote.
4.33/5 (2 votes)
See more:
Hi
I would like to know i currently have a process in my application that uses about 5 stored procs which could be combined into a single stored proc as they dont use any parameters and they are used to update certain tables in my database after reading some text files.

I would like to know is it better practice to keep opening the db connection run the one proc and then close the connection to the db and open the conection again and run the second proc and close db con etc or would it be better to combine the 5procs into a single proc and run the single proc?
Posted
Comments
Herman<T>.Instance 4-Feb-14 3:37am    
I would make a 6th proc which would call the other 5. You keep seperate functionalty but you can also call then in one call.

1 solution

Hi isi19,

While executing 5 procs in 6th Proc make sure you exectute them in Sql Transaction.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900