|
Stored Procedures may return multiple values, while functions returns only one value at a time.
Stored Procedures can have input, output parameters for it whereas functions can have only input parameters. Stored Procedure allows select as well as DML statement in it whereas function allows only select statement in it. Functions can be called from Stored Procedure whereas Stored Procedures cannot be called from function.
Exception can be handled by try-catch block in a Stored Procedure whereas try-catch block cannot be used in a function. Stored Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
Stored Procedures are called independently, using the EXEC command, while functions are called from within another SQL statement.
|