Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««123

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


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Saturday, April 12, 2014 11:40 AM
Points: 2,795, Visits: 8,297
nivedita talukdar (6/24/2013)
Hi,

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?

Cheers


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


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, April 14, 2014 2:10 PM
Points: 137, Visits: 585
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