Why do we use Stored Procedures?

There are lot of Advantages of creating a stored procedure instead of running DB scripts individually.

Below are the major reasons which tell us why we use stored procedures in DB.

  • The Best feature of stored procedures is, compile once and execute as many times as we can.
  • We can easily store the group of scripts in database and provide better security to our data by granting Execute permissions on it.
  • We can reduce the network traffic by sending the hundreds of lines of code as a single statement.
  • When we compile it first time, it creates an execution plan for it and cached in memory for future. It improves the performance by utilizing this execution plan when we execute it next time.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.