Permit UDF with time-dependent functions to be inlined
The advent of inlining of scalar UDFs in SQL 2019 is a major leap forward! UDF will remain a trap for many developers since far from all UDFs cannot be inlined. For the most part, there is not much to about it. How would you inline a WHILE loop? And overall, the changes in SQL 2019 go far beyond what I could ever dream of.
However, there is one inline preventer that I am not happy with and that is functions that calls gedate() & co. I understand why they do not inline by default, as that could be a breaking change - a system may rely on that sysdatetime() can return different values for different rows. However, it should be possible to force inlining with INLINE = ON as in this example:
CREATE FUNCTION sysdate() RETURNS date WITH INLINE = ON AS
RETURN convert(date, sysdatetime())
In my experience, it is not at all uncommon to use getdate()/sysdatetime() in scalar UDFs, and naïve users are likely to expect the function to inline, particularly when it is a simple like the one above.