User-Defined Functions
A stored procedure takes a set of data, completes the work as required, and then finishes. It is not possible to take a stored procedure and execute it within, for example, a SELECT
statement. This is where user-defined functions (UDFs) come about.

Functions