This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

How do I link an SQL Text to a login or host in SSMS

Good day,

Per the topic, I am trying to link the SQL text that has been run on the monitored server, with the login/host that ran it, from within SSMS.

Is there a way to do it? If so, how?

For those wondering, the reason I need this in SSMS, is because this is to be part of a statistical analysis which I am pulling using SSMS directly, rather than the application.

I want to see how many times per hour (of the day), on average over a week, was an SQL statement ran.

Then, we have SQL statements where the only thing reported is, that the SQL text was not reported by the database (there is an open question about this issue), for these I need the logins/hostnames that executed them, so I can at least see where they come from.

Monitored Server: Sybase ASE 15.7

SolarWinds DPA: 11.0.378

MSSQL Server: SQL Server 2014 (12.0.2000.8)

Message was edited by: Shay Terreni Accidentally clicked on "assume answered"....... This is not answered.

  • Are you meaning to capture this real-time while something is in flight? Like running SP_WHO2?

    Have you looked at the view historical charts view? Does that help?

    You can also query our summary tables for execution count (con_stats_sum_<ID>) where id is from select id, name from cond -- where name is the monitored instance in question.

    Not sure how to link login or host or how this might look in SSMS though...

  • Hi,

    I'm not sure what you mean with the historical charts, but likely no.

    I want to check how many times per hour each statement was ran, and by what user, and have hourly averages of this, from a week.

    To do this, I need to know by whom or from what machine was each SQL statement executed.

  • I don't believe this is possible due to our polling methods and how we store the data/statistics.

    What we do is build wait time data by user, machine, SQL statement, etc. (what we call dimensions).

    Then we periodically collect statistics for each SQL Statement observed, but we don't divide that up by user or machine. It's just an overall execution count at that point for a given statement.

    You'd be talking about us refactoring our collections with different filters... You could submit this as a feature request.

  • Hi,

    Thanks for the input!

    I think I will do just that!