Skip to content

Instantly share code, notes, and snippets.

@rodolfofadino
Created August 24, 2015 20:55
Show Gist options
  • Save rodolfofadino/2dc4f1a3fb791227f88f to your computer and use it in GitHub Desktop.
Save rodolfofadino/2dc4f1a3fb791227f88f to your computer and use it in GitHub Desktop.
QueryToFindExecutadedQuery.sql
SELECT top 2000 execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery
CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql
where execsql.text like '%textoparaprocurar%'
ORDER BY execquery.last_execution_time DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment