The main difference between functions and stored procedures are given bellow:
Function(User Defined)
Function(User Defined)
- It returns only one value
- We can’t use transaction in function
- Only have input parameter
- We can’t called SP from function
- We can’t use exception handling using Try-Catch block in function
- We can use function in select/where/having statement
Stored Procedure (Store Procedure)
- It returns zero, single or multiple values
- We can use transaction in SP
- Can have input/output parameter
- We can called function from SP
- We can use exception handling using Try-Catch block in SP
- We can’t use SP in select/where/having statement
Comments
Post a Comment