Re: How to use xp_trace_generate_event



Hi
Below is the script I am using:


-- Create a Queue
declare @rc int
declare @QueueHandle int
exec @rc = xp_trace_addnewqueue 1000, 5000, 95, 90, 67354401, @QueueHandle
output
if (@rc != 0) goto error

-- Set the events
-- SQL Server 2000 specific events will not be scripted

exec xp_trace_seteventclassrequired @QueueHandle, 10, 1
exec xp_trace_seteventclassrequired @QueueHandle, 12, 1
exec xp_trace_seteventclassrequired @QueueHandle, 14, 1
exec xp_trace_seteventclassrequired @QueueHandle, 15, 1
exec xp_trace_seteventclassrequired @QueueHandle, 17, 1


-- Set the Filters
exec xp_trace_setappfilter @QueueHandle, N'', N'SQL Profiler'


-- set the destinations
exec xp_trace_setqueuedestination @QueueHandle, 4, 1,
N'sql-nt4',N'[master]..[Untitled - 1]'



-- save the definition in the registry
exec xp_trace_savequeuedefinition @QueueHandle, N'Untitled - 1', 1

-- display queue handle for future references
select QueueHandle=@QueueHandle
goto finish

error:
select ErrorCode=@rc

finish:
go



Please suggest what changes in script should I do to get the trace result in
the table.

Thanks
Pushkar




"Sue Hoegemeier" <Sue_H@xxxxxxxxxxxxx> wrote in message
news:t0pda1dnmf5raf844u5laj2ct4iaooktvm@xxxxxxxxxx
> It's hard to say without seeing what you are specifying for
> xp_trace_setqueuedestination but try to qualify the table
> for the table parameter, e.g. 'YourDB..YourTable'
> Make sure you are using 4 for the destination parameter.
>
> -Sue
>
> On Wed, 8 Jun 2005 16:01:48 +0530, "Pushkar"
> <tiwaripushkar@xxxxxxxxxxx> wrote:
>
> >Hi
> >
> >I have created a stored procedure that create a trace on SQL 7 and start
> >the trace. but this procedure is sending the trace to a file. I want to
send
> >the output of trace to a table.
> >I am using xp_trace_setqueuedestination and specified the proper
destination
> >table, but still I am not able to get the data in the table.
> >
> >After some research I find out that I have to xp_trace_generate_event.
> >But I don't know how to use xp_trace_generate_event to generate the
output
> >to a trace table.
> >
> >Can someone help in doing this?
> >
> >Or is there some undocumented stored procedure like sp_trace_getdata that
> >exist in SQL 2000.
> >
> >Thanks in advance.
> >
> >Pushkar
> >
> >
>


.



Relevant Pages

  • Re: Creating a trace from a script
    ... working properly on SQL 2000. ... I'm trying to create a trace from a script (sp_trace_create, ... Links for SQL Server Books Online: ...
    (comp.databases.ms-sqlserver)
  • Server-side trace
    ... I created SQL Trace in SQL Profiler. ... In script I specified StopTime and created SP with that script. ... Login Name = 'haris' ...
    (microsoft.public.sqlserver.server)
  • Re: how to generate full-texting setting script for porting to another SQL Server?
    ... This is easy to gather either via the Enterprise Manager and script out ... Full Text Indexing using T-SQL from a Profiler Trace ... SQL Full Text Search Blog ...
    (microsoft.public.sqlserver.fulltext)
  • RE: Trace file being imported to a table
    ... I'm running SQL 2000. ... me to do that I created my trace file in profiler and then ... script doesn't script saving the trace to a table. ...
    (microsoft.public.sqlserver.security)
  • [RFC][PATCH 0/7] perf trace: general-purpose scripting support, v2
    ... Here's a belated update to v1 of the trace stream scripting support ... output of 'perf trace' and making it directly available to ... It also builds a general-purpose Perl ... wakeup-latency.pl script, if run for a long enough time, will show ...
    (Linux-Kernel)

Quantcast