Tracking for table updates

  • Hopefully this is simple. I need the ability to see row changes for a table. In other words, some type of query that will show me the last x transactions that affected a table.

    Also, and this may be impossible, can a query be written where i can see all the table inserts/updates for a database? Need the table name, row id (key) and possibly the column name that was changed.

    I inhereited an old system that is not well documented and guess who has to track and fix mistakes? Yeppers, Good old Mikey can do it! :w00t:

    Seriously, any help is greatly appreciated.

    oh, MS Server 2008 R2, SQL server 2008.

    Thanks in advance.

    Mike

  • You can use either CDC (Change Data Capture) or CT (Change Tracking) as per your requirement. Please find the following links for detailed explanation about this

    http://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-(cdc)-in-sql-server-2008/

    http://msdn.microsoft.com/en-us/library/cc280462.aspx

    _____________________________________________
    One ounce of practice is more important than tonnes of dreams

  • few more things, If you do not wanna complicate things,

    make use of either of things:

    1. Trigger on the tables

    2. Use OUTPUT clause on transactions to push the table name to another table for relevant tables.

    3. as shaiju siad, u can even use CDC and CT as well.

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

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