Trace user with sql server authentication

  • Hi All,

    How to trace user if database has SQL SERVER Authentication. Please help me on this..

    Thanks in Advance..

  • Just like you would any other trace.

    Put a filter on the logon column for the logon in question

  • EXEC sp_trace_setfilter @TraceID, 11, 0, 0, @UserName;

    @TraceID - Your trace number

    11 - Column 11 is Login

    0 - Comparison uses =

    0 - Logical AND

    @UserName - Your search string

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

  • Thanks for the reply.

    if I put the filter , i will get sql authetication login suppose My project is sales and I will create sql authetication as

    userid: sales

    pwd: sales

    so when application will be used by any user so it will show login name as "sales" not user name. For each and every user it will display same login name.

    My requirement is if any particular user will be access the application instead of sales login name it should show user name, for example "PeterP" or "AroojH" .

    Is there any script to find user name instead of Sql login name.

    Thanks

  • So a Windows user logs into your application, then the application logs into the database using SQL authentication. You cannot trace for the original windows login.

    Why don't you login to the database using Windows authentication?

    The SQL Guy @ blogspot[/url]

    @SeanPearceSQL

    About Me[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

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