Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Applies to:
SQL Server 2016 (13.x) and later
Azure SQL Database
Azure SQL Managed Instance
Flushes the in-memory portion of the Query Store data to disk.
Transact-SQL syntax conventions
sp_query_store_flush_db
[ ; ]
0
(success) or 1
(failure).
If Query Store for secondary replicas is enabled, when sys.sp_query_store_flush_db
is executed on a secondary replica, that secondary replica's cache is forced to flush to the cache on the primary replica. This can accelerate the Query Store cache data being synced to the primary replica, if the secondary replica cache flush is otherwise delayed under heavy workload.
Requires the ALTER permission on the database.
The following example flushes the in-memory portion of the Query Store data to disk.
EXEC sp_query_store_flush_db;
Events
Mar 31, 11 PM - Apr 2, 11 PM
The biggest SQL, Fabric and Power BI learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register today