SQLServerCentral

Bad Scalar Functions (or other UDF)


https://www.sqlservercentral.com/Forums/Topic1787500.aspx

By Steve Jones - SSC Editor - Wednesday, May 18, 2016 1:45 PM

If you can share a story of a real scalar or multi-statement table UDF and how you fixed it, I'd like articles here. Even if the fix is changing application code.

The idea is to help people understand the issues with functions and performance by providing concrete examples.
By pietlinden - Wednesday, May 18, 2016 3:01 PM

Steve,

See if Kevin Boles has any horror stories that aren't confidential. =)
By Steve Jones - SSC Editor - Thursday, May 19, 2016 7:27 AM

Kevin doesn't like writing. I need someone that wants to document and describe an issue.
By Jeff Moden - Thursday, May 19, 2016 2:12 PM

Steve Jones - SSC Editor (5/19/2016)
I need someone that wants to document and describe an issue.


I've recently fixed a monster that was necessarily (used in a Persisted Computed Column) a Scalar Function and I started to write about it.

Don't let this hold anyone else up, though. This sounds like a very wide open topic that a whole lot of people could have fun with.
By Steve Jones - SSC Editor - Friday, May 20, 2016 3:18 AM

Thanks, Jeff. Hoping for a few pieces. We have the one you wrote on moving a scalar UDF to a CROSS APPLY, but I'd like to get more references for specific functions that might do strange things.
By sqltung - Friday, July 22, 2016 4:22 AM

I recently found one or two issues at work with scalar functions. I would be happy to contribute an article with examples.
By Steve Jones - SSC Editor - Monday, July 25, 2016 7:48 AM

sqltung (7/22/2016)
I recently found one or two issues at work with scalar functions. I would be happy to contribute an article with examples.


That would be great. IF you can do the setup, the bad performance, and how you fixed things, showing better performance, excellent. If this is 3 pages for each, then make it two articles.
By Jeff Moden - Monday, December 4, 2017 3:15 AM

Steve Jones - SSC Editor - Friday, May 20, 2016 10:18 AM
Thanks, Jeff. Hoping for a few pieces. We have the one you wrote on moving a scalar UDF to a CROSS APPLY, but I'd like to get more references for specific functions that might do strange things.


My sincere apologies. I'm way overdue on this and other articles (it's been several years since I put one out there). Hopefully, things will lighten up on my end and I'll be able to crank the one I was thinking of for this out soon.