title | description | author | ms.author | ms.reviewer | ms.date | ms.service | ms.subservice | ms.topic | f1_keywords | helpviewer_keywords | dev_langs | monikerRange | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sp_query_store_clear_message_queues (Transact-SQL) |
Clears all queued (non-persisted) Query Store messages pending for the replica against which the command is executed. |
markingmyname |
maghan |
randolphwest |
08/22/2024 |
sql |
system-objects |
reference |
|
|
|
>=sql-server-ver16 || >=sql-server-linux-ver16 |
[!INCLUDE sqlserver2022]
Clears all queued (non-persisted) Query Store messages pending for the replica against which the command is executed. sp_query_store_clear_message_queues
is used when Query Store for secondary replicas has been enabled.
:::image type="icon" source="../../includes/media/topic-link-icon.svg" border="false"::: Transact-SQL syntax conventions
sp_query_store_clear_message_queues
[ ; ]
0
(success) or 1
(failure).
Requires the ALTER permission on the database.
The following example clears all queued (non-persisted) Query Store messages pending. The action applies to the replica against which the command is executed.
EXEC sp_query_store_clear_message_queues;