SQL Stored Procedure

Introduction to Stored Procedure

  • Stored Procedure is a set of Structured Query Language (SQL) statements.
  • It is a subroutine available to applications that access a Relational Database Management System (RDBMS).
  • Stored procedure is assigned with the name that's stored in the database in compiled form, so that it can be shared by a number of programs.
  • It is helpful in controlling to access the data, preserving data integrity and improving productivity.

Advantages of a Stored Procedure

  • Stored procedures are easier to maintain and troubleshoot as they are modular.
  • It enables better tuning for performance.
  • It is much easier from a GUI end than building/using complex queries.
  • It helps in reducing the network usage.
  • It provides more scalability to an application.
  • It is reusable and hence reduces the code.