Long running queries - still a puzzle..

  • I read all posts at SQL ServerCentral regarding

    long running queries on SQL 2005.

    I particularly tried queries described here:

    http://www.sqlservercentral.com/Forums/Topic619606-360-1.aspx

    None of them ever returned me any records.

  • The queries Chris Harshman posted should work on your sql 2005 server as long as compatibility level is set to 90 or greater (cross apply is an 05 feature).

    Did you try the query in all of your databases?

  • I tried it with

    "use master"

    so I assume it should pick up all long running queries

    regardless which database it was?

    I checked compatibility level is 9.0

  • One thing I'm confused about.

    All these DMV's.

    Will they show me the historical data or it's just to

    look at the current state?

    I mean what if we had some long running queries yesterday

    would it be possible to find them today?

  • Try running this under different databases. Also make sure there's some activity on the database.

    The data is state data not historical, I believe since the last reboot.

  • From Chris Hedgate:

    The information returned by the DMOs is collected by the engine itself from lots of different sources and the DMOs make it easy for you to use it by simply querying them using SELECT statements. Since the information shows the current state of the server this means that when the server is restarted the information collected is lost and the engine starts collecting a fresh set.

    http://www.sqlservercentral.com/articles/Administration/dynamicmanagementobjects/2235/

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply