Download and extract files from remote server

  • Hi,

    I have a requirement to connect to remote server and download CAB files to local server. Need to extract the CAB files which contains a CSV file and write the contents to the database table. Sql Server 2005.

    What are the best possible solutions for this?

    1. Do we need to write code in .NET and call the dll in sql?

    2. Write a CLR function for this task?

    3. Is there a way to have pure tsql commands to get this done?

    Thanks,

  • You could use SSIS to do this.

    How are you planning to download the file? FTP?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • I have a constraint that I cannot use SSIS. Can this be possible with just sql?

  • This is a bit like being given a nail and told you're not allowed to use a hammer. Why can't you use SSIS?

    John

  • The requirement is such. What will be the solution using SSIS, so that it can be considered. please let me know.

  • If you've never worked with SSIS before, I recommend that you search the web for a "getting started" tutorial. That will help you to create a basic package.

    John

  • I am familiar with SSIS, but not sure of how to get this task done.

  • dorothy.burton (10/17/2013)


    I am familiar with SSIS, but not sure of how to get this task done.

    Depends on how you want to download the file.

    Could be with the FTP task, or with some .NET. (Downloading a file over HTTP the SSIS way)

    Extracting could be done with an Execute Process Task (or with some .NET if you want to).

    Importing the .csv files can be done with a data flow inside a for each loop.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • How to download using .NET code. I have "ftpservername", "ftpdirectory" and the "filename" details.

    I need to copy this file to my local server.

  • dorothy.burton (10/17/2013)


    How to download using .NET code. I have "ftpservername", "ftpdirectory" and the "filename" details.

    I need to copy this file to my local server.

    Why not use the FTP task?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • All the ftp details are variables that get data from a database table and loop through the resultset.

  • dorothy.burton (10/17/2013)


    All the ftp details are variables that get data from a database table and loop through the resultset.

    Your point being?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • how do I set the variables for the FTP task?

    How to assign values to the variables at run time?

  • dorothy.burton (10/17/2013)


    how do I set the variables for the FTP task?

    How to assign values to the variables at run time?

    You use expressions on the properties of the FTP task.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 14 posts - 1 through 13 (of 13 total)

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