![]() However if you need to see queries that were executed historically (except SELECT) this is the only way. Reading transaction log – this is not an easy thing to do because its in proprietary format. There is no way to see queries executed in SSMS by default. Late one but hopefully useful since it adds more details… LIKE N'%something unique about your query%' Or you can set up some lightweight tracing filtered on your login or host name (but please use a server-side trace, not Profiler, for this).Īs commented, it might be helpful to join on sys.dm_exec_query_stats and order by last_execution_time: SELECT t., s.last_execution_time Otherwise you'll need to use something else going forward to help you save your query history, like SSMS Tools Pack as mentioned in Ed Harper's answer - though it isn't free in SQL Server 2012+. If you lost the file because Management Studio crashed, you might be able to find recovery files here: C:\Users\\Documents\SQL Server Management Studio\Backup Files\ SELECT t.ĬROSS APPLY sys.dm_exec_sql_text(p.plan_handle) AS t If SQL Server hasn't been restarted (and the plan hasn't been evicted, etc.), you may be able to find the query in the plan cache. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |