Hi @Sharon01 ,
When you need to review the data about executed SQL statements in SSMS for a particular period, you can use several options:
- Queries are saved in the cache via system representations (sys.dm_exec_query_stats, sys.dm_exec_sql_text, and sys.dm_exec_query_plan)
- Using SQL Server Profiler
- Using Extended Events
- Using the Query Store, starting from the 2016 version
- Using SQL Complete (SQL Complete\Execution History) in SSMS
For more details , please see : https://blog.devart.com/sql-server-query-history.html
Best regards,
Niko
----------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.