• Jack Corbett (2/9/2009)


    I modified the code in the script to fix this oversight. Steve just needs to release the updated code. Here it is here as well:

    SELECT

    I.NTUserName,

    .....

    {Removed for brevity}

    ... I.LoginSid is not null

    Group By

    I.NTUserName,

    I.loginname,

    I.SessionLoginName,

    I.databasename,

    S.principal_id,

    S.sid,

    S.type_desc,

    S.name

    I overlooked the fact that the Path stored in sys.traces includes the numeric extension to the file name. The CASE strips the numeric portion of the file name.

    Apolagies if this sounds dumb because I may just be missing something but the way I read your reply with this new code was that it would load all of the traace files and not just the last one else why strip out the file number portion of the trace file name? When I run this exact code as is I only get data from the most recent trace file.

    Whats weird about this is I swear there was a forum posting discussing this same thing with the fn_Trace_Gettable() function/procedure and I thought someone did list a way to get the thing to load content from all trc files in that same directory.

    Am I going crazy or is that familiar to anyone else, that there is a way to load all the trc file?

    Thanks Jack!

    Kindest Regards,

    Just say No to Facebook!