Here are some notes I found useful in terms of functions and stored procedures in SQL:
- Functions are used for computational purposes and they cannot be used to perform operations such as UPDATE or INSERTS.
- Functions cannot call a stored procedure or run a dynamic SQL statement.
- Stored procedures are used to modify the data (i.e. UPDATE or INSERT statements) in database and communicate with outside. In other words outside programs cannot call a function directly but they can call a stored procedure.
- Stored procedures can call functions, other stored procedures, and run dynamic SQL statements.