TODO
Stored Procedure
Section titled “Stored Procedure”Purpose
Section titled “Purpose”A Stored Procedure encapsulates SQL code in an object, stored in the database, that can be called to perform the same functions many times.
Motivation
Section titled “Motivation”In many cases, it is preferable to have an executable object available that can be called directly to perform a specific function in the data solution. Instead of running a lot of code to achieve a certain outcome, it can be easier to call a Stored Procedure that contains the code.
The various templates that have a Stored Procedure as output type create Stored Procedure database objects, which can be called from the control framework.
Benefits of a Stored Procedure, beyond encapsulating SQL logic in a runnable component, are that this allows various procedural SQL statements to be used within the code. This can be applied for a wide range of use-cases, including performance optimisation, using temporary tables etc. in a way that some other data objects such as Table-Valued Functions do not.