How can I work around SQL Server - Inline Table Value Function execution plan variation based on par
- by Ovidiu Pacurar
Here is the situation:
I have a table value function with a datetime parameter ,lest's say tdf(p_date) ,
that filters about two million rows selecting those with column date smaller than p_date and computes some aggregate values on other columns.
It works great but if p_date is a custom scalar value function (returning the end of day in my case)…