Wednesday, 13 March 2013

difference between stored procedures and functions ?

-> Procedure can return zero or n values whereas function can return one datatype value.
-> Returning a value is optional in Stored Procedure where as it is mandatory a function.
-> Functions can be called from  procedure whereas procedures cannot be called from function.
-> Procedures can have both input/output parameters for it whereas functions can have only input parameters.
-> Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
-> We can go for transaction management in procedure whereas we can't go in function.
-> Procedure allows select as well as DML(insert,delete,update) statement in it whereas function allows only select statement in it.

No comments:

Post a Comment