Discussion Locked

Activity tracking on SQL Server

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

My problem is that job history for some of jobs created is being deleted by self or by someone.

Is there any way we can capture all the activities automatically on SQL Server ?
e.g users who logged in and out, activities done by them,time they worked for ,databases they worked on,statements they executed etc

1 reply

by tony hopkinson

Not sure you need all that.
Create a table for storing the logging data.
eg JobNumber, DateActioned ,UserName
Add an on delete trigger to the jobs table and in it
do an insert into your logging table with the required data. Should give you an idea of what your dbms thinks it's being told to do.

This discussion is closed to new replies.