What are the Advantages of Using Stored Procedures?

What are the Advantages of Using Stored Procedures?


Stored procedures provide performance benefits through local storage, precompiling the code, and caching. It offers security features that includes encryption and privilege limits that restrict users from modifying structure of stored procedure.

Advantages of using stored procedures are:


  • Execution plan retention and reuse
  • Query auto-parameterization
  • Encapsulation of business rules and policies
  • Application modularization
  • Sharing of application logic between applications
  • Access to database objects that is both secure and uniform
  • Consistent, safe data modification
  • Network bandwidth conservation
  • Support for automatic execution at system start-up
  • Enhanced hardware and software capabilities
  • Improved security
  • Reduced development cost and increased reliability
  • Centralized security, administration, and maintenance for common routines

Why we can't execute a stored procedure from a User Defined function(UDF)

Functions cannot "touch" any database but read them only. Stored procedures can do anything and everything with databases. You ...