How can Trigger be used to keep track of a field?

Posted on 2009-02-20
Last Modified: 2012-08-13
If I have a page, with a textbox, a checkbox and a submit. Based on the checkbox, I update a field in the database and trigger does whatever. But also, if there's text in that textbox,I want to keep track of what the user entered. How do I do that? insert that textbox value into another table and keep track of it?
Question by:Camillia
    LVL 14

    Accepted Solution

    Do you want a full history or just the last value?

    if you want a full history then you will need a separate table. If you just need the last value i would append the the table a value to keep track of that field.

    LVL 7

    Author Comment

    >>If you just need the last value i would append the the table a value to keep track of that field.

    append it where? you mean just create a new column for the table??
    LVL 14

    Expert Comment


    Id  CurrentValue  PrevousValue
    1             10              5
    2              8               NULL
    3             13              12


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
    So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    This video discusses moving either the default database or any database to a new volume.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now