Stored Procedure V/S Function

There are following difference between stored procedure and user defined function:-

  1. We can use all DML command like insert, update and delete and select command in stored procedure but user defined function can use only select statement.
  2. Function must have to return a value but in case stored procedure it is not mandatory.
  3. We can call function from stored procedure but we can’t call stored procedure from function.
  4. We can use function in select statement and can use its output with select query but we can’t call stored procedure from select query. We need to use exec command to execute stored procedure.
  5. We can’t use transactions and exception handling in function but stored procedure support both transactions and exception handling.
  6. Function support only input parameter not ouput parameter but in stored procedure we can use both.
  7. User defined function can return only single value but stored procedure can return multiple value result set.

Email Address

For any query you can send mail at