Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

LongestRunningQueries.vbs

By Aaron West,

This SQL 2005-only VBS script will show the longest-running queries on a given server, complete with graphical .sqlplan when clicked. Results go to a web page, viewed from the local machines's temp directory.

Each row of the resulting table has the session ID, the currently running statement of the batch, a link to a text file containing the full text for the SQL batch running (all statements), and a link to a page containing a .sqlplan file which loads the full query plan into SSMS when clicked. I have found it very interesting for analyzing long-running queries.

One problem: sometimes I get a "timeout" error when running this. Perhaps I need to change ADO's connection or query timeouts. I added a Connect Timeout=120, below, in case that helps.

Total article views: 329 | Views in the last 30 days: 1
 
Related Articles
FORUM

"Query timeout expired"

"Query timeout expired".

FORUM

Query Timeout

setting the query timeout at run time

FORUM

Change field data type , query timeout

Change field data type , query timeout

FORUM

Linked Server Query Timeout

Query timeout setting is set to 0 but still the scripts dies after 5 minutes...

FORUM

Timeouts

Developer Claims SQL Timeouts

 
Contribute