sp_create_trace throws Errorcode = 12



Hi,

I'm trying to execute server-side trace with SqlServer 2000 on
cluster. After scripting trace by Profiler I executed this script in
Queryanalyzer and got error code 12. According to BOL this code says
that file is not created but I don't know why, is there are any
obstacles which preventing to add this trace??
Does anybody had that problem?

If it helps I added script which I tried to execute:

-- Create a Queue
declare @rc int
declare @TraceID int
declare @maxfilesize bigint
set @maxfilesize = 5

exec @rc = sp_trace_create @TraceID output, 0, N'C:\Profiler_result
\result.trc', @maxfilesize, NULL
if (@rc != 0) goto error

-- Client side File and Table cannot be scripted

-- Set the events
declare @on bit
set @on = 1
exec sp_trace_setevent @TraceID, 10, 1, @on
/*here are n-setevents*/
exec sp_trace_setevent @TraceID, 43, 35, @on

-- Set the Filters
declare @intfilter int
declare @bigintfilter bigint

exec sp_trace_setfilter @TraceID, 1, 1, 6, N'history'
exec sp_trace_setfilter @TraceID, 1, 1, 6, N'move_history'
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Profiler'
exec sp_trace_setfilter @TraceID, 35, 1, 6, N'kis'


-- Set the trace status to start
exec sp_trace_setstatus @TraceID, 1

-- display trace id for future references
select TraceID=@TraceID
goto finish

error:
select ErrorCode=@rc

finish:
go


Thanks in advance for any advice
Regards,
Bartolo

.



Relevant Pages

  • SQL Server 2005 - Server side trace script
    ... I am trying to set up a trace that will tracks all the "RPC:Completed" events and give me some of the vital statistics like TextData, StartTime, EndTime, Duration, Reads, Writes, CPU, etc. ... I have cut and paste the script I get at the end. ... declare @TraceID int ... declare @bigintfilter bigint ...
    (microsoft.public.sqlserver.tools)
  • Re: SQL Profiler Scheduling
    ... Can you create a stored procedure from the script, ... Kalen Delaney, SQL Server MVP ... declare @TraceID int ... -- display trace id for future references ...
    (microsoft.public.sqlserver.tools)
  • Re: need some advise
    ... I would opt for creating a stored procedure and executing that. ... > need some advise on the best way to do something, i have written a script ... > that i want to execute from an application that i am writting using ... > declare @name varchar ...
    (microsoft.public.sqlserver.programming)
  • RE: Profiler Trace issue
    ... I hope you made the necessory changes with path and file name in the script. ... you got from the trace script. ... declare @TraceID int ...
    (microsoft.public.sqlserver.server)
  • sp_trace_setfilter does not work
    ... I am trying to create a server side trace via script. ... However the trace is created but the filter is not there. ... declare @TraceID int ...
    (microsoft.public.sqlserver.tools)