Azure SQL Database has the Query Store enabled by default. However, on SQL Server, it must be enabled manually. This can be done in two different ways:
- Using T-SQL, as seen in the following example for the AdventureWorks2016 sample database:
USE [master]GOALTER DATABASE [AdventureWorks2016]SET QUERY_STORE = ONGOALTER DATABASE [AdventureWorks2016]SET QUERY_STORE (OPERATION_MODE = READ_WRITE)GO
- Using SSMS, when we right-click on a database name in Object Explorer, select Properties, select the Query Store page, and change Operation Mode from Off to Read Write, as shown in the following screenshot:
In the previous ...