Difference between Function and Store Procedure in SQL

Function


1- Function must return a value. 

2- Functions can only have input parameters.

3- Functions can be called from Procedure.

4- Exception can not be handled by try-catch block in a Function.

5- Function can be called from SQL statements.


Store Procedure


1- Stored Procedure can return zero or n values.

2- Procedures can have input/output parameters.

3- Procedures can not be called from Function.

4- Exception can be handled by try-catch block in a Procedure.

5- Procedure can not be called from the sql statements.

Posted on by