Difference between Stored Procedure and Function


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 cant 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 cant call Stored Procedure from function.

5. We cant 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 cant use Try-Catch block in User Defined Function.




Tags:

Difference between Function vs Stored Procedure

Stored Procedure vs Function

Differences between Function vs Stored Procedure

Spreading Knowledge Across the World

USA - United States of America  Canada  United Kingdom  Australia  New Zealand  South America  Brazil  Portugal  Netherland  South Africa  Ethiopia  Zambia  Singapore  Malaysia  India  China  UAE - Saudi Arabia  Qatar  Oman  Kuwait  Bahrain  Dubai  Israil  England  Scotland  Norway  Ireland  Denmark  France  Spain  Poland  and  many more....