|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 17, 2013 12:22 PM
Points: 10,571,
Visits: 11,871
|
|
Jeff Moden (12/2/2010)
I recently had cause to revisit this fine article... well done, Adam. Great for neophytes and alumni alike. As a side bar, here's the code I ended up using which could actually be turned into an iTVF... SELECT trc.LoginName, -- trc.LoginSID, trc.SPID, trc.IsSystem, trc.HostName, trc.ApplicationName, trc.ServerName, trc.DatabaseName, trc.ObjectName, evt.Category_ID, CategoryName = cat.name, trc.TextData, trc.StartTime, trc.EventClass, trc.EventSubClass, EventName = evt.name FROM FN_TRACE_GETTABLE( ( SELECT CAST([Value] AS NVARCHAR(4000)) --Drive, path, and filename of trace file FROM FN_TRACE_GETINFO(0) --0 = Current Server WHERE [Property] = 2 --2 = Trace File Path ) ,0) trc --0 = Latest default trace file INNER JOIN sys.Trace_Events evt ON eventclass = trace_event_id INNER JOIN sys.Trace_Categories cat ON evt.category_id = cat.category_id WHERE trc.DatabaseName = 'somedatabasenamehere' AND trc.ObjectName = 'somesqlserverobjectnamehere' ;
Heh... and, no... I don't code for things to work on case sensitive servers. 
Jeff,
I prefer to use sys.traces over fn_trace_getinfo and then you can do an cross apply on fn_Trace_gettable. Like this:
sys.traces T CROSS APPLY sys.fn_trace_gettable(CASE WHEN CHARINDEX('_', T.[path]) <> 0 THEN SUBSTRING(T.PATH, 1, CHARINDEX('_', T.[path]) - 1) + '.trc' ELSE T.[path] End, T.max_files) TRC
Jack Corbett
Applications Developer Don't let the good be the enemy of the best. -- Paul Fleming
Check out these links on how to get faster and more accurate answers: Forum Etiquette: How to post data/code on a forum to get the best help Need an Answer? Actually, No ... You Need a Question How to Post Performance Problems Crosstabs and Pivots or How to turn rows into columns Part 1 Crosstabs and Pivots or How to turn rows into columns Part 2
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 2:32 PM
Points: 32,906,
Visits: 26,792
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, April 12, 2011 11:56 AM
Points: 1,
Visits: 33
|
|
Trace ID '3' was stopped because of an error. Cause: Stopping the trace because the current trace file is full and the rollover option is not specified.. Restart the trace after correcting the problem.
i am getting this error on SQL Server, There is default error message enabled on SQL. How to specifiy the roll over option on default trace. if i open any default trace files, i am unable to view any roll option on SQL Server profiles studio.
Any idea would be appreciated.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 2:17 AM
Points: 6,862,
Visits: 8,049
|
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Friday, May 17, 2013 12:22 PM
Points: 10,571,
Visits: 11,871
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Sunday, March 24, 2013 12:47 PM
Points: 21,
Visits: 291
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Sunday, March 24, 2013 12:47 PM
Points: 21,
Visits: 291
|
|
Here is a nice set of reports on the Default trace: http://sqlconcept.com/default-trace-audit-documentation-and-faq
Make everything as simple as possible, but not simpler. Albert Einstein
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 11:18 AM
Points: 848,
Visits: 1,453
|
|
sibir1us (5/9/2011) Here is a nice set of reports on the Default trace: http://sqlconcept.com/default-trace-audit-documentation-and-faq
Too bad you have to sign up for yet one more site in order to review/use the item detailed in the post. Maybe its just me but its relaly annoying to be required to sign up for yet one more sites list just to read/review something teh author wants to actualy share with others.
Kindest Regards,
A Democracy works great until the day you find yourself on the sheep side of a vote between 5 wolves and 4 sheep on what’s for dinner when neither have eaten in many days. A free Republic where the rights of the few and the individual are protected is the only one in which Freedom and Prosperity for all have a chance to blossom.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Sunday, March 24, 2013 12:47 PM
Points: 21,
Visits: 291
|
|
YSLGuru (5/10/2011)
sibir1us (5/9/2011) Here is a nice set of reports on the Default trace: http://sqlconcept.com/default-trace-audit-documentation-and-faqToo bad you have to sign up for yet one more site in order to review/use the item detailed in the post. Maybe its just me but its relaly annoying to be required to sign up for yet one more sites list just to read/review something teh author wants to actualy share with others.
It is worth it, trust me. :)
Make everything as simple as possible, but not simpler. Albert Einstein
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Yesterday @ 11:18 AM
Points: 848,
Visits: 1,453
|
|
sibir1us (5/10/2011)
YSLGuru (5/10/2011)
sibir1us (5/9/2011) Here is a nice set of reports on the Default trace: http://sqlconcept.com/default-trace-audit-documentation-and-faqToo bad you have to sign up for yet one more site in order to review/use the item detailed in the post. Maybe its just me but its really annoying to be required to sign up for yet one more sites list just to read/review something the author wants to actually share with others. It is worth it, trust me. :)
It very well maybe but the point is you don't know until you've gone thru the sign up process. Its one thing to sign up at a site you plan to visit regularly like this one but if you have to register just to review/read something advertised on another site I think thats asking too much in this day and age. Then again maybe most foilks like collecting site registrations like some collect stamps and its just me who prefers not to have to register every time.
I did get a post from what I assume is the site owner saying the registration was to discourage those who only wanted to review the default trace file and that they did not have time to spam the emails of those who registered. Not sure where the user read anything about being accused of spamming however its their site so they can put in place what ever restrictions they want.
Kindest Regards,
A Democracy works great until the day you find yourself on the sheep side of a vote between 5 wolves and 4 sheep on what’s for dinner when neither have eaten in many days. A free Republic where the rights of the few and the individual are protected is the only one in which Freedom and Prosperity for all have a chance to blossom.
|
|
|
|