need to find out what SQL is running

  • I need to find out what SQL is running under a user's ID. Is ther eany dynamic view for this. I need to actually get to the user ID not just the spid and capture the actual SQL statement that is being run.

    Any help would be greatly appreciated.

    SD KHAN

  • I use traces for that kind of thing.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Yep. SQL Server Profiler.

    Converting oxygen into carbon dioxide, since 1955.
  • Yep SQL Profiler will be your best bet. Under the trace template you can filter by the login name and see what that specific user is executing.

  • You can also use activity monitor if you know when exactly user is running SQL, Profiler is your best bet.

    EnjoY!
  • profiler

    trace

    sp_who2 (if they are running it currently)

    those are a few options.

    Also check out the article from yesterday (I have used this in the past to do the same sort of thing.

    http://www.sqlservercentral.com/articles/Log+growth/69476/

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

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

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