Interviews2 answers
What are the Advantages of User Defined Functions?
2 Answers
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.
Munesh SharmaPosted May 30, 2016, 9:16 PM EDT
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.
Ajeet MishraPosted Sep 7, 2015, 11:04 PM EDT

