Stored procedure vs User Functions
Difference
between Stored procedure vs User Functions:
ñ Procedure
may return none or more values.Function must always return one value either a
scalar value or a table.
ñ Procedure
have input,output parameters.Functions have only input parameters.
ñ Stored
procedures are called independently by EXEC command whereas Functions are
called from within SQL statement.
ñ Functions
can be called from procedure.Procedures cannot be called from function.
ñ Exception
can be handled in Procedure by try-catch block but try-catch block cannot be
used in a function.(error-handling)
ñ Transaction
management possible in procedure but not in function.
No comments: