August 24, 2005 at 5:39 am
Hi,
I'm running the following simple DOS batch file from an Execute Process Task within the DTS.
REM ********************************************
REM Add the header file to the VAX download file
REM ********************************************
COPY E:\Data\VAX\Nj\NJ_HEADER_BACKUP.TXT E:\Data\VAX\Nj\NJ_HEADER.TXT
COPY E:\Data\VAX\Nj\NJ_HEADER.TXT + E:\Data\VAX\Nj\COSCHNJ.TMP
DEL E:\Data\VAX\Nj\COSCHNJ.TMP
REN E:\Data\VAX\Nj\NJ_HEADER.TXT COSCHNJ.TMP
When I run this from the command prompt it works, when you run it from the DTS it does not, NO error msgs!
Is this simply a batch file issue or is the DTS causing the file to not correctly execute!
Thanks.
Mike
August 24, 2005 at 6:36 am
Just a thought... Check out the permissions of the server login who owns the SQLSERVERAGENT service. If your login has permissions to run the commands and the service owner does not, that might explain it.
August 25, 2005 at 5:36 am
Is drive E: a network drive? Is it attached when the owner of the Sql Server Agent is executing? Try to write a test batch that copies from C: to C: and see if that works... if it does, it is either a permissions or mapped drive problem.
-Mike Gercevich
August 25, 2005 at 9:48 am
Thankyou for you replies, the E: drive is a second partition on the same disk within the server !
I have the following to try tonight to see if this works !
BATCH FILE
"c:\winnt\system32\wscript.exe" E:\Data\V\N\Merge.vbs
VBSCRIPT
Const ForAppending = 8
sFileA = "E:\Data\VAX\Nj\aTXT"
sFileB = "E:\Data\VAX\Nj\bTMP"
sFileC = "E:\Data\VAX\Nj\ctxt"
set oFS = WScript.CreateObject("Scripting.FileSystemObject")
oFS.CopyFile sFileA, sFileC
oFS.OpenTextFile(sFileC, ForAppending).Write oFS.OpenTextFile(sFileB).ReadAll
Thanks.
Mike
August 27, 2005 at 12:30 am
Hi,
I think the user(login) dont have permission on sp_smdshell stored proccedure.
from
killer
August 30, 2005 at 4:44 am
Hi, I think it was a combination of things!
Firstly, security privileges
Secondly, this particular DTS was the last of 4 to run, on successful compilation of these it sends a MAPI Email, as a result, when this has finished the default directory has changed to c:\winnt\system32\........\MAPI\NT..... and this was were the output file was saved !
I have changed the script again to:
CD
E:
CD
CD Data\V\Nj
DEL OUTPUT.TXT
COPY NJ_HEADER_NAMES.TXT NJ_HEADER.TXT
COPY NJ_HEADER.TXT + INPUT.TMP
REN NJ_HEADER.TXT OUTPUT.TXT
CD
C:
CD WINNT
Will see how we go on tonight.
Cheers for the help, greatly appreciated.
Mike
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply