Script to find which active transaction is using more space in tempdb

  • Hello,

    Can someone help me with script of finding transactions which are heavily using temdb space in their queries.

    Thanks in advance

  • Have you looked at sp_whoisactive?

    John

  • This is something like I need to send an email alert every hour so DBA team can look into the usage of Tempdb on hourly basis. The sp gives info only for that session and I can't use for my alert i guess.

  • It gives info for all active sessions. If you have the patience, you can look at the stored procedure definition and try to find the part that retrieves tempdb usage, and see if you can use that as a basis for something to fit your requirement.

    John

  • Due to my access restrictions, I can't use that and I don't need that much detailed level of informtion. Is there any other script that I can use to send email alerts on which query is consuming tempdb much..

  • If you have such restricted access it sounds as though you're not the DBA, so you can probably hand that task over to whoever is.

  • also take a look at this link: http://www.sqlservercentral.com/scripts/tempdb/72007/[/url]

  • Beatrix Kiddo (12/22/2016)


    If you have such restricted access it sounds as though you're not the DBA, so you can probably hand that task over to whoever is.

    Heh... +1 million to that. I was going to suggest that the DBAs learn how to be DBAs.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 9 posts - 1 through 8 (of 8 total)

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