Press "Enter" to skip to content

Clear The Query Store

Grant Fritchey shows how to clear the Query Store in SQL Server 2016:

While setting up example code for my presentation at SQL Cruise (which is going to be a fantastic event), I realized I wanted to purge all the data from my Query Store, just for testing. I did a series of searches to try to track down the information and it just wasn’t there. So, I did what anyone who can phrase a question in less than 140 characters should do, I posted a question to Twitter using the #sqlhelp hash tag.

You can also call EXEC sp_query_store_remove_query to remove a specific query from the Query Store.

2 Comments

  1. Grant Fritchey
    Grant Fritchey 2016-01-19

    Thanks for the link.

    Additionally, you can remove a plan from the query store using sys.sp_query_store_remove_plan

    • Kevin Feasel
      Kevin Feasel 2016-01-19

      Very nice. I’m excited about Query Store, so it’s nice to have those options available out of the box.

Comments are closed.