Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Trace problem

Author  Topic 

albacam
Starting Member

3 Posts

Posted - 2008-03-12 : 12:25:37
Hello everyone,
I created a trace on profiler and scripted it, I'm trying to make the trace write a file on a shared folder but it keeps returning the error code 12. I don't what's wrong, I have all privileges on the shared folder, i even tried by mapping it and putting the map drive name on the script but doesn't work, it only writes it when i type a local file.
Anyone got idea what could be wrong?, I'm adding the first part of my script:

/****************************************************/
/* Created by: SQL Profiler */
/* Date: 03/11/2008 12:08:40 AM */
/****************************************************/


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

-- Please replace the text InsertFileNameHere, with an appropriate
-- filename prefixed by a path, e.g., c:\MyFolder\MyTrace. The .trc extension
-- will be appended to the filename automatically. If you are writing from
-- remote server to local drive, please use UNC path and make sure server has
-- write access to your network share

exec @rc = sp_trace_create @TraceID output, 0, N'\\acci_serv1\sistemas\temp\sql', @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, 14, 1, @on
exec sp_trace_setevent @TraceID, 14, 6, @on
exec sp_trace_setevent @TraceID, 14, 7, @on



Hope you can help me, thanks in advance
regards

graz
Chief SQLTeam Crack Dealer

4149 Posts

Posted - 2008-03-12 : 16:52:01
Does the SQL Server service account have permissions to write to that directory?

=================================================
Creating tomorrow's legacy systems today. One crisis at a time.
Go to Top of Page

albacam
Starting Member

3 Posts

Posted - 2008-03-12 : 18:36:52
I'm logged in to SQL with windows authentication, and my account has the privileges to write on the directory

thanks
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-12 : 23:18:01
Nothing to do with your login account, sql service startup account needs permission on that folder as graz said.
Go to Top of Page

albacam
Starting Member

3 Posts

Posted - 2008-03-13 : 10:15:52
Thanks alot graz and rmiao, I changed the sql service startup account and it worked now.
regards
Go to Top of Page
   

- Advertisement -