There’s a lot of excitement (alright, maybe I’m sort of in a bubble with these things) about SQL Server 2019 being able to inline most scalar UDFs.
But there’s a sort of weird catch with them. It’s documented, but still.
If you use GETDATE in the function, it can’t be inlined.
GETDATE() and its bretheren are non-deterministic so I figured that would be an issue. Check out the documentation for the other limitations.