Ideas on database design for capturing audit trails -


How can I create a log of data in my DB?

I keep maintaining a log every change made in each line means that I do not allow DELETE and UPDATE to execute can.

How can I keep such logs?

"Use only insert database"

The basic idea is that You never update or delete the data.

2 datetime columns to and to in each table.

When you add a new line, the values ​​in each of them start with the beginning of the empty (beginning

) at the same time that you to

You can read data outside the table through a view that contains the = null in it

This method gives you a picture of your database status at any time.

Edit

Just to clarify in response to the comment: Sequence will be given by the primary key on the table, which will be one user number.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -