Need to gather the source process for a SQL server query

  • Wouldn't a trace to check which query is doing what on which table help?

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉

  • Are you looking for Auditing solution?

    Depends on the depth of details you want to trace, there are few methods and most common are:

    - custom auditing using light-weight audit triggers (still my preference...)

    - SQL CDC

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • The best way to track T-SQL commands that have been issued in the past is through an extended event session. They're easy to set up and there's a function to load them into tables for querying against the data captured. This is the 2008 introductory documentation. If you're only interested in the data changes themselves, I'd suggest looking into Change Data Capture. This is the 2008 version of that document.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 4 (of 4 total)

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