top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is difference between stored procedure and user defined function?

+1 vote
414 views
What is difference between stored procedure and user defined function?
posted Nov 22, 2014 by Roshan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

• It is not possible to change the table data with the use of User defined functions but you can do it by using stored procedure.
• The execution of User defined function will be stopped if any error occurred in it. But in the case of Stored procedure when an error occurs the execution will ignore the error and jumps to the next statement.
• We can use User defined function in XML FOR clause but we can use stored procedure in XML FOR clause.
• It is not possible to make permanent changes to server environment whereas stored procedure can change some of the server environment.
• User defined functions do not return output parameters while stored procedure can return output parameters.

answer Nov 22, 2014 by Manikandan J
...