Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2003
    Posts
    223

    Unanswered: How to copy txt files from FTP?

    Hello, everyone:

    I want setup a scheduled job to copy txt files from FTP to local hard drive. How to open FTP and copy files from SQL Server Query Analyzer?

    Thanks

    ZYT
    ZYT

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    1) Create a DTS package to do the copy (and probably the processing too).
    2) Create a SQL Server Agent Job to execute the DTS package
    3) Call sp_start_job to make it go.

    -PatP

  3. #3
    Join Date
    Feb 2003
    Location
    India
    Posts
    216
    else u will have to call a FTP script file, that will do the download, using shell as

    Code:
    xp_cmdshell 'ftp -s:c:\FTPScriptFile.txt'
    and the script file (FTPScriptFile.txt) should contain

    Code:
    open FTP_Server_Name
    User_name
    Password
    get File_Name
    quit

  4. #4
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    or File Transfer Protocol task in DTS.

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by PMASchmed
    or File Transfer Protocol task in DTS.
    That sounds like a great idea to me.

    -PatP

  6. #6
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Personally I have always used BAT or VBS files...
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •