Trace to find which logins are executing which stored procedures

  • Hello,

    Does anyone have any recommendations to find out which user is running which stored procedure when? I am using a trace right now to try to find out which SQL user/login is calling a certain SP.

    I have used profiler before but never for something so specific. I created a template to capture: remote starts for SP's, starts for SP's, and starts for TSQL statements inside an SP.

    The wall I run into is to which columns should I put in there and how should I filter them.

    For example - Should I set the TextData like the SP name I am searching for?

    Any recommendations or links to resources on how to get specific with traces would be great. Thanks in advance.

  • Hi Yin,

    Start a new trace for SP:Completed. Select ApplicationName, HostName, LoginName, ObjectName, StartTime, and TextData. Filter based on your criteria, i.e. stored procedures, database name, and/or login names.

    Let me know if you need additional help.

    Happy Holidays!

  • hi yeh there is one another way to do that but i don't understand what exactly you want ... please reply me with brief description.

    currently i have made one stored procedure that can give the current user's activity with their logintime,hostname etc.

    and with details which query or procedure they currently executed but this is for realtime.

    tell me if you want to do like this.

    Raj Acharya

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply