Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Many stored procedures are application independent but there may be a few that are application dependent. For example, the CRUD (Create, Select, Update, Delete) stored procedures can go across applications. In particular you can throw in auditing logic (sometimes done in triggers but there is a limit to how complicated you can get in triggers). If you have some type of standard architecture in your software shop the middle tier may require a stored procedure to create/select/update/delete from the database regardless of the application in which case the procedure is shared.</p> <p>At the same time there may be some useful ways of viewing the data, ie GetProductsSoldBySalesPerson, etc.. which will also be application independent. You may have a bunch of lookup tables for some fields like department, address, etc. so there may be a procedure to return a view of the table with all the text fields. Ie instead of SalesPersonID, SaleDate, CustomerID, DepartmentID, CustomerAddressID the procedure returns a view SalesPersonName, SaleDate, CustomerName, DepartmentName, CustomerAddress. This could also be used across applications. A customer relationship system would want Customer Name/Address/Other Attributes as would a billing system. So something that did all the joins and got all the customer information in one query would probably be used across applications. Admittedly creating ways to view the data is the domain of a view, but often people used stored procedures to do this.</p> <p>So basically, when deleting from your table do you need to delete from 3 or 4 other tables to ensure data integrity. is the logic too complicated for a trigger? Then a stored procedure that all applications use to do deletions may be important. The same goes for things that need to be done on creation. If there are common joins that are always done, it may make sense to have one stored procedure to do all the joins. Then if later you change the tables around you could keep the procedure the same and just change the logic there.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload