Why SQL functions are faster than UDF

Posted by Zerotoinfinite on Stack Overflow See other posts from Stack Overflow or by Zerotoinfinite
Published on 2013-11-09T22:53:49Z Indexed on 2013/11/10 15:54 UTC
Read the original article Hit count: 163

Though it's a quite subjective question but I feel it necessary to share on this forum.

I have personally experienced that when I create a UDF (even if that is not complex) and use it into my SQL it drastically decrease the performance. But when I use SQL inbuild function they happen to work pretty faster. Conversion , logical & string functions are clear example of that.

So, my question is "Why SQL in build functions are faster than UDF"? and it would be an advantage if someone can guide me how can I judge/manipulate function cost either mathematically or logically.

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql