dbTalk Databases Forums  

can't delete file from a job but succeeds from the dts

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss can't delete file from a job but succeeds from the dts in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ia.zohar@gmail.com
 
Posts: n/a

Default can't delete file from a job but succeeds from the dts - 07-25-2005 , 10:27 AM






Hi,
I have a problem that I don't understand.
I am trying to do a simple thing:

Dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
filesys.DeleteFile("v:\skarimTest.xls")

from an activex inside a dts.
The v:\ drive is mapped via "net use" to a directory on a different
server (I also tried the \\serverName\<directory>).

If I run the DTS directly everything works fine (if I run the DTS from
my client or directly from the server), but from a job scheduled to run
the DTS it always fail.
The sqlServerAgent that runs the jobs is run by the Administrator user.

What can be the problem?
I'll be very happy for any suggestion because I've tried so many
solutions and nothing seemed to work.

Thanks a lot,
Adi.


Reply With Quote
  #2  
Old   
Panch
 
Posts: n/a

Default Re: can't delete file from a job but succeeds from the dts - 07-25-2005 , 12:44 PM






Hi
I use 'xp_cmdshell', it works fine for me. Try it !!
(xp_cmdshell can run any dos commands, you have to specify 'del
\\server\filename' , this should take care of it.

Panch


Reply With Quote
  #3  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: can't delete file from a job but succeeds from the dts - 07-25-2005 , 02:27 PM



Chances are that the Administrator account has no idea about the v drive.

Can you use UNC paths?

also look here

http://support.microsoft.com/?kbid=269074

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


<ia.zohar (AT) gmail (DOT) com> wrote

Quote:
Hi,
I have a problem that I don't understand.
I am trying to do a simple thing:

Dim filesys
Set filesys = CreateObject("Scripting.FileSystemObject")
filesys.DeleteFile("v:\skarimTest.xls")

from an activex inside a dts.
The v:\ drive is mapped via "net use" to a directory on a different
server (I also tried the \\serverName\<directory>).

If I run the DTS directly everything works fine (if I run the DTS from
my client or directly from the server), but from a job scheduled to run
the DTS it always fail.
The sqlServerAgent that runs the jobs is run by the Administrator user.

What can be the problem?
I'll be very happy for any suggestion because I've tried so many
solutions and nothing seemed to work.

Thanks a lot,
Adi.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.