The point of differences between procedure and function are as follows:
1. A function has a return type, while procedure does not have any return type.However ,If needed, the data can be made available to the client through one or more OUT parameters.
2 A function can be used with SQL DML queries,but not the procedures..
3.A function is not suitable to use DML queries,but can be used in procedures. The use of DML queries in function is not completely restricted.
4.Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
5. We can go for transaction management in procedure whereas we can't go in function.
6.Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
7.UDF can be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section where as Stored procedures cannot be.
8.UDFs that return tables can be treated as another rowset. This can be used in JOINs with other tables.
9. Inline UDF's can be though of as views that take parameters and can be used in JOINs and other Rowsetoperations.
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
Very good article I have seen Differences between procedures and functions. Help me expand my knowledge.
hppy wheels
The point of differences between procedure and function are as follows:
1. A function has a return type, while procedure does not have any return type.However ,If needed, the data can be made available to the client through one or more OUT parameters.
2 A function can be used with SQL DML queries,but not the procedures..