New Posts New Posts RSS Feed: Auditing Inserts with Identity columns
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Auditing Inserts with Identity columns

 Post Reply Post Reply Page  <12
Author
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Topic: Auditing Inserts with Identity columns
    Posted: 18-Mar-2013 at 6:38pm
I just looked at what I do again and remember why this feature important to us. Putting CreatedOn timestamp on table is OK, but CreatedBy which FK's to user table is kind of overkill. I started designing this way but when you have hundreds of tables and all of them reference User table it becomes ugly. I'd rather keep it in separate table.

With current model I can catch updates and audit that but no luck with "creates"
Back to Top
KitKat View Drop Down
Newbie
Newbie
Avatar

Joined: 01-Nov-2012
Location: Florida
Posts: 23
Post Options Post Options   Quote KitKat Quote  Post ReplyReply Direct Link To This Post Posted: 19-Mar-2013 at 6:31am
Unless you never plan to delete users, having an actual FK relationship is bad, as no matter what table its in, you now either cannot delete users, or have incomplete history.  I simply record the username and link at run-time based on that.  That way I can delete users and still maintain 100% complete Audit Logging which is very important for the financial applications we write.

-Katerina
Back to Top
katit View Drop Down
Senior Member
Senior Member


Joined: 09-Sep-2011
Posts: 146
Post Options Post Options   Quote katit Quote  Post ReplyReply Direct Link To This Post Posted: 19-Mar-2013 at 9:29am
Agree, but I prefer to record user names and keep it "loose" in specific places - like Audit table. I really don't like an idea of keeping user name in each table. I think this is bad design.
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down