I am creating a database to store user information, and the changed made to the user will need to get logged.
This will eventually lead to a sort of ‘timeline’, so a Date / Time factor is crucial.
For this question, I will use the following example:
#ID - int
memName - string
memBio - string
memStatusString - string
Now, my though is to link that to a table as such:
ID - int
#memID - int
dateNameChanged - DateTime
dateBioChanged - DateTime
dateStatusStringChanged - DateTime
Is this a good way to log information? I want to do it on a different table to be easily able to list later.
Also, I never put the logging in the same table because the log date will only come after a change. IF the user never changes, it will just be a waste of space.
In conclusion;
Is there a better way to do this?
Update: I apologize for the lack of info.
I am using SQL Server 2008, asp net c# 3.5 – 4 (Only doing the database structure atm).
Also, a member will have different tables, such as tblMemberInformation, tblClanInformation, tblMemberGameRank
Each of the CHANGED data (Just to confirm) in each of the tables will need to be stored to a log file, with the corresponding date.
You have not specified the version of SQL Server you are using, so I will assume a recent version.
SQL Server 2008+ has built in audit: