AUTOMATIC_TUNING

Alagarsamy Sundararajan 0 Reputation points
2026-08-10T11:28:43.99+00:00

i got this error when run the alter statement in sql server standard edition 2017 and above version on-premises environment, Note that querystore already enabled without any issues
ALTER DATABASE current SET AUTOMATIC_TUNING (FORCE_LAST_GOOD_PLAN = ON)

Automatic Tuning is available only in the Enterprise and Developer editions of SQL Server.

SQL Server Database Engine
0 comments No comments

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 136.2K Reputation points MVP Volunteer Moderator
    2026-08-10T12:16:40.3933333+00:00

    You are running Standard Edition. The error message makes it clear that the feature is not available in this edition of SQL Server. This also agree with the information on this page: https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2022?view=sql-server-ver17

    User's image

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. AI answer

    2026-08-10T11:28:58.3733333+00:00

    That error is expected on SQL Server 2017 Standard edition on-premises.

    FORCE_LAST_GOOD_PLAN under AUTOMATIC_TUNING is supported only in Enterprise edition for SQL Server 2017 on-premises. In Standard edition, the option can show as not supported, and sys.database_automatic_tuning_options.reason_desc can return NOT_SUPPORTED, described as available only in SQL Server Enterprise edition.

    What can be done instead:

    1. Keep Query Store enabled in Read-Write mode.
      • AUTOMATIC_TUNING ... FORCE_LAST_GOOD_PLAN = ON requires Query Store to be enabled and in Read-Write mode, but that alone does not override edition limits.
    2. Check the automatic tuning state and reason:
         SELECT *
         FROM sys.database_automatic_tuning_options;
      
      If reason_desc = NOT_SUPPORTED, the edition does not support the feature.
    3. Use manual plan correction with Query Store.
      • Identify regressed queries.
      • Force the last known good plan with sp_query_store_force_plan.
      • Monitor performance.
      • Unforce later with sp_query_store_unforce_plan so the optimizer can resume choosing plans.
    4. For SQL Server 2017 specifically, sys.dm_db_tuning_recommendations can show potential plan regressions and recommended actions, even when recommendations are not automatically applied.

    Key points:

    • Query Store being enabled is necessary, but not sufficient.
    • On SQL Server 2017 Standard edition, automatic tuning is not available.
    • On-premises automatic tuning support is edition-limited compared to Azure SQL.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.