Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8695095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:56:51+00:00 2026-06-13T00:56:51+00:00

How does one implement event tracking on the database side? Assume I have the

  • 0

How does one implement event tracking on the database side? Assume I have the following columns in a table: UserID, Column1, Column2, Column3 where UserID is the primary key and Column1 has a unique constraint.

Assume the user can change the values of Column1, Column2, and Column3 on the application side.

Further assume I need to detect changes that have been made to each column and display them to the user.

I thought of doing something like this:

Table1: EventID (PK), EventDate, UserID, Column1 
Table2: EventID (PK), EventDate, UserID, Column2 
Table3: EventID (PK), EventDate, UserID, Column3 

There is no uniqueness validation on any of the above columns except of course for the primary key. This way, whenever each column is modified, I insert the new value to the appropriate table and can track all changes that have been made to the column, but this means I need to forgo the unique constraint on Column1. I can check uniqueness on the application layer by fetching the most recent Column1 values for each UserID and comparing them to each other. (Don’t know how smart this is)

This also means I need to create a separate table for every column I need to track changes to.

Being a non-expert in database design, I want to know how I could implement a database architecture, in the most elegant way, where I can do event tracking.

P.S. If this helps any, I’m interested in using SQL Azure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:56:52+00:00Added an answer on June 13, 2026 at 12:56 am

    You should not need a whole table just to log events for each column of the application tables. Keep all the event logs in one table. Define it like:

    EventLogs
        EventID (PK)
        EventDate
        UserID         # remember to add an index
        Field_changed  # format: TableName.FieldName as a string
        # or instead of Field_changed with both in one, you can do:
        Table_changed
        Column_changed
    

    Depending on how many tables/actions/events you have and if you want to store before/after values, you could separate things out a little but it shouldn’t be required.

    As for tracking “specific columns”, add that in the app code when Updates are successful. Not sure how you plan to track Inserts and Deletes but if you want that too, add an Event_Type (enum) field in the log table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When doing databinding does one have to implement INotifyPropertyChanged on the datacontext in WPF?
Does anyone know how I can implement a single Touch Event. A simple, one
How does one implement a multithreaded single process model in linux fedora under c
Does any one know how to implement In App SMS functionality in iPhone SDK
How does one determine what is the trigger of an event (close browser, close
How does one alternate row colors in a table in django that's generated using
does one perform better over the other in terms of indexing/quering etc ? e.g.
How does one wait until all of the Javascript is loaded before curling a
How does one use rm to delete a file named '--help'? When I try,
How does one write a (Intel) F90 function that converts a string into lowercase

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.