question

Vel avatar image
Vel asked

Exclude "SessionLoginName" from SQL Audit Trace

I'm working on a stored procedure to capture SQL Server 2005 Audit events. There is a Web Application login/user account that generates a LOT of rows because it is constatntly hitting the database. I'm using something like: -- Audit Schema Object Access Event = 114 -- Indicates that an object permission (such as SELECT) has been used. exec sp_trace_setevent @TraceID, 114, 1, @on -- TextData exec sp_trace_setevent @TraceID, 114, 8, @on -- HostName exec sp_trace_setevent @TraceID, 114, 14, @on -- StartTime exec sp_trace_setevent @TraceID, 114, 27, @on -- EventClass exec sp_trace_setevent @TraceID, 114, 21, @on -- EventSubClass exec sp_trace_setevent @TraceID, 114, 23, @on -- Success exec sp_trace_setevent @TraceID, 114, 35, @on -- DatabaseName exec sp_trace_setevent @TraceID, 114, 38, @on -- RoleName exec sp_trace_setevent @TraceID, 114, 42, @on -- TargetLoginName exec sp_trace_setevent @TraceID, 114, 64, @on -- SessionLoginName How do I EXCLUDE a specific "SessionLoginName", for example userXYZ, from being audited? Software used: MS SQL Server 2005
sql-server-2005audit
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ThomasRushton avatar image
ThomasRushton answered
You need to set up a trace filter. See MS's documentation on [sp_trace_setfilter][1], as well as the more general [trace filtering documentation][2] [1]: http://msdn.microsoft.com/en-US/library/ms174404(v=SQL.90).aspx [2]: http://msdn.microsoft.com/en-US/library/ms175061(v=SQL.90).aspx
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.