- You have a query that contains a predicate that involves a parameterized scalar user-defined function.
- There are multiple combinations of input parameter values that may produce the same result by this user-defined function.
- SQL Server uses the New Cardinality Estimator in which the database compatibility mode is set to 120.
In this scenario, when you run the query, you experience poor query performance because of an incorrectly estimated number of rows for the predicate that involves the user-defined function in the query plan.
After you install this cumulative update package, you have to enable trace flag 4199. To do this, you can add the -T4199 startup parameter. Or, you can use the dbcc traceon(4199) statement for a specific session.
Article ID: 3151176 - Last Review: May 31, 2016 - Revision: 1