var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: user tracking..
I have a table in my database and it holds some important information,I want to track the users
who are executing DML commands(select,update,delete) on the data in that table.
Is there any way do that?If so how could i implement that.can any one help me in this regard?
Thanks in advance...
Re: user tracking..
Create a trigger to track those activities of that table.
Look up the use of Niladic functions in Books Online. They can be placed in a trigger to update a column in your table indicating who last modified the record.
...also, you can use them at the start of all your stored procedure to save execution information in a log table, such as who called the procedure, when it was called, and what parameters were passed.
You are making sure all your users can only access the database through stored procedures, right?
can u please give me an example that how can I write a trigger to implement this.
Do you have Books Online?
Look up CREATE TRIGGER
Also what is your security model?
How do the users connect?
I'd say your best bet is to start a trace in profiler...
It'll be less work than having to create triggers (however I have triggers that track all changes to all data and save it to historical tables)
What are you trying to do and for how long?
Do you want to audit the data? Do you want to back in time and say how many time did sally blow away the table?
The triggers are good for monitoring data modication, but to monitor and log select statements you will need to use either SQL Profiler or log statements at the start of your procedures.