Find the program name and login name which was running the sql
by using the CLR and code similar to the one below, I have managed to retrieve the TOP QUERIES (the same as in the RedGate Monitor tool) but I am having a hard time joining this to any other view or table to retrieve the program name and login name.
Do you know where this data is saved and how to join it to [data].[Cluster_SqlServer_TopQueries_UnstableSamples]?
Any help would be much appreciated.