sql server - Why should I use stored procedures to perform INSERT, UPDATE and DELETE operations? -
sql server - Why should I use stored procedures to perform INSERT, UPDATE and DELETE operations? -
an reply question states "ideally, though, not allow advertisement hoc dml against tables, , command dml through stored procedures."
why ideal? problem solve versus granting select, update, insert, delete tables user needs manipulate?
views , stored procedures api. allow hide implementation, version changes, provide security , prevent unfortunate client operations "get fields invoices since company started".
views , stored procedures allow dba modify schema meet performance requirements without breaking applications. info may need partitioned horizontally or vertically, split across files, fields may have added or removed etc. without stored procedures, these changes require extensive application changes.
by controlling stored procedures , views each application uses can provide versioning of schema changes - each application see database api expects.
permissions can assigned on specific stored procedures, allowing restrict users can without giving them total access table. eg, allow regular employees alter contact details on employee table allow hr create more drastic changes.
additionally, can encapsulate complex data-intensive operations in single testable procedure, instead of managing raw sql statement strings within client's source code.
stored procedure execution can tracked lot easier sql server profiler or dynamic management views. allows dba find hotspots , culprits possible performance degradation.
sql-server stored-procedures dml
Comments
Post a Comment