Saturday, February 25, 2012

Registering User changing data

Hello there
I have many tables that i would like to kbow on each record who inserted,
updated data and when it happend?
For this i've learned about function call SUSER_SNAME() that always gives me
the current user who is in the system. For insert case i've solved it
simply: added two fields:
ChangeBy with the SUSER_SNAME() function as default value
ChangeAt with the GETDATE() function as default value
This works fine for Inserting.
But what i need to do for updating: do i have to use a trigger for this?> But what i need to do for updating: do i have to use a trigger for this?
Yes, you can use a trigger. You can also use SQL Profiler for auditing -
check
http://www.sqlservercentral.com/col...ityLearning.com

No comments:

Post a Comment