The simplest stored procedure is for SELECT, INSERT, UPDATE and DELETE. Indeed, you can do more than that. Benefits of using the stored procedure:
- Create audit log when doing any of the CRUD operation.
- Able to implement sophisticated control in what kind of data can be return to caller.
- Easier to enhance/process the records before returning the records.
- Stored procedure has been compiled and it runs faster than the ad-hoc query.
- Able to enhance the stored procedure at anytime.
- You don't have to recompile the application if there are any changes in the rule.
- You don't have to redistribute the application (at client workstation or web server) if there are any changes in the rule.
No comments:
Post a Comment