Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please anyone tell me how stored procedure improve the performance
Posted
Updated 12-Jan-11 0:46am
v2

It's compiled once. The query doesn't have to be sent to the server, only it's parameters

Cheers
 
Share this answer
 
Dear Friend
Some reasons for preferring stored procedure are

  1. Easy maintainability- Stored procedures are easy to maintain and can be directly deployed without recompilation of code
  2. Increased Performance- When grouping a set of operations in to a single procedure will increase the performance by reducing the number of round trips to the database server
    eg - One Insertion and modification (both are depended each other) using procedure will get completed in a single tick to server ; if not implemented the same using procedure, in that case for executing each process application have to go to server and execute the statement
  3. Data Integrity Is Maintained - Consider the above situation if insertion is causing error then without moving to updation the operation will be terminated by raising an error if the operations are implemented using procedure else if insertion is causing error then it may try with updation which is meaning less as insertion caused error



Hope you got an idea and will continue to use stored procedure for further application development


Happy Programming

Vipin Kumar Mallaya

 
Share this answer
 
0) The stored procedure doesn't have to be re-written if you refactor the code to a different language, leading to ease of maintenance, and even a certain amount of portability.

1) If you need to, you can use the database from additional platforms by simply writing the front end.

2) You can add "SQL server" to your resume...
 
Share this answer
 
Comments
Sandeep Mewara 13-Jan-11 4:01am    
I like the bullet point 2! Very few might had thought of it! :)
wizardzz 13-Jan-11 12:12pm    
Would a possible 3) be:

Frontend developers don't need as much query syntax knowledge or knowledge regarding the actual column names and/or relationships between tables. It also prevents developers from using "Select *" statements, which are typically bad practice.

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