Disabling and cleaning Query Store
You might need to remove collected data from Query Store sometimes, for instance, when you use it for demo purposes or when you fixed queries that were a long time in regression and will be shown in Query Store reports in the next period too, because of their significant regression. You can remove captured information by clicking on the Purge Query Data
button in the Query Store properties page inside SSMS.
In addition to this, you can use the following Transact-SQL command:
ALTER DATABASE WideWorldImporters SET QUERY_STORE CLEAR;
To disable Query Store, you would need to set the operation mode property to OFF
either through SQL Server Management Studio (The Query Store
page within database properties) or the Transact-SQL command:
ALTER DATABASE WideWorldImporters SET QUERY_STORE = OFF;