We have to set profiler for perticular login.... When anything running by that login i need to capture the details of that perticular login... how I can set the condition for it.... Can anyone give me the step by step process on it?
This is simple. When you are setting up a Trace Properties in the Profiler, switch to Events Selectuion tab and ensure, that you have a LoginName column selected. Once you have that column selected, you can click on the Column Filters button and in next dialog select the LoginName column and write the Like expression to contain the login name, which you want to monitor. After that when the Trace will be running, Profiler will be collecting information only for that particular login. **EDIT:** In case the traces should be run automatically, you can define SQL Straces. For details related to SQL Traces take a look on MSDN: [Introducing SQL Trace]. You can use a [LOGON triggers (MSDN)] to start the trace once the user Logs in for the first time. You will check whether the trace exists and if not, then you start the trace. Lter you do not need to take care about the trace much as it will collect event only for that particuar user (of course if you setup the trace filters properly). If you want to shut down the trace automatically, than you can implement an Event Notification quee and processing for the Audit Logout events. Some sample you can find for example in this blog post [Auditing User Log Out Events] by JimMcLeod, as there is no LOGOUT trigger. Of course it will require adaptation to your needs. :