Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Automating the SQL Profiler


Automating the SQL Profiler

Author
Message
homebrew01
homebrew01
SSCrazy
SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)SSCrazy (3K reputation)

Group: General Forum Members
Points: 2980 Visits: 9071
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... Sad 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.



Your Name Here
Your Name Here
SSC-Enthusiastic
SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)SSC-Enthusiastic (158 reputation)

Group: General Forum Members
Points: 158 Visits: 789
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.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search