How to enable Query store in sql server

Query store is a new powerful feature introduced in SQL 2016 which stores the query plan, statistics and query execution for current and past

queries.

You can enable it from SSMS ( 2016 and above) by clicking on the database and then on properties tab on the left side you can find

query store. In the operation mode select ‘Read Write’ and click on ‘OK’. This will enable the Query Store.

To turn query store off on SSMS change the operation mode to ‘OFF’

 

Query Store feature in sq server
Query Store feature in sq server

Query store can be enabled by using below sql query.

ALTER DATABASE AdventureWorks2012 SET QUERY_STORE = ON;

For turning the query store off using query use the below sql query.

ALTER DATABASE AdventureWorks2012 SET QUERY_STORE = OFF;

Note : Query store cannot be enabled on master or tempdb database.

Watch this Video on how to enable Query store in sql server.

 

 6,423 total views,  3 views today

Add a Comment

Your email address will not be published. Required fields are marked *