Re: How to Capture data from server side trace to file?



The easiest way to make sure you're on the right track is to use the
Profiler tool, get a trace running that is capturing what you want, stop it
and the script it (File>Script Trace). Then run the generated script and
stop it and check you have results. If this is all working okay then check
your code and make sure you don't have any filters present that might be
interfering with the capture. In SQL2000 you need to both stop the
serverside trace and delete its definition from the server in order to open
it correctly using Profiler or fn_trace_gettable. In SQL2005 this is no
lonfer the case and you can access a running server side trace. Are you
actually getting an error or is it simply that the trace file is empty. If
it is truly empty then it's likely an issue with your code - double check it
against the script generated by Profiler

--
HTH

Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org

"msnews.microsoft.com" <ahmadshajee@xxxxxxxxxxx> wrote in message
news:OT5zGaS6FHA.3684@xxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I want to automate tracing for SQL server Profiler. I have written a set
> of
> stored procedures using the SQL Server in-built sp's for the very purpose.
>
> A trace is also being successfully created with trace id and a
> file(MyTrace.trc) is also created however the trace is not writing
> anything
> into the file MyTrace.trc
>
> I've started the trace using the sp sp_trace_setstatus @TraceId, 1
>
> and when accessing info of the trace using
> SELECT *
> FROM ::fn_trace_getinfo(@TraceId)
>
> it shows the correct file path and status as 1
>
> Could some please help me out in this.
>
> What else am i required to do for enabling server side trace and so that
> the
> capture sql traces are written into the file.
>
> Regards
> Shajee
>
>


.



Relevant Pages

  • Re: Running profiler on busy 8-cpu Sql Server
    ... I always start with a light trace and add more detail as I go along to ... SQL Server MVP ... > I think it's also worth saying that you should introduce Profiler ... > SQL Server MVP ...
    (microsoft.public.sqlserver.server)
  • Re: URGENT deadlock question
    ... > Profiler to view a trace, SQL Server dumps rowsets across the network to ... > SQL Server doesn't feel like it can keep up with all the activity. ... > server-side trace to a trace file guarantees you'll see everything. ...
    (microsoft.public.sqlserver.server)
  • RE: SQL Server 2000 Profiler (Bug?)
    ... could trace many Error 208 by using Profiler when you using SQL Server ... Enterprise Manager navigate around in the Server.Have I fully understood ...
    (microsoft.public.sqlserver.server)
  • RE: Insert Performance Degradation
    ... Use Profiler to trace the statements sent to sql server. ... duration template and filter for duration greater than, let us say, 1000 ...
    (microsoft.public.sqlserver.programming)
  • Re: URGENT deadlock question
    ... >> network to the Profiler client, but there is no guarantee you'll see ... >> everything if SQL Server doesn't feel like it can keep up with all ... Just make sure the trace file is created on a local ...
    (microsoft.public.sqlserver.server)