Tuesday, January 28, 2014

Stored Procedure Vs Function




Stored Procedure (SP)
Function (UDF – User Defined Function)
SP can return zero , single or multiple values.
Function can return one value which is mandatory.
We can use transaction in SP.
We can’t use transaction in UDF.
SP can have input/output parameter.
Only input parameter.
We can called function from SP.
We can’t call SP from function.
We can’t use SP in SELECT/ WHERE/ HAVING statement.
We can use UDF in SELECT/ WHERE/ HAVING statement.
We can use exception handling using Try-Catch block in SP.
We can’t use Try-Catch block in UDF

 

No comments:

Post a Comment