Can user defined functions in SQL Server hurt Performance?

It is not recommended to frequently use user defined functions in SQL Queries?
Can user defined functions in SQL Server hurt Performance?

Tags..  SQL Server  SQL Server Performance  user defined functions  SQL Server optimization
Views: 43 | Community Opinion/Answer: 1

Add Your Opinion

Bookmark this page..



Ask a New Question Go to Home


Community Opinion/Answers
Rimin K said..

While user defined functions can offer great convenience, they can also sometimes hurt performance. This problem with them is that they use row-by-row processing, similar to how a cursor works, instead of working as a set-based operation. So if the result set of your query, which is using a user defined function, is very small, then the performance hit will be small. But if the result set is large, then performance could very well become a problem.

Means, if you are using a user defined function, you will want to avoid using them with large result sets. Instead, use a well-written stored procedure instead.


What do you think? Add your opinion/answer
Your Name:
*your opinion/answer: