Skip to Main Content
Learn T-SQL Querying
book

Learn T-SQL Querying

by Pedro Lopes, Pam Lahoud
May 2019
Intermediate to advanced content levelIntermediate to advanced
484 pages
11h 23m
English
Packt Publishing
Content preview from Learn T-SQL Querying

Configuring the Query Store

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn T-SQL Querying - Second Edition

Learn T-SQL Querying - Second Edition

Pedro Lopes, Pam Lahoud
SQL Server T-SQL Recipes, Fourth Edition

SQL Server T-SQL Recipes, Fourth Edition

Jason Brimhall, Jonathan Gennick, Wayne Sheffield

Publisher Resources

ISBN: 9781789348811Supplemental Content