Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Administration - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 6525

historical queries

$
0
0
Hi guysis it possible to retrieve queries which ran a week ago in a sql server database.So far i'm only able to retrieve up to one day using the below query : SELECT deqs.last_execution_time AS [Time], dest.TEXT AS [Query] , total_elapsed_time as total_query_timeFROMsys.dm_exec_query_stats AS deqsCROSSAPPLY sys.dm_exec_sql_text(deqs.sql_handle) AS destORDER BY deqs.last_execution_time DESC.but I need to go back in history to earlier than that

Viewing all articles
Browse latest Browse all 6525

Trending Articles