1

This question already has an answer here:

I have an external application connecting to a SQL Server 2008 Express database.

Is it possible to monitor (view) the SQL statements that are generated by the external application at all? I am trying to work out the tables (and the relevant joins) used in the queries.

Thanks

marked as duplicate by Paul White Jan 10 '16 at 12:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

The best i can think of will be to use SP_whoisactive from Adam Machanic which is very quick to generate a table to collect the data you need, then run the procedure in a loop with a wait statement to regularly collect the data you want over an interval.

You can gather the data as explained here to log the activities on the system with help of SP_whoisactive.

However , you may always go with live monitoring using SQL profiler and gather the required data accordingly.

1

You can start up SQL Profiler and run a trace to see exactly what statements are being run.

Make sure to tick "Show all columns". Then go into "Column Filters" and add the Host Name you want to monitor into the HostName filter - this will then only show you queries coming from this host. If you do happen to have other apps on the same host you can also limit the trace by other filters "e.g. LoginName" until you are tracing only the relevant information.

Run the trace.

  • Is this available under Express edition? I cannot find it or work out how to get it installed. – Jason Jan 10 '16 at 8:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.