What are Difference between Stored Procedure and Function

Distinguish, differentiate, compare and explain what is the difference between Stored Procedure and Function. Comparison and Differences.

Difference between Stored Procedure and Function

1. Stored Procedure can return zero , single or multiple values. Function can return one value which is mandatory. 2. We can use transaction in Stored Procedure. We can't use transaction in User Defined Function. 3. Stored Procedure can have input/output parameter. User Defined Function have only input parameter.

Difference between Stored Procedure and User Defined Function

4. We can called function from Stored Procedure. We can't call Stored Procedure from function. 5. We can't use Stored Procedure in SELECT/ WHERE/ HAVING statement. We can use User Defined Function in SELECT/ WHERE/ HAVING statement. 6. We can use exception handling using Try-Catch block in Stored Procedure. We can't use Try-Catch block in User Defined Function.

Tags:

Comparison between Stored Procedure and Function

Difference between Function vs Stored Procedure

Stored Procedure vs Function

Function vs Stored Procedure

Differences between Function vs Stored Procedure