Azure SQL Database Managed Instance. Current Compatibility Level is set to 140 to match on-prem SQL Server 2017 test and development server. I just read this article on Scalar UDF Inlining and was curious if setting Query Optimizer Fixes to ON would enable this feature? I have read several more articles on the topic but none of them address this question.


No, 'query optimizer fixes' only affects optimizer bug fixes that may result in unexpected query plan changes. It does not enable new features.

The only way to enable scalar function inlining is to set the database compatibility level to 150:

Enabling Scalar UDF Inlining

You can make workloads automatically eligible for Scalar UDF Inlining by enabling compatibility level 150 for the database. You can set this using Transact-SQL. For example:


Apart from this, there are no other changes required to be made to UDFs or queries to take advantage of this feature.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.