DTS Issue For FTP w/ Batch File

  • I have an Execute Process Task in a DTS that executes a

    batch file. This batch file is designed to pull a text file from an ftp site.

    The batch file works when I test it, by executing it from Windows Explorer

    and drops the ftp'd text file into the same folder with the batch file.

    When I run my DTS and the Execute Process Task runs, it appears

    that the batch file executes, but the ftp'd text file is not where I expected it (in the folder with the batch file). Can anyone please tell me what's going on here? Where is the text file going?

    Thanks.

  • James,

    Does the text file get generated anywhere on the server? Can you find the file?

  • I've looked for the file on the server and can't locate it. I tried beginning my batch file with CHDIR in an attempt to have the ftp'd file dropped in the network location I'd like.  That didn't work.

    My goal is to place the file in a specific network location where the DTS can continue processing it.  When I test the DTS from my PC, the file is placed at C:\MSSQL7\BINN  When I run it as a scheduled job, I don't know where the file is being generated, but I do see the batch file execute.

  • it is defaulting to the current active directory.  This is the script we use to transfer files from DTS.  We use a LCD for the local machine with a hardcoded directory.

     

    cd "exportdir"

    lcd "k:\inetpub\ftproot\travel\data\prefhotel\working"

    mget inputfile1*.txt

    mdelete inputfile1*.txt

  • when you execute a DTS package from your workstation, the command is executed in reference to your workstation, so the lcd command will get the file from the FTP site to your K:\.... drive.  When you schedule the DTS package to run, it is ran at the Server in the security context of the SQL Agent, and there is probably not a K:\... location.  why don't you change the lcd command to a UNC and see if it works.

  • The file will be located in the C:\Program Files...SQL Server\binn directory. That is where the DTS files are located.

    Have you tried using the DTS FTP task?

    --------------------
    Colt 45 - the original point and click interface

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply