Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase «««123

Automating the SQL Profiler Expand / Collapse
Posted Monday, June 24, 2013 5:12 AM



Group: General Forum Members
Last Login: Friday, November 18, 2016 12:42 PM
Points: 2,947, Visits: 9,054
nivedita talukdar (6/24/2013)

I just edited the job and ran this below command:

SELECT * INTO trace_table1 FROM ::fn_trace_gettable('C:\PWB_Test\T.trc', 1)

The job went fine....and also deleted my T.trc file from folder...

But how do I do for the rest of the files now...

If I do change the value to 2 or 3 it says that, 'trace_table1' already exists... job fails..

Any suggestions for this one?


What HanShi is saying is that your "SELECT INTO ...." statement creates the table and loads it in 1 step. But for file 2, since the table now exists, you need to use "INSERT INTO ..." which will only load the table, not try to create it.

And that you need some logic to sequentially process all the files.

Post #1466690
Posted Monday, June 24, 2013 3:07 PM



Group: General Forum Members
Last Login: Yesterday @ 9:11 AM
Points: 150, Visits: 781
I recall plinking around with server-side traces a while back and vaguely remember that if Profiler is writing to the file, it locks the file. I had to write a job to stop/start, forcing a new file and releasing the old one for importing into my table. My requirements needed the trace to start before prime time and end after primetime rather than 7/24 so I had 3 jobs: 1 to start in the morning, 1 to stop/start throughout the day at intervals and 1 to stop for the night.
Post #1466918
« Prev Topic | Next Topic »

Add to briefcase «««123

Permissions Expand / Collapse