Jump to content

Audit Trail, database triggers?


dmccabe

Recommended Posts

i have asked this before I think, but it was a long time ago.

 

i am creating a database for work and I need to create an audit trail of who did what.

 

Is there anyway to set up triggers on a mySQL database so that when a field is update it captures certain information in to another table in the database?

Link to comment
Share on other sites

i worked it out na na na lol.

 

example from mchi link very nice!

 

drop tables a,b;

create table a(i int);

create table b(n int default 0);

insert into b values(0);

 

create trigger ainsert before insert on a for each row

update b set n=n+new.i;

 

insert into a values(1);

select * from b;

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.