What are the Advantages of User Defined Functions?
Ajeet Mishra
a. Can be used in a number of places without restrictions as compared to stored procedures. b. Code can be made less complex and easier to write. c. Parameters can be passed to the function. d. They can be used to create joins and also be sued in a select, where or case statement. e. Simpler to invoke.
UDF can be used in a Select, Where, or Case statement. UDF can be used in join T-SQL Statements It can act like a table, so the ability to break out complex logic into shorter and shorter code blocks Additional benefit of making the code less complex and easier to write and maintain. We can pass parameters to customize and gets the return based on our requirement Simpler to invoke in sql statements than a stored procedure.