Articles in this section
Category / Section

Move data from SFTP to SQL Server using Data Integration Platform

2 mins read

Introduction:

This article explains how to move data from the SFTP (Secure File Transfer Protocol) server to the SQL table using the Syncfusion Data Integration Platform.

Steps Involved:

Using the Syncfusion Data Integration Platform:

  1. To fetch the data from the SFTP server.
  2. Process the Excel sheet to CSV data.
  3. Move the final processed data into a SQL database.

The SFTP server has the following Excel sheet in its root directory and you need to move this file using the Syncfusion Data Integration Platform.

Data in excel sheet

Defining a dataflow in the Data Integration Platform as shown in the following image.

Data flow in Data Integration Platform

   Data flow in Data Integration Platform

Step 1: Fetch files from the SFTP server

Drag and drop the GetSFTP processor and specify the following properties:

Hostname: <Specify the hostname or IP address of the remote system in which the SFTP server is running>

Username:<Specify the username to connect to SFTP server>

Password:<Specify the password to connect to SFTP server>

Set the “Search Recursively” property to “true” to search through all the subdirectories of the SFTP root directory.

GetSFTP configuration

Set the “Delete Original” property to “false” to keep the files in the SFTP server after file transmitting.

GetSFTP configuration

Step 2: Convert the Excel sheet to CSV file

Drag and drop the ConvertExcelToCSV processor and if the Excel file has more than one sheet, specify the sheet name to be converted to CSV. Otherwise, leave it empty.

ConvertExcelToCSV configuration

Step 3: Insert CSV data into a SQL table

Drag the PutDatabaseRecord processor and configure it as follows to move the data into the created SQL table.

Record Reader: <Enable the CSVReader controller service to read the incoming CSV data>

Statement Type: <Select the statement type from the given options>

Database Connection Pooling Service: <Enable the DBCPConnectionPool controller service to connect to SQL database>

Table Name: <Specify the table name to insert data>

PutDatabaseRecord configuration

Configure the CSVReader controller service as follows:

CSVReader configuration

Enable all the created controller services as follows:

Enable controller services

Note:

Make sure you have created a SQL table (healthdata1) using the following query and create a controller service for it in the Data Integration Platform. For more details on controller settings, refer to our documentation.

 

SQL schema

Inserted CSV data in the SQL table:

Output CSV data

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied