Table Changes

  • Does anyone know how to query changes made to any tables/rows made in a SQL database?

  • Can you please provide more information on what you are trying to achieve.

  • I have a table with Personnel Records.
    Those records have information on a a table and I need to do query on that table to see what changes have been made. I have already turned on "Change Tracking" for the entire database.

    In the picture below, i need to know what (if any) changes were made to any of "ACL" columns say the last 30 days.

  • danielnunez86 - Friday, April 28, 2017 1:27 PM

    I have a table with Personnel Records.
    Those records have information on a a table and I need to do query on that table to see what changes have been made. I have already turned on "Change Tracking" for the entire database.

    In the picture below, i need to know what (if any) changes were made to any of "ACL" columns say the last 30 days.

    So you turned on a feature without knowing how to support it.  You should get out one of those two habits.
    Here's a link to teach yourself how to support such requests.
    https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/work-with-change-tracking-sql-server

    --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)

  • Jeff Moden - Monday, May 1, 2017 1:58 PM

    danielnunez86 - Friday, April 28, 2017 1:27 PM

    I have a table with Personnel Records.
    Those records have information on a a table and I need to do query on that table to see what changes have been made. I have already turned on "Change Tracking" for the entire database.

    In the picture below, i need to know what (if any) changes were made to any of "ACL" columns say the last 30 days.

    So you turned on a feature without knowing how to support it.  You should get out one of those two habits.
    Here's a link to teach yourself how to support such requests.
    https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/work-with-change-tracking-sql-server

    Or, indeed, if it was the right functionality to use - as shown in that link that Jeff has provided, Change Tracking isn't the same as Change Data Capture.  If you want to see what the data changes actually *were*, you need CDC.  If you just need to see that changes have happened (and not what they were), then you can get by with CT.  You indicate that you want to know "what changes were made" (CDC), and not "that changes were made" (CT).

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • Got it. I try to do as much research as possible before posting but needed this urgently. I have been able to postpone this project for a few weeks. Thanks for the advice, i will see what I can come up with. thanks again.

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

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