The requirements of the project were as follows:
- Managed by stored procedures;
- Database level auditing (for speed);
- Always accessible via SQL (that is, I wanted a store somewhere where I would review the audited information without having to involve a DBA);
- I wanted the ability to archive the data after a set time.
Some disclaimers before I continue I think are in order. I am not a SQL DBA, just a developer wanting to improve his database skills. The code I have written has not been thoroughly tested, nor would I recommend using it for a production environment without some form of testing in your Staging or User Acceptance Testing environments for speed and to make sure it doesn't break existing systems. I have written this in Microsoft SQL Server 2008 (Express Edition), so there may be more features in other versions (such as Standard or Enterprise) that would break the code in this project, but again I have not tested this against other editions so am unaware of any issues with them. Whilst you are free to use this for yourself, you do so at your own risk.
Now that that is out of the way, let me detail the parts of the "series" that I am going to write:
- The Aims (This post)
- Overall Description of the Flow of Data
- Creating the Tables
- Altering the Tables - Audit Defined Fields
- Altering the Tables - Source Defined Fields
- Creating The Trigger
- Audit Table Maintenance Script
- Data Archiving Script
- Wrapping It Up
OK, now without further ado let me begin!
No comments:
Post a Comment