Link to home
Start Free TrialLog in
Avatar of IZIKILL2
IZIKILL2

asked on

VIEW CHANGES IN A TABLE

I produce a table for reservations in different courses.

There are fields in the table that I pull from servers that can change from day to day.

Is there a way to view what fields have changed when I run the query.

I.E.

One day a person can be enrolled DL and the next it could change to a resident course.
Would there be a way to turn this specific fields font to red to show that there was a change from the previous table?
Avatar of Kevin Hill
Kevin Hill
Flag of United States of America image

You would need to have fields in the tables such as dateinserted, datemodified, insertedby and modified by, along with the appropriate application logic to update those fields
Avatar of IZIKILL2
IZIKILL2

ASKER

Im really looking for a way to compare the old and new table and be able to track the changes or new entries without adding a date mod function.
ASKER CERTIFIED SOLUTION
Avatar of Kevin Hill
Kevin Hill
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>One day a person can be enrolled DL and the next it could change to a resident course.
>Would there be a way to turn this specific fields font to red to show that there was a change from the previous table?

this would depend on the frontend you are using, is it a website?
that is just about the colouring.

if you want to detect the changes, you need to be able to get to the old values of the data.
so if you want to compare the data tomorrow, you need to backup today's data.
so copy today's table to a table "yesterday" and tomorrow, you can compare it with the newly entered data.

this works for just one day tho.
I have access to the old tables.  How would I go about comparing them though. The table has 40,000 records.  So maybe a field that says there was a change from the old field would be useful.

Really there are only about 5 or so fields I would apply this to.

A Person was not scheduled yesterday, today he is.  I would like to be able to see that.
The two tables have to co-exist in order to compare them.  There has to be a way to identify them.  About the only way you are going to be able to see what changed is to have an archive table of yesterday's data to compare against today's data.  re-populate every night if you only need one day of changes...

Alternatively, write triggers to insert the entire row into an archive table on Delete and Update
I can archive it every night if need be and have both the old and new table.
If that is all you need, to be able to compare one table to the previous days, then that may be your best bet.  And 40K records won't even take up that much space...
Avatar of Anthony Perkins
If you do not need to know what data changed, but simply rather which column(s) changed, consider adding an addtional column in the table that would tell you which column(s) were modified.
if you post some of the db structure,
we might be able to help you better