How to export the execution plan from Query store by tsql ? I want to export directly to a file .sqlplan, instead of saving it manually . thanks
You can use BCP. See examples at https://www.sommarskog.se/bulkload.html#blobexport. (Those examples are not for Query Store per se, but it gives you the idea.)
8 Ways to Export SQL Results To a Text File: https://www.sqlservercentral.com/articles/8-ways-to-export-sql-results-to-a-text-file
Hope this link could give you little help or idea.
If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
15 people are following this question.