Problems With SP_TRACE_CREATE
May 12, 2008
Hi All,
I'm trying to create a trace on my SQL 2005 Express.
I used the following code:
DECLARE @TraceID INT
DECLARE @MaxSize bigint
SET @MaxSize = 15
EXECUTE sp_trace_create @TraceID output,
@options = 2, --//rollover the file when max size is reached
@tracefile = N'C:Documents and SettingsdmanbuhnikMy DocumentsTestTrace.trc', --//trace file name
@maxfilesize = @MaxSize --//maximum file size
SELECT @TraceID --//output the traceid create for viewing
When I run it, I keep getting an error:
Windows error occurred while running SP_TRACE_CREATE. Error = 0x80070005(error not found).
Msg 19062, Level 16, State 1, Procedure sp_trace_create, Line 1
Could not create a trace file.
Any idea what's wrong??
thanks a lot,
Yoav
View 9 Replies
Nov 9, 2007
I'm trying to find sample coding were the Sp_trace_create procedure is being used.
Can anyone provide some assistance?
Thanks
Ken
View 6 Replies
View Related
Jun 11, 2006
I am getting a return code of 12 (""File not created"") from sp_trace_create. I have checked to ensure that the path is valid. I am using Windows Authentication and the Windows Administrator account. SQL Server is using the Windows userid that I created for SQL Server. I have verified (at least tried to verify) that the user for SQL Server has access to the folder containing it. The following is the relevant portion of what I am attempting. DECLARE @RC int, @TraceId intExec @RC = sp_trace_create @TraceId OUTPUT, 0, N'C:TraceFile' I have tried other paths that also do not work.
View 1 Replies
View Related
Nov 12, 2007
I have been given the task in using T-Sql procedures.
The objective is to create audit logs usibg the sp_trace_create procedure.
Can you provide some guidance in where can I find some sample coding using the above subject command?
Please note that I'm using SQL Server 2005
View 1 Replies
View Related
Feb 19, 2007
My goal is to monitor all failed login attempts to server. I have:
DECLARE @traceidnum INT, @on BIT, @file_path NVARCHAR(50), @maxsize bigint;
SET @on = 1; SET @maxsize =5; SET @file_path = 'c: race'; --Create trace EXEC sp_trace_create @traceid = @traceidnum OUTPUT, @options = 2, @tracefile = @file_path, @maxfilesize = @maxsize, @stoptime=null, @filecount =0; --trace stop EXEC sp_trace_setstatus @traceidnum, 0 --Set events EXEC sp_trace_setevent @traceidnum, 14, 1, @on --trace start EXEC sp_trace_setstatus @traceidnum, 1
this works fine, but the problem is when sql server restarts I loose trace but trace-file remains. When I want to create new trace with the same parameters I receive Error = 0x80070050(File Exists) .
Is there any way to reuse trace-file? Or to change trace's file path to indicate file already created?RegardsKonRi
View 4 Replies
View Related
Dec 12, 2007
I keep getting this error:
OLE DB error: OLE DB or ODBC error: You do not have permission to run 'SP_TRACE_CREATE'.; 42000
I do not want to add the login account to sysadmin role on my production server and giving the logon account db_reader rights to my database is not working. Is there another way around it.
View 3 Replies
View Related