Sync Sftp CSV data to SQL Server on schedule
Recipe ToolsMarketingFile TransferData ParserDatabase
What it does
When a scheduled interval arrives, this automation downloads a CSV file from an Sftp server and parses it. The parsed data replaces old rows in the SQL Server dbo.USER_PROFILE table.
Who it's for
Data and analytics teams who need to keep SQL Server synchronized with Sftp file exports on a regular cadence.
How teams use this
Sync employee data nightly
Download the latest employee roster from Sftp each night and refresh the SQL Server table. The team wakes up to current data without manual steps.
Run sync on demand from a dashboard
Replace the clock trigger with a webhook so someone can kick off the sync from a monitoring dashboard instead of waiting for the schedule.
Filter rows before inserting to SQL Server
Add a condition after parsing so only rows matching a department or status are inserted into dbo.USER_PROFILE. This keeps the table focused on relevant records.
How it works
- Wait for the scheduled interval. At the specified time, this automation wakes up and begins the sync process from the Sftp server to SQL Server.
- Download the CSV file. Retrieve the file from the Sftp server so the data is ready to parse and load into SQL Server dbo.USER_PROFILE.
- Parse the CSV into rows. Convert the downloaded file into structured data rows that SQL Server can accept and insert into the table.
- Replace old data with new rows. Delete existing rows from dbo.USER_PROFILE and insert the parsed batch so the table reflects the latest Sftp file.