I have some doubt regarding user defined functions. I would like to know why / when to use functions.
What are the advantages of functions over stored procedure?
Researching via google I have seen articles suggesting:
- stored procedure are more advantageous than functions.
- function have limited error handling
- functions cannot use temporary tables
- functions cannot call stored procedures.
The only advantage of function is we can use function as inline queries.
I can get the same result with stored procedure by using temporary tables, but i need to know which scenario to use functions compared to stored procedure. I need to know why we need UDf , when most of the functionalities provided by UDF can be done by Stored procedure. Can any one guide me over this.