Show login or user in the Top 10 Queries
Include login or user id information in the Top 10 Queries. This could help identify if a user is running an ad-hoc query.
The Query executions feature in Redgate Monitor (available since 14.0.39 - documentation here) allows you to see the login, program, start/end times and various other information for sampled, as well as aborted or errored, queries.
This functionality uses extended events to sample queries over a specified time threshold of 1-5 seconds.
The Top queries functionality is driven by the dmv of aggreageted completed query information and so does not have information for specific runs, though the wait information associated with each query entry (and therefore the Top waits functionality as well) does show the login and program that experienced the wait linked to the query.
-
Mark Freeman
commented
Getting the most frequent login, hostname, and application for top 10 queries would be very helpful. I can't even tell which development group to talk to about a problem if I don't know which application or Webjob executed the code, or if it was someone running a terrible query in SSMS.
-
MacMan
commented
And in the Top 10 Waits