I am using SQL Profiler in MS SQL Server. I can filter data columns by clicking 'Column Filters'. But this filter applies to all events. I want to filter login only for 2 events. Like, audit login and logout only for specified login, but all other events for all logins. Is it possible to do that, and how if yes.
Thanks for your time!
Sql-server – Can SQL Profiler filter data columns only for one event
profilersql server
Related Question
- Sql-server – Multiple Filters for Databases on SQL Server Server Level Audit
- Sql-server – How to trace steps in SQL profiler for only particular application
- Sql-server – How to use SQL Profiler to capture a single stored procedure
- Sql-server – SQL Server Extended event filters: can you use an IN predicate with a subquery
- Sql-server – How to capture execution plan from sql profiler for filtered queries only
- Sql-server – MS SQL login periodically doesn’t work
Best Answer
Unfortunately, this can't be done in the trace definition. Each filter defined executes sp_trace_setfilter filter which groups filters by column, but applies all the filters as a whole...
In the trace definition snippet below it ends up grouped like this:
(DatabaseId = 5 OR DatabaseID = 6) AND (DatabaseId <> 1 AND DatabaseID <> 0) AND (Login like User1 OR Login like User2)
For real-time filtering you'd need to use something like the Save to table option and filter a query against the output there.