Trace on a table

  • I am trying to set up a trace that gives me all insert, update, and delete activity on a specific table. I am unsure of the groups and filters to utilize. Is this possible?

    How?

    thanks in advance

  • Hey,

    If you only want INS, UPD & DEL statements, I'd do this..

    In the "Events" tab, keep only TSQL->SQL:BatchCompleted

    In the "Filters" tab, set

    DatabaseID or DatabaseName

    And also in the "TextLike" filter inlude the following 3 statements...

    INSERT INTO <tablename>

    DELETE FROM <tablename>

    UPDATE <tablename>

    That should grab them all.

    Clive Strong

    clivestrong@btinternet.com

  • Sorry...typo there!

    The 3 statements should be in the "TextData" filter and in the "Like" dropdown filter!

    Clive Strong

    clivestrong@btinternet.com

  • Its not working. I have put all the data in the appropriate places and its not working. Just for fun I put a fake databasename in and it actually was still showing inserts for other tables. Also when I put in insert, update, delete the profile shows nothing. Do I need to use quotes?

    Sorry...typo there!

    The 3 statements should be in the "TextData" filter and in the "Like" dropdown filter!

    Clive Strong

    clivestrong@btinternet.com

    [/quote]

  • Not to discount the other work, but I'd capture all T-SQL and then drop into a table. Then delete the select statements.

    Steve Jones

    sjones@sqlservercentral.com

    http://www.sqlservercentral.com/columnists/sjones

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

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