views:

60

answers:

1

I have a question about auditing. Most auditing examples use one audit table to track changes. However, we need one audit table per "regular" table. In other words, tblCustomer would also have tblCustomer_History. I can't figure out how to use a listener, and on update populate the history table as well. Any ideas? I'd hate to fall back on SQL Server triggers.

+1  A: 

I asked a question a while ago that I think is similar to this one. Notice the link to my final solution in the answers as well.

http://stackoverflow.com/questions/705943/nhibernate-table-update-event

Rob
Thanks. I like it, but it's an awful lot of sql writing for each of my entities.
CocoB
No argument there! At least with the way we did it. But then again, we don't audit every entity. Only the things deemed important enough to have full history. If every single table is to be audited, I would strongly suggest a single audit table.
Rob