When do we use UDFs instead of Stored Procedures?

Since there are more advantages of Stored procedures over UDFs, most of us think that stored procedures are the best always. There should be some reasons why UDFs were introduced in DBMS.

Below are the scenarios in which we should use UDFs only.

  • Can Join the UDF output with another table. But we can’t write SELECT statements with Stored Procedures.
  • Can call UDF in WHERE/HAVING clauses.

Happy Reading  :-) 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.