SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Know user actions on database


Know user actions on database

Author
Message
shohelr2003
shohelr2003
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 610
Dear,
There are three users in our database. They can connect db using SSMS. Sometimes users modify data from SSMS via "Edit Mode". Then it becomes tough for me to identify who have done the modifications. Thats why I created server side trace. From the trace file I can't find any information that what data is changed from SSMS via "Edit Mode".

Please help me to know the solution.

Thanks
Akbar
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87227 Visits: 45272
The trace will show the modifications, but it's high overhead. Maybe a trigger?

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


free_mascot
free_mascot
Hall of Fame
Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)Hall of Fame (4K reputation)

Group: General Forum Members
Points: 3981 Visits: 2235
It also depends on what kind of information are you capturing in your trace file? What are the counters have you opted in your trace? You can also use filter for the specific users.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
shohelr2003
shohelr2003
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 610
I capture the following event and filter in the trace file.


EXEC sp_trace_setevent @TraceID, 12,1, @on --SQL-BatchCompleted,TextData
EXEC sp_trace_setevent @TraceID, 12,6, @on --SQL-BatchCompleted,NTUserName
EXEC sp_trace_setevent @TraceID, 12,8, @on --SQL-BatchCompleted,HostName
EXEC sp_trace_setevent @TraceID, 12,10, @on --SQL-BatchCompleted,ApplicationName
EXEC sp_trace_setevent @TraceID, 12,11, @on --SQL-BatchCompleted,LoginName
EXEC sp_trace_setevent @TraceID, 12,12, @on --SQL-BatchCompleted,SPID
EXEC sp_trace_setevent @TraceID, 12,14, @on --SQL-BatchCompleted,StartTime
EXEC sp_trace_setevent @TraceID, 12,15, @on --SQL-BatchCompleted,EndTime
EXEC sp_trace_setevent @TraceID, 12,35, @on --SQL-BatchCompleted,DatabaseName

EXEC sp_trace_setevent @TraceID, 13,1, @on --SQL-BatchString,TextData
EXEC sp_trace_setevent @TraceID, 13,6, @on --SQL-BatchString,NTUserName
EXEC sp_trace_setevent @TraceID, 13,8, @on --SQL-BatchString,HostName
EXEC sp_trace_setevent @TraceID, 13,10, @on --SQL-BatchString,ApplicationName
EXEC sp_trace_setevent @TraceID, 13,11, @on --SQL-BatchString,LoginName
EXEC sp_trace_setevent @TraceID, 13,12, @on --SQL-BatchString,SPID
EXEC sp_trace_setevent @TraceID, 13,14, @on --SQL-BatchString,StartTime
EXEC sp_trace_setevent @TraceID, 13,15, @on --SQL-BatchString,EndTime
EXEC sp_trace_setevent @TraceID, 13,35, @on --SQL-BatchString,DatabaseName

EXEC sp_trace_setfilter @TraceID, 35, 0, 0, N'dbname'


shohelr2003
shohelr2003
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 610
GilaMonster (5/14/2014)
The trace will show the modifications, but it's high overhead. Maybe a trigger?

Yes, I found information that someone has opened Edit window but did not find what has changed. Can I write DML trigger on Database or Table?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)SSC Guru (87K reputation)

Group: General Forum Members
Points: 87227 Visits: 45272
shohelr2003 (5/14/2014)
GilaMonster (5/14/2014)
The trace will show the modifications, but it's high overhead. Maybe a trigger?

Yes, I found information that someone has opened Edit window but did not find what has changed.


Because of the filter on database name most likely. Take that off and look at the events.

DML triggers go on tables.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


shohelr2003
shohelr2003
Old Hand
Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)Old Hand (335 reputation)

Group: General Forum Members
Points: 335 Visits: 610
@GilaMonster, Thank you for your valuable time and suggestion.
FTdenali
FTdenali
SSC-Addicted
SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)SSC-Addicted (471 reputation)

Group: General Forum Members
Points: 471 Visits: 572
hi,
I once had similar issue and i used a combination of database level triggers and Server level triggers.
Foe Database level it was for checking who and when data was deleted on a table, and for Server level it was for
who or when a table structure was modified.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search