Quantcast
Viewing all articles
Browse latest Browse all 154

how to get History of queries executed with username in SQL

I can get executed queries by using:

SELECT deqs.last_execution_time AS [Time]    ,dest.TEXT AS [Query]FROM sys.dm_exec_query_stats AS deqsCROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS destORDER BY deqs.last_execution_time DESC

but I am also looking for username column, who executed these queries.


Viewing all articles
Browse latest Browse all 154

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>