<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sftp Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/sftp/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/sftp/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 11 Dec 2025 11:23:03 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>sftp Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/sftp/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to create SSIS Package Programmatically (Add / Execute Tasks)</title>
		<link>https://zappysys.com/blog/create-ssis-package-programmatically-add-execute-connections-tasks/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 31 Dec 2021 15:00:01 +0000</pubDate>
				<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[SSIS Tips & How-Tos]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9500</guid>

					<description><![CDATA[<p>Introduction In this post, we will see how to create SSIS Package Programmatically to use ZappySys SSIS PowerPack. This blog post assumes you have basic knowledge of Programming language like C# and you have installed Visual Studio Express or a similar product (VS Code not supported). Add SSIS Dll References The very first thing is [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/create-ssis-package-programmatically-add-execute-connections-tasks/">How to create SSIS Package Programmatically (Add / Execute Tasks)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this post, we will see how to create SSIS Package Programmatically to use <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a>. This blog post assumes you have basic knowledge of Programming language like C# and you have installed <strong>Visual Studio Express</strong> or a similar product (<strong>VS Code not supported</strong>).</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Add SSIS Dll References</h2>
<p>The very first thing is to create a C# Project (i.e. Console or WinForm). Add SSIS dll reference.</p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2021/12/create-ssis-package-programatically-add-dll-reference-visual-studio.png"><img decoding="async" class="alignnone size-full wp-image-9503" src="https://zappysys.com/blog/wp-content/uploads/2021/12/create-ssis-package-programatically-add-dll-reference-visual-studio.png" alt="" width="778" height="604" srcset="https://zappysys.com/blog/wp-content/uploads/2021/12/create-ssis-package-programatically-add-dll-reference-visual-studio.png 778w, https://zappysys.com/blog/wp-content/uploads/2021/12/create-ssis-package-programatically-add-dll-reference-visual-studio-300x233.png 300w, https://zappysys.com/blog/wp-content/uploads/2021/12/create-ssis-package-programatically-add-dll-reference-visual-studio-768x596.png 768w" sizes="(max-width: 778px) 100vw, 778px" /></a></p>
<p>You will need the following references in your project. The below example is for SSIS 2017 (Version 14.x.x)</p>
<ul>
<li>For SSIS 2012 change to Version=11.0.0.0</li>
<li>For SSIS 2014 change to Version=12.0.0.0</li>
<li>For SSIS 2016 change to Version=13.0.0.0</li>
<li>For SSIS 2017 change to Version=14.0.0.0</li>
<li>For SSIS 2019 change to Version=15.0.0.0</li>
<li>And may be future versions same way &#8230;.</li>
</ul>
<pre class="crayon-plain-tag">&lt;Reference Include="Microsoft.SqlServer.Dts.Design"/&gt;
&lt;Reference Include="Microsoft.SqlServer.DTSPipelineWrap" /&gt;
&lt;Reference Include="Microsoft.SQLServer.DTSRuntimeWrap" /&gt;
&lt;Reference Include="Microsoft.SQLServer.ManagedDTS" /&gt;
&lt;Reference Include="Microsoft.SqlServer.PipelineHost" /&gt;</pre>
<h2>Step-By-Step Example (Create SSIS Package Programmatically &#8211; C#)</h2>
<p>Now let&#8217;s see each piece to create SSIS Package in code and later we will show the full code.</p>
<h3>Import Namespaces</h3>
<p>First step is at the top you need to import some namespaces.</p><pre class="crayon-plain-tag">using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Pipeline;
//using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
//using Microsoft.SqlServer.Dts.Runtime.Wrapper;</pre><p>
<h3></h3>
<h3>Create SSIS Package</h3>
<p>Here how you can create SSIS Package instance in code</p><pre class="crayon-plain-tag">var p = new Package();</pre><p>
<h3>Add SSIS Connection</h3>
<p>Now lets add connection manager to our package instance. To add connection you will need two pieces. Creation Name (i.e. ZS-SFTP) and ConnectionString. You can find creation name from exsing Dtsx file by opening in text editor.</p><pre class="crayon-plain-tag">var conn1=p.Connections.Add(&quot;ZS-SFTP&quot;);
conn1.Name = &quot;MySftpConnection&quot;;
conn1.ConnectionString= &quot;Protocol=Sftp;ServerName=127.0.0.1;Port=0;LogonType=Normal;UserName=zstest;Password=zstest123&quot;;</pre><p>
<h4>How to find CreationName of SSIS Connection manager</h4>
<p>To find the creation name of your Connection Type open an existing DTSX file where you had similar connection type in the package. Locate node like below and check CrewationName. It can be a friendly name or can be fully qualified assembly name. Both ways is fine but a friendly name is easy to remember.</p><pre class="crayon-plain-tag">&lt;DTS:ConnectionManagers&gt;
  &lt;DTS:ConnectionManager
    DTS:refId="Package.ConnectionManagers[RedshiftConn1]"
    DTS:CreationName="ZS-POSTGRESQL"
    .........
    .........</pre><p>
<h4>How to find ConnectionString</h4>
<p>Now another thing you need to know is the exact connectionstring. You can go to SSIS Designer and right-click on Connection Icon and check Properties Grid. It will show you ConnectionString or you can use the above technique &gt; Open DTSX file in notepad and find connectinstring there.</p>
<p>ConnectionString doesnt include any passwords / secrets. So manually append those properties in your connectionstring when you set in code.</p>
<h3>Add SSIS Task</h3>
<p>Now let&#8217;s add task in our SSIS Package instance. To create SSIS Task programmatically in code, you need to know the exact type name (i.e. creation name). As we discussed earlier check your dtsx file to know the creation name for the task you like to create. In the below code we used a friendly name which is not supported in SSIS 2012 so for that you must use full name. For SSIS 2014 or higher you can use friendly names.</p>
<p>You can also find it in file like this (example of SSIS 2017 and 2019 folders)<br />
C:\Program Files (x86)\Microsoft SQL Server\140\DTS\UpgradeMappings\ZappySys.PowerPack140.Extensions.xml<br />
C:\Program Files (x86)\Microsoft SQL Server\150\DTS\UpgradeMappings\ZappySys.PowerPack150.Extensions.xml</p>
<p>&nbsp;</p><pre class="crayon-plain-tag">//var SSIS_VERSION = "110"; //110=SQL2012, 120=SQL2014, 130=SQL2016, 140=SQL2017, 150=SQL2019
//For SSIS 2012
var SFTP_TASK_2012 = "ZappySys.PowerPack.Task.SecureFtpTask.SecureFtpTask, ZappySys.PowerPack110, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1903265a93eae502";
//For SSIS 2014 or higher
//Goto folder like this and find zappysys extension file 
//(e.g. 140) =&gt; C:\Program Files (x86)\Microsoft SQL Server\140\DTS\UpgradeMappings\ZappySys.PowerPack140.Extensions.xml
//Find Task creation name there
var SFTP_TASK = "ZappySys.SecureFtpTask";

var tsk1 = p.Executables.Add(SFTP_TASK) as TaskHost;
tsk1.Properties["SourceStorageConnection"].SetValue(tsk1, "MySftpConnection");
tsk1.Properties["StorageAction"].SetValue(tsk1, 10); //DownloadFileFromFtp [10] find numeric value for this enum from help file&gt; properties https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-sftp-ftp-ftps-task.htm
tsk1.Properties["SourcePathValue"].SetValue(tsk1, "subfolder/localsubfile1.csv");
tsk1.Properties["TargetPathValue"].SetValue(tsk1, @"c:\temp\");
tsk1.Properties["FileOverwriteAction"].SetValue(tsk1, 2); //OverwriteAll [2]</pre><p>
<h3>Execute SSIS Package</h3>
<p>Now let&#8217;s execute the package using the below line</p><pre class="crayon-plain-tag">var status =p.Execute();</pre><p>
<h3>Check Execution Errors</h3>
<p>At the end you need to check execution errors if any.</p><pre class="crayon-plain-tag">if (status != DTSExecResult.Success)
{
	string errs = p.Errors.Cast&lt;DtsError&gt;().Aggregate("",
           (current, err) =&gt; current + string.Format("Source={0}, Err={1}", err.Source, err.Description));
	throw new Exception("Package status was &gt;&gt; " + status + " &gt;&gt; " + errs);
}</pre><p>
&nbsp;</p>
<h3>Full Code</h3>
<p>Here is the full code</p><pre class="crayon-plain-tag">using System;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime;
/*
For SSIS 2012 - Compile with .net 4.0
For SSIS 2014-2017 - Compile with .net 4.5 
For SSIS 2019 - Compile with .net 4.6.2
 */

//current one is SSIS 2017 (140 dlls)
/*
 * References needed for SSIS 2017 , for 2019 change 14.0.0.0 to 15.0.0.0
 * 
    &lt;Reference Include="Microsoft.SqlServer.DtsMsg, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /&gt;
    &lt;Reference Include="Microsoft.SqlServer.Dts.Design, Version=14.0.0.0, PublicKeyToken=89845dcd8080cc91" /&gt;
    &lt;Reference Include="Microsoft.SqlServer.DTSPipelineWrap, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /&gt;
    &lt;Reference Include="Microsoft.SQLServer.DTSRuntimeWrap, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /&gt;
    &lt;Reference Include="Microsoft.SQLServer.ManagedDTS, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /&gt;
    &lt;Reference Include="Microsoft.SqlServer.PipelineHost, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" /&gt; 
 */
namespace SSISCodeDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            
            //Create_SSIS_Controlflow_Task_Demo();
            Create_SSIS_Dataflow_Source_Component_Demo();

            //Create_SSIS_Connection_Demo();
            //Create_SSIS_Variable_Demo();
            //Create_SSIS_Connect_Tasks_Demo();

        }

        private static void Create_SSIS_Controlflow_Task_Demo()
        {
            var p = new Microsoft.SqlServer.Dts.Runtime.Package();

            var conn1 = p.Connections.Add("ZS-SFTP");
            conn1.Name = "MySftpConnection";
            conn1.ConnectionString = "Protocol=Sftp;ServerName=127.0.0.1;Port=0;LogonType=Normal;UserName=zstest;Password=zstest123";

            //var SSIS_VERSION = "110"; //110=SQL2012, 120=SQL2014, 130=SQL2016, 140=SQL2017, 150=SQL2019
            //For SSIS 2012
            var SFTP_TASK_2012 = "ZappySys.PowerPack.Task.SecureFtpTask.SecureFtpTask, ZappySys.PowerPack110, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1903265a93eae502";
            //For SSIS 2014 or higher
            //Goto folder like this and find zappysys extension file (e.g. 140) =&gt; C:\Program Files (x86)\Microsoft SQL Server\140\DTS\UpgradeMappings\ZappySys.PowerPack140.Extensions.xml
            //Find Task creation name there
            var SFTP_TASK = "ZappySys.SecureFtpTask";

            var tsk1 = p.Executables.Add(SFTP_TASK) as TaskHost;
            tsk1.Name = "SFTP_Task1";
            tsk1.Properties["SourceStorageConnection"].SetValue(tsk1, "MySftpConnection");
            tsk1.Properties["StorageAction"].SetValue(tsk1, 10); //DownloadFileFromFtp [10] find numeric value for this enum from help file&gt; properties https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-sftp-ftp-ftps-task.htm
            tsk1.Properties["SourcePathValue"].SetValue(tsk1, "subfolder/localsubfile1.csv");
            tsk1.Properties["TargetPathValue"].SetValue(tsk1, @"c:\temp\");
            tsk1.Properties["FileOverwriteAction"].SetValue(tsk1, 2); //OverwriteAll [2]


            /*
             Go to package file (*.dtsx) &gt; Open in Notepad &gt; and findout which properties set. Do same way (ignore some default proprties)
             Some enum properties needs numeric values &gt; Check Task / Component help file to findout number for that

      &lt;DTS:ObjectData&gt;
        &lt;SecureFtpTask
          StorageAction="DeleteFtpFile"
          FileOverwriteAction="OverwriteAll"
          TreatRegXForFullPath="False"
          ContinueOnError="False"
...................
...................
...................            
            PrefixTimestamp="False" /&gt;
      &lt;/DTS:ObjectData&gt;
    &lt;/DTS:Executable&gt;             
             */

            //Application.

            /* use below code to save to disk file 
            var app = new Microsoft.SqlServer.Dts.Runtime.Application();
            var filepath = @"c:\temp\demo.dtsx";
            app.SaveToXml(filepath, p, null);

            --load from disk to memory
            p = app.LoadPackage(filepath, null);

            */
            var status = p.Execute();

            if (status != DTSExecResult.Success)
            {
                var errs = "";
                foreach (var e in p.Errors)
                {
                    errs = errs + string.Format("Source={0}, Err={1}", e.Source, e.Description) + "\r\n";
                }

                throw new Exception("Package status was &gt;&gt; " + status + " &gt;&gt; " + errs);
            }

            Console.WriteLine("Execution Completed... Press any key to exit!!!");
            Console.ReadKey();
        }
        private static void Create_SSIS_Dataflow_Source_Component_Demo()
        {
            var p = new Microsoft.SqlServer.Dts.Runtime.Package();


            /*============ STEP-1: Create Dataflow Task =========== */

            var tsk1 = p.Executables.Add("STOCK:PipelineTask") as TaskHost;
            var dataFlowTask = tsk1.InnerObject as MainPipe;

            /*============ STEP-2: Create Connection =========== */
            var conn1 = p.Connections.Add("ZS-HTTP");
            conn1.Name = "MyConnection";
            conn1.ConnectionString = "Url=https://httpbin.org/get;CredentialType=Basic;UserName=test;Password=test123";


            /*============ STEP-3: Create Source =========== */
            var sourceComponent = dataFlowTask.ComponentMetaDataCollection.New();

            try
            {
                sourceComponent.ComponentClassID = "ZappySys.JsonSource";
                var sourceInstance = sourceComponent.Instantiate();
                sourceInstance.ProvideComponentProperties();

                sourceComponent.Name = "MySource";
                /**** Special Case for JSON Source - if user wants connection to use then we create Runtime connection. For all other components this is always created when ProvideComponentProperties() is called*/
                if (sourceComponent.RuntimeConnectionCollection.Count &lt;= 0)
                {
                    var dtsRuntimeConnection = sourceComponent.RuntimeConnectionCollection.New();
                    dtsRuntimeConnection.Name = "Connection"; 
                    //dtsRuntimeConnection.Description = "This can be ZS-HTTP, ZS-OAUTH or ZS-SALESFORCE";
                }
                sourceComponent.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(conn1);
                sourceComponent.RuntimeConnectionCollection[0].ConnectionManagerID = conn1.ID;

                sourceInstance.SetComponentProperty("UseConnection", true);//JsonSource specific -- for all other components connection always used
                sourceInstance.SetComponentProperty("DirectPath", "https://httpbin.org/basic-auth/test/test123");
                //sourceInstance.SetComponentProperty("Filter", "$.value[*]");

                //make connection active before next step
                sourceInstance.AcquireConnections(null);

                //after connection + props set ... call ReInitialize meta... it creates columns / output / input etc
                sourceInstance.ReinitializeMetaData(); 
            }
            catch (COMException ex)
            {
                throw new Exception("Error Happened ==&gt; " + sourceComponent.GetErrorDescription(ex.ErrorCode));
            }




            /*============ STEP-4: Create Target (without Reinitialize) =========== */

            var targetComponent = dataFlowTask.ComponentMetaDataCollection.New();
            CManagedComponentWrapper targetInstance=null;
            try
            {
                targetComponent.ComponentClassID = "ZappySys.TrashDestination";
                targetInstance = targetComponent.Instantiate();
                targetInstance.ProvideComponentProperties();

                targetComponent.Name = "MyDestination";

                targetInstance.SetComponentProperty("SaveDataToFile", true);
                targetInstance.SetComponentProperty("FilePath", @"c:\temp\dump.txt");
                targetInstance.SetComponentProperty("OverwriteFileIfExists", true);

                //--- Trash destination doesnt have connection but incase destination uses connection... set below way
                //if you have connection then set this way
                //var conn2 = p.Connections.Add("....."); //Creation name i.e. ZS-HTTP
                //conn2.Name = "MyConnection2";
                //conn3.ConnectionString = "Url=https://httpbin.org/get;CredentialType=Basic;UserName=test;Password=test123";
                //if (targetComponent.RuntimeConnectionCollection.Count &lt;= 0)
                //{
                //    var dtsRuntimeConnection = targetComponent.RuntimeConnectionCollection.New();
                //    dtsRuntimeConnection.Name = "Connection"; 
                //}
                //sourceComponent.RuntimeConnectionCollection[0].ConnectionManager = DtsConvert.GetExtendedInterface(conn2);
                //sourceComponent.RuntimeConnectionCollection[0].ConnectionManagerID = conn2.ID;
                //make connection active before next step
                //targetInstance.AcquireConnections(null);
            }
            catch (COMException ex)
            {
                throw new Exception("Error Happened ==&gt; " + targetComponent.GetErrorDescription(ex.ErrorCode));
            }

            /*============ STEP-5: Connect Source to Target =========== */

            //before we call reintializemetadata for dest .. lets attach src and dest so .. dest can use virtual inputs if needed
            var output = sourceComponent.OutputCollection[0]; //to make it simple lets pick first output but possible component can have more outputs
            var input = targetComponent.InputCollection[0];

            dataFlowTask.PathCollection.New().AttachPathAndPropagateNotifications(output, input);

            /*============ STEP-6: Configure Target =========== */
            try
            {
                //after connection + props set and source to target attached... call ReInitialize meta... it creates columns / output / input etc
                targetInstance.ReinitializeMetaData(); 
            }
            catch (COMException ex)
            {
                throw new Exception("Error Happened ==&gt; " + targetComponent.GetErrorDescription(ex.ErrorCode));
            }


            /*============ STEP-6: Save Package =========== */

            //* use below code to save to disk file 
            var app = new Microsoft.SqlServer.Dts.Runtime.Application();
            var filepath = @"c:\temp\demo.dtsx";
            app.SaveToXml(filepath, p, null);

            /*============ STEP-7: Load Package =========== */
            //--load from disk to memory
            p = app.LoadPackage(filepath, null);

            //*/

            /*============ STEP-8: Execute Package =========== */
            var status = p.Execute();

            /*============ STEP-9: Print execution status / log =========== */
            if (status != DTSExecResult.Success)
            {
                var errs = "";
                foreach (var e in p.Errors)
                {
                    errs = errs + string.Format("Source={0}, Err={1}", e.Source, e.Description) + "\r\n";
                }

                throw new Exception("Package status was &gt;&gt; " + status + " &gt;&gt; " + errs);
            }

            Console.WriteLine("Execution Completed... Press any key to exit!!!");
            Console.ReadKey();
        }

        private static void Create_SSIS_Variable_Demo()
        {
            var p = new Microsoft.SqlServer.Dts.Runtime.Package();
            
            p.Variables.Add("MyVariableName1", false, "User", "Some value");
        }

        private static void Create_SSIS_Connection_Demo()
        {
            var p = new Microsoft.SqlServer.Dts.Runtime.Package();

            var conn1 = p.Connections.Add("ZS-SFTP");
            conn1.Name = "MySftpConnection";
            conn1.ConnectionString = "Protocol=Sftp;ServerName=127.0.0.1;Port=0;LogonType=Normal;UserName=zstest;Password=zstest123";

        }

        private static void Create_SSIS_Connect_Tasks_Demo()
        {
            var p = new Microsoft.SqlServer.Dts.Runtime.Package();

            var SFTP_TASK = "ZappySys.SecureFtpTask";

            var tsk1 = p.Executables.Add(SFTP_TASK) as TaskHost;
            tsk1.Name = "SFTP_Task1";
            /*set some props - see Create_SSIS_Controlflow_Task_Demo */

            var tsk2 = p.Executables.Add(SFTP_TASK) as TaskHost;
            tsk2.Name = "SFTP_Task2";
            /*set some props - see Create_SSIS_Controlflow_Task_Demo */
            
            //add link between task1--&gt;task2
            var pc = p.PrecedenceConstraints.Add(tsk1, tsk2);
            pc.EvalOp = DTSPrecedenceEvalOp.Constraint;
            pc.Value = DTSExecResult.Success;
            pc.LogicalAnd = true; //only useful if multiple inputs coming and you want all previous steps to be Green vs Any One Green .. if its any use LogicalAnd=False

            //If you need to connect with expression use below
            //pc.EvalOp = DTSPrecedenceEvalOp.ExpressionAndConstraint;
            //pc.Expression = "@SomeVariable == true";
        }

       

     
    }
}</pre><p>
&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/create-ssis-package-programmatically-add-execute-connections-tasks/">How to create SSIS Package Programmatically (Add / Execute Tasks)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</title>
		<link>https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 13 Apr 2019 05:29:48 +0000</pubDate>
				<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[SSIS Excel Export Task]]></category>
		<category><![CDATA[SSIS JSON Export Task]]></category>
		<category><![CDATA[SSIS SFTP / FTP Connection]]></category>
		<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[SSIS XML Export Task]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftps]]></category>
		<category><![CDATA[json.xml]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6761</guid>

					<description><![CDATA[<p>Introduction In this blog post you will see how easy it is to load large amount of data from SQL Server to FTP/SFTP. SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip). For demo purpose we will use SQL Server as relational source but you can use same steps for any database engine [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/">SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3058 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" alt="" width="100" height="100" /></a>In this blog post you will see how easy it is to load large amount of data from SQL Server to FTP/SFTP. SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip).</p>
<p>For demo purpose we will use SQL Server as relational source but you can use same steps for any database engine such as Oracle, MySQL, DB2. In this post we will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV Task</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> to achieve desired integration with FTP/SFTP/FTPS with drag and drop approach. You can also export data to JSON or XML or Excel file to FTP/SFTP/FTPS using same techniques (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a>  or <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML Task</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/" target="_blank" rel="noopener">Export Excel Task</a> ).</p>
<p>Our goal is to achieve following things</p>
<ul>
<li>Extract large amount of data from SQL Server Table or Query and export to CSV files</li>
<li>Generate CSV files in compressed format (*.gz) to speedup upload</li>
<li>Split CSV files by row count</li>
<li>Upload data to FTP/SFTP/FTPS using highly parallel manner for maximum speed</li>
</ul>
<p>There are three different ways you can achieve data export to Secure FTP using SSIS.</p>
<ol>
<li><strong>Method-1 (Fastest)</strong>: Use two step process (First export SQL Server data to local files using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export Task</a> and then upload files to Secure FTP using  <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> )</li>
<li><strong>Method-2 (Slower)</strong>: Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export Task</a> with Secure FTP Connection as Target rather than save to Local files.</li>
<li><strong>Method-3 (Slower)</strong>: Use Data flow components like <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">Secure FTP CSV File Destination</a>  (for JSON / XML / EXCEL   use Method1 or Method2)</li>
</ol>
<p>Each method has its own advantage / disadvantage. If you prefer to upload / compress / split large amount of data then we recommend Method#1 (Two steps). If you have not very huge dataset then you can use Method#2 or Method#3. For Last method you can only use CSV export option (we don’t have JSON/ XML / EXCEL Destination for Secure FTP yet – we may add in future)</p>
<p><strong>Screenshot of SSIS Package</strong></p>
<div id="attachment_707" style="width: 835px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-707" class="size-full wp-image-707" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png" alt="Extract SQL Server Data to CSV files in SSIS (Bulk export) and compress/upload files to Amazon S3 (AWS Cloud)" width="825" height="430" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png 825w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3-300x156.png 300w" sizes="(max-width: 825px) 100vw, 825px" /></a><p id="caption-attachment-707" class="wp-caption-text">Extract SQL Server Data to CSV files in SSIS (Bulk export) Split / GZip Compress / upload files to FTP/SFTP/FTPS</p></div>
<h2><span id="Method-1_Upload_SQL_data_to_Azure_Blob_in_Two_steps">Method-1 : Upload SQL data to Secure FTP in Two steps</span></h2>
<p>In this section we will see first method (recommended) to upload SQL data to Secure FTP. This is the fastest approach if you have lots of data to upload.  In this approach we first create CSV files from SQL Server data on local disk using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">SSIS Export CSV Task</a>. After that in second step we upload all files to Secure FTP Storage using <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a>.</p>
<h3><span id="Step-1_Configure_Source_Connection_in_Export_CSV_Task">Step-1: Configure Source Connection in Export CSV Task</span></h3>
<p>To extract data from SQL Server you can use Export CSV Task. It has many options which makes it possible to split large amount of data into multiple files. You can specify single table or multiple tables as your data source.</p>
<p>For multiple table use vertical bar. e.g.  dbo.Customers|dbo.Products|dbo.Orders. When you export this it will create 3 files ( dbo.Customers.csv , dbo.Products.csv, dbo.Orders.csv )</p>
<p><strong>Steps:</strong></p>
<ol>
<li>Drag ZS Export CSV Task from Toolbox</li>
<li>Double click task to configure</li>
<li>From connection drop down select New connection option (OLEDB or ADO.net)</li>
<li>Once connection is configured for Source database specify SQL Query to extract data as below
<div id="attachment_705" style="width: 528px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-705" class="size-full wp-image-705" src="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png" alt="Export SQL Server Table or Query as CSV file (Bulk export in SSIS)" width="518" height="494" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png 518w, https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast-300x286.png 300w" sizes="(max-width: 518px) 100vw, 518px" /></a><p id="caption-attachment-705" class="wp-caption-text">Export SQL Server Table or Query as CSV file (Bulk export in SSIS)</p></div></li>
<li>Now go to target tab. Here you can specify full path for file. e.g. c:\ssis\temp\cust.csv</li>
</ol>
<h3><span id="Step-2_Compress_CSV_Files_in_SSIS_GZIP_format_8211_gz">Step-2: Compress CSV Files in SSIS ( GZIP format – *.gz )</span></h3>
<p>Above steps will export file as CSV format without splitting or compression. But to compress file once exported you can go to Target tab of Export CSV Task and check [<strong>Compress file to *.gz format</strong>] option.</p>
<div id="attachment_706" style="width: 579px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-706" class="size-full wp-image-706" src="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png" alt="Compress exported SQL Server data files to GZip ( *.gz) in SSIS Export CSV Task" width="569" height="462" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png 569w, https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis-300x244.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></a><p id="caption-attachment-706" class="wp-caption-text">Compress exported SQL Server data files to GZip ( *.gz) in SSIS Export CSV Task</p></div>
<h3><span id="Step-3_Split_CSV_files_by_row_count_or_data_size_in_SSIS">Step-3: Split CSV files by row count or data size in SSIS</span></h3>
<p>Now lets look at how to split exported CSV files into multiple files so we can upload many files in parallel. Goto Split Options and check [<strong>Enable Split by Size/Rows</strong>]
<div id="attachment_708" style="width: 435px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-708" class="size-full wp-image-708" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png" alt="Using SSIS Split Exported CSV files (Split by row count or size)" width="425" height="489" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png 425w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data-261x300.png 261w" sizes="(max-width: 425px) 100vw, 425px" /></a><p id="caption-attachment-708" class="wp-caption-text">Using SSIS Split Exported CSV files (Split by row count or size)</p></div>
<h3><span id="Step-4_Upload_CSV_files_to_Azure_Blob_8211_Using_multi_threaded_option">Step-4: Upload CSV files to Secure FTP – Using multi threaded option</span></h3>
<p>Now final thing is use <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> to upload files to Secure FTP.</p>
<p><strong>Steps:</strong></p>
<ol>
<li>Drag ZS Secure FTP Task (SFTP, FTP, FTPS) from SSIS toolbox</li>
<li>Double click ZS Secure FTP Task (SFTP, FTP, FTPS) to configure it</li>
<li>Specify Action = Upload Files To FTP Server</li>
<li>Specify Source file path (or pattern) e.g. c:\SSIS\temp\*.*</li>
<li>Now in the Target connection dropdown click [New]</li>
<li>When Connection UI opens Enter your Account, Secret Key (Leave all other parameters default if you not sure)</li>
<li>Click Test and close connection UI</li>
<li>On the Target path on ZS Secure FTP Task (SFTP, FTP, FTPS) enter your bucket and folder path where you want to upload local files. (For example: <strong>/datafolder/sqldata/)</strong></li>
<li>Click ok and Run package to test full package</li>
</ol>
<h2><span id="Method-2_Upload_SQL_data_to_Azure_Blob_without_local_stage_One_step">Method-2 : Upload SQL data to Secure FTP without local stage (One step)</span></h2>
<p>Now let’s change previous approach little bit to send SQL server data directly to FTP/SFTP/FTPS without any Landing area on local disk.  <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV Task</a> , <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> , <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/" target="_blank" rel="noopener">Export Excel Task</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML Task</a> all of them supports Azure Blob / Amazon S3 and Secure FTP (SFTP) connection as target (Only available in <strong>Pro Edition</strong>). We will use this feature in following section.</p>
<p>This approach helps to avoid any local disk need and it may be useful for security reason for some users. However drawback of this approach is, it wont use parallel threads to upload large amount of data like previous method.</p>
<p>Following change will be needed on Export task to upload SQL data directly to Azure / FTP or Amazon storage.</p>
<div id="attachment_5252" style="width: 859px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5252" class="size-full wp-image-5252" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png" alt="Export SQL data to multiple files to Amazon S3, Azure, Secure FTP (SFTP) in Stream Mode. Compress GZip, Overwrite, Split Options" width="849" height="627" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png 849w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip-300x222.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip-768x567.png 768w" sizes="(max-width: 849px) 100vw, 849px" /></a><p id="caption-attachment-5252" class="wp-caption-text">Export SQL data to multiple files to Amazon S3, Azure Blob, Secure FTP (SFTP) in Stream Mode. Compress GZip, Overwrite, Split Options</p></div>
<h2><span id="Method-3_Using_Azure_Blob_destination_8211_Generate_Azure_Blob_file_from_any_source">Method-3 : Using Secure FTP CSV File Destination – Generate Secure FTP file from any source</span></h2>
<p>Now let’s look at third approach to save data from any SSIS Source to FTP/SFTP/FTPS file. Advantage of this approach is you are not limited to few source options provided by Export CSV Task. If you have complex data transformation needed in Data Flow before sending data to FTP/SFTP/FTPS then use this approach.  We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">Secure FTP CSV File Destination</a> as below</p>
<ol>
<li>Drag SSIS Data flow task from toolbox<a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-7934" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>Create necessary source connection (e.g. OLEDB connection)</li>
<li>Create Secure FTP Connection (Right click in Connection Managers panel in bottom and click New connection and select <strong>ZS-SFTP</strong> type )</li>
<li>Once connection managers are created Go to data flow designer and Drag OLEDB Source</li>
<li>Configure OLEDB Source to read desired data from source system (e.g. SQL Server / Oracle)</li>
<li>Once source is configured drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">ZS Secure FTP CSV File Destination</a> from SSIS toolbox</li>
<li>Double click Secure FTP CSV File Destination and configure as below
<ol>
<li>On Connection Managers tab select Secure FTP Connection (We created in earlier section).</li>
<li>Properties tab configure like below screenshot</li>
<li>On Input Columns tab select desired column you like to write in the target file. Your name from upstream will be taken as is for target file. So make sure to name upstream columns correctly.</li>
<li>Click OK to save UI</li>
</ol>
</li>
<li>Execute package and check your Secure FTP to see files got created.
<div id="attachment_5253" style="width: 729px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5253" class="size-full wp-image-5253" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png" alt="Loading SQL Server data into S3 Bucket Files (Split, Compress Gzip Options) - SSIS Amazon S3 CSV File Destination" width="719" height="782" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png 719w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options-276x300.png 276w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-5253" class="wp-caption-text">Loading SQL Server data into Secure FTP Files (Split, Compress Gzip Options) &#8211; SSIS Secure Ftp CSV File Destination</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this post you have seen how easy it is to upload / archive your SQL Server data (or any other RDBMS data) to FTP/SFTP/FTPS in few clicks. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack</a> for free and find out yourself how easy it is to integrate SQL Server and Secure FTP using SSIS.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/">SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read SFTP / FTP Files in SSIS (CSV, JSON, XML)</title>
		<link>https://zappysys.com/blog/read-sftp-ftp-files-ssis-csv-json-xml/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 23 Mar 2019 08:54:48 +0000</pubDate>
				<category><![CDATA[SSIS SFTP / FTP Connection]]></category>
		<category><![CDATA[SSIS SFTP CSV Source]]></category>
		<category><![CDATA[SSIS SFTP JSON Source]]></category>
		<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[SSIS SFTP XML Source]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftps]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6632</guid>

					<description><![CDATA[<p>Introduction In our previous blog, we saw how to perform SFTP / FTP File Operations in SSIS. Now in this blog, we will see How to Read SFTP / FTP Files in SSIS (CSV, JSON, XML Format files). To illustrate, we will use ZappySys SSIS PowerPack, which includes several tasks to import/export data from multiples sources [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-sftp-ftp-files-ssis-csv-json-xml/">Read SFTP / FTP Files in SSIS (CSV, JSON, XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3058 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" alt="" width="100" height="100" /></a>In our previous blog, we saw <a href="https://zappysys.com/blog/ssis-sftp-task-examples-upload-download-move-delete-files-folders/" target="_blank" rel="noopener">how to perform SFTP / FTP File Operations in SSIS</a>. Now in this blog, we will see <strong>How to Read SFTP / FTP Files in SSIS (CSV, JSON, XML Format files)</strong>. To illustrate, we will use <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a>, which includes several tasks to import/export data from multiples sources to multiple destinations like flat files, Azure, AWS, databases, Office files and more. They are Coding free, drag and drop high-performance suite of <em>Custom SSIS Components</em> and <em>SSIS Tasks.</em> If you like to perform file operations on FTP Files (e.g. Download, Upload, Create, Delete) then <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-sftp-task/" target="_blank" rel="noopener">check these articles</a>.</p>
<p>In nutshell, this post will focus on how to Read files from secure FTP Storage (CSV, JSON and XML Files) and load into SQL Server Table in few clicks.</p>
<p><strong>Components Mentioned in this article</strong><br />
<div class="su-table su-table-alternate">
<table style="width: 407px;height: 187px">
<tbody>
<tr>
<td style="width: 32.3864px"><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/secure-ftp-json-source/ssis-secure-ftp-json-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 CSV File Source" width="32" height="32" /></td>
<td style="width: 358.75px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-json-file-source/" target="_blank" rel="noopener">Secure FTP Source for JSON File</a></td>
</tr>
<tr>
<td style="width: 32.3864px"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/secure-ftp-xml-source/ssis-secure-ftp-xml-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 CSV File Destination" width="32" height="32" /></td>
<td style="width: 358.75px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-xml-file-source/" target="_blank" rel="noopener">Secure FTP Source for XML File</a></td>
</tr>
<tr>
<td style="width: 32.3864px"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/secure-ftp-csv-source/ssis-secure-ftp-csv-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 XML File Source" width="32" height="32" /></td>
<td style="width: 358.75px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-source/" target="_blank" rel="noopener">Secure FTP Source for CSV File</a></td>
</tr>
<tr>
<td style="width: 32.3864px"><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/secure-ftp-csv-destination/ssis-secure-ftp-csv-file-destination.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 JSON File Source" width="32" height="32" /></td>
<td style="width: 358.75px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">Secure FTP Destination for CSV File</a><br />
<b></b></td>
</tr>
</tbody>
</table>
</div>
<h2>Prerequisite</h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>You have obtained FTP/SFTP Credential.</li>
<li>Finally, do not forget to install ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
</ol>
<h2><span id="Whats_is_FTP_FTPS_SFTP_FTPSSL">What is FTP, FTPS, SFTP, FTP/SSL?</span></h2>
<p>Many people still have confusion over various protocols around FTP terminology. Most common terms you hear are as below.</p>
<ul>
<li>FTP</li>
<li>Classic FTP</li>
<li>Secure FTP</li>
<li>SFTP</li>
<li>FTPS</li>
<li>FTP/SSL</li>
<li>FTP over SSL</li>
<li>FTP Over SSH</li>
</ul>
<p>You must be overwhelmed by now? So are they all same or different? See below for quick clarification in nutshell.</p>
<p>Mainly there are 2 protocols for FTP and yes they are very different but still used to do Files Transfer to/from the remote server.</p>
<ol>
<li><strong>Classic FTP</strong> – sometimes referred as just <strong>FTP</strong> (Typically server runs on Port 21)</li>
<li><strong>SFTP</strong> – Sometimes referred as <strong>Secure FTP</strong> or <strong>FTP over SSH</strong> (Typically server runs on Port 22)</li>
</ol>
<p>So in short SFTP is not the same as the Classic FTP protocol. SFTP is more secure because traffic is always encrypted. On the other hand, Classic FTP is not encrypted by default but you can use <strong>FTP over SSL</strong> to request encrypted traffic in classic FTP. <strong>FTP over SSL</strong> also referred to as <strong>FTPS or FTP/SSL</strong>.</p>
<h2>Getting Started</h2>
<p>In order to start, we will show several examples. ZappySys includes an <a href="https://zappysys.com/products/ssis-powerpack/#cat_secure_ftp" target="_blank" rel="noopener">SSIS Secure FTP Source for CSV/JSON/XML File</a> that will help you in reading CSV, JSON and XML Files from FTP to the Local machine, Upload files(s) to FTP Storage. It will also support Delete, Rename, List, Get Property, Copy, Move, Create, Set Permission … and many more operations. Here we are showing you is, How to download files from FTP Storage.</p>
<p>You can connect to your FTP by entering your FTP credentials.</p>
<h2>Read SFTP / FTP Files in SSIS (CSV, JSON, XML)</h2>
<p>Let´s start with an example. First of all, In this SSIS FTP Source for CSV/JSON/XML File task example, we will read CSV/JSON/XML files from FTP to SQL Server database.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Now drag and drop relevant Secure FTP for CSV/JSON/XML File Task from the SSIS Toolbox.
<div id="attachment_6635" style="width: 1118px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6635" class="wp-image-6635 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source.png" alt="Drag and Drop FTP Source" width="1108" height="473" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source.png 1108w, https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source-300x128.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source-768x328.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/03/Drag-and-drop-FTP-source-1024x437.png 1024w" sizes="(max-width: 1108px) 100vw, 1108px" /></a><p id="caption-attachment-6635" class="wp-caption-text">Drag and Drop FTP</p></div></li>
<li>Create a connection for Secure FTP Account.
<div id="attachment_6636" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6636" class="wp-image-6636 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection-768x514.png" alt="Create FTP Connection" width="720" height="482" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection-768x514.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection-300x201.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection-272x182.png 272w, https://zappysys.com/blog/wp-content/uploads/2019/03/create-ftp-connection.png 1022w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-6636" class="wp-caption-text">Create FTP Connection</p></div></li>
<li>Likewise, select the relevant single file to read from FTP in their relevant source of CSV/JSON/XML File Task.
<div id="attachment_6539" style="width: 944px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6539" class="wp-image-6539 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File.png" alt="Select File From Azure Blob Storage" width="934" height="582" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File.png 934w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File-300x187.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File-768x479.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-select-File-436x272.png 436w" sizes="(max-width: 934px) 100vw, 934px" /></a><p id="caption-attachment-6539" class="wp-caption-text">Select File From FTP Storage</p></div></li>
<li>Similarly, we can also read the multiple files stored in FTP Storage using wildcard pattern supported e.g. dbo.tblNames*.csv / dbo.tblNames*.json / dbo.tblNames*.xml in relevant source task
<div id="attachment_6540" style="width: 557px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-set-multiple-Filepath.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6540" class="wp-image-6540 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-set-multiple-Filepath.png" alt="Use wildcard pattern .* to read multiple files data" width="547" height="178" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-set-multiple-Filepath.png 547w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-Azure-Blob-Source-set-multiple-Filepath-300x98.png 300w" sizes="(max-width: 547px) 100vw, 547px" /></a><p id="caption-attachment-6540" class="wp-caption-text">Use wildcard pattern .* to read multiple files data</p></div></li>
<li>We can also read the zip and gzip compressed files also without extracting it in the specific FTP Storage for CSV/JSON/XML File Task.
<div id="attachment_6541" style="width: 698px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-azure-blob-storage-source-read-zip-gzip-compressed-files.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6541" class="wp-image-6541 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-azure-blob-storage-source-read-zip-gzip-compressed-files.png" alt="Reading zip and gzip compressed files (stream mode)" width="688" height="273" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-azure-blob-storage-source-read-zip-gzip-compressed-files.png 688w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-azure-blob-storage-source-read-zip-gzip-compressed-files-300x119.png 300w" sizes="(max-width: 688px) 100vw, 688px" /></a><p id="caption-attachment-6541" class="wp-caption-text">Reading zip and gzip compressed files (stream mode)</p></div></li>
<li>Finally, we are ready to load this file(s) data into the SQL Server.</li>
</ol>
<h2>Load Secure FTP files data into SQL Server</h2>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>Above all, in this blog, we learned how to Read Secure FTP Storage Files in SSIS. Even more, we used <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-source/" target="_blank" rel="noopener">Secure FTP Source for CSV File</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-json-file-source/" target="_blank" rel="noopener">Secure FTP Source for JSON File</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-xml-file-source/" target="_blank" rel="noopener">Secure FTP Source for XML File</a> to read the file(s) from FTP Storage and load data into SQL server. You can <a href="https://zappysys.com/products/ssis-powerpack/">download SSIS PowerPack here</a> to try many other scenarios not discussed in this blog along with 70+ other components.</p>
<h2><span id="References">References</span></h2>
<p>Finally, You can use the following links for more information:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/#cat_secure_ftp" target="_blank" rel="noopener">SSIS Secure FTP Source for CSV/JSON/XML File</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/">About SSIS PowerPack</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/">About Secure FTP Task</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-sftp-ftp-files-ssis-csv-json-xml/">Read SFTP / FTP Files in SSIS (CSV, JSON, XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Download latest File from FTP using SSIS (SFTP / FTPS)</title>
		<link>https://zappysys.com/blog/download-latest-file-from-ftp-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 01 Dec 2018 10:47:56 +0000</pubDate>
				<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftps]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[SSIS Script Task]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5490</guid>

					<description><![CDATA[<p>Introduction In this blog, we will learn how to Download Latest File from FTP using SSIS Secure FTP Task, We also learn how to connect with FTP/SFTP and also see how to Get Latest File list in ADO.net DataTable variable and How to sort ADO.net DataTable and get and set latest FTP File Path in a variable [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/download-latest-file-from-ftp-using-ssis/">Download latest File from FTP using SSIS (SFTP / FTPS)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-using-zs-sftp-task-1.png"><img loading="lazy" decoding="async" class="alignleft wp-image-5517 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-using-zs-sftp-task-1-150x150.png" alt="Download Latest File from FTP using SSIS" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-using-zs-sftp-task-1-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-using-zs-sftp-task-1.png 293w" sizes="(max-width: 150px) 100vw, 150px" /></a></p>
<p>In this blog, we will learn how to <strong>Download Latest File from FTP using SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/">Secure FTP Task</a></strong>, We also learn how to connect with FTP/SFTP and also see how to Get Latest File list in ADO.net DataTable variable and How to sort ADO.net DataTable and get and set latest FTP File Path in a variable using Script Task.</p>
<p>We also learn how to get and set variables and how to use it in SSIS Script Task and Secure FTP Task.</p>
<div style="clear: both;"><div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div></div>
<h2></h2>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Also, make sure to have SSDT</li>
<li>Make sure to have installed <a href="https://zappysys.com/products/ssis-powerpack/">ZappySys SSIS PowerPack</a>.</li>
</ol>
<h2><span id="Whats_is_FTP_FTPS_SFTP_FTPSSL">What is FTP, FTPS, SFTP, FTP/SSL?</span></h2>
<p>Many people still have confusion over various protocols around FTP terminology. Most common terms you hear are as below.</p>
<ul>
<li>FTP</li>
<li>Classic FTP</li>
<li>Secure FTP</li>
<li>SFTP</li>
<li>FTPS</li>
<li>FTP/SSL</li>
<li>FTP over SSL</li>
<li>FTP Over SSH</li>
</ul>
<p>You must be overwhelmed by now? So are they all same or different? See below for quick clarification in nutshell.</p>
<p>Mainly there are 2 protocols for FTP and yes they are very different but still used to do Files Transfer to/from the remote server.</p>
<ol>
<li><strong>Classic FTP</strong> – sometimes referred as just <strong>FTP</strong> (Typically server runs on Port 21)</li>
<li><strong>SFTP</strong> – Sometimes referred as <strong>Secure FTP</strong> or <strong>FTP over SSH</strong> (Typically server runs on Port 22)</li>
</ol>
<p>So in short SFTP is not the same as the Classic FTP protocol. SFTP is more secure because traffic is always encrypted. On the other hand, Classic FTP is not encrypted by default but you can use <strong>FTP over SSL</strong> to request encrypted traffic in classic FTP. <strong>FTP over SSL</strong> also referred as <strong>FTPS or FTP/SSL</strong>.</p>
<h2></h2>
<h2>Getting Started</h2>
<p>In order to start, we will show several examples. ZappySys includes an SSIS &#8211; <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/">Secure FTP Task</a> that will help you Download Latest File From FTP/SFTP, get file list in ADO.net DataTable variable and do many more actions using SSIS Script Task.</p>
<p>In this example, we will show 3 examples.</p>
<ol>
<li>First, we will show how to get FTP File List as ADO.net DataTable in a variable using <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/"><strong>SSIS &#8211; Secure FTP Task</strong></a>.</li>
<li>Secondly, we will show how to sort ADO.net DataTable and get latest FTP File Path in a variable using <strong>Script Task</strong>.</li>
<li>Third, we will Download Latest File from FTP using SSIS <strong><a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/">Secure FTP Task</a> </strong>using that latest file path variable.</li>
</ol>
<h3><span id="1_Example_to_get_values_from_JSON_into_variables" style="font-size: 12pt;">Get FTP File List as ADO.net DataTable in a variable using SSIS Secure FTP Task</span></h3>
<p>Follow these steps to accomplish the task:</p>
<ol>
<li>Drag and drop <strong>Secure FTP Task</strong> the design panel and rename it as &#8220;Get File List as ADOnet DataTable&#8221; if you want to.</li>
</ol>
<div id="attachment_2780" class="wp-caption aligncenter">
<div id="attachment_5494" style="width: 719px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/drag-drop-ZS-SFTP-Task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5494" class="wp-image-5494 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/drag-drop-ZS-SFTP-Task.png" alt="ADD SSIS - ZS SECURE FTP TASK" width="709" height="460" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/drag-drop-ZS-SFTP-Task.png 709w, https://zappysys.com/blog/wp-content/uploads/2018/12/drag-drop-ZS-SFTP-Task-300x195.png 300w" sizes="(max-width: 709px) 100vw, 709px" /></a><p id="caption-attachment-5494" class="wp-caption-text">ADD SSIS &#8211; ZS SECURE FTP TASK</p></div>
</div>
<div></div>
<div></div>
<div style="padding-left: 30px;">2. Now Edit the FTP Task from the package design panel to Connect with your FTP/SFTP. Follow the steps mentioned in the below screen.</div>
<div></div>
<div style="padding-left: 60px;">
<div id="attachment_5495" style="width: 1260px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5495" class="wp-image-5495 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection.png" alt="Connect with FTP/SFTP using SSIS" width="1250" height="704" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection.png 1250w, https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection-300x169.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection-768x433.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/connect-sftp-server-and-test-connection-1024x577.png 1024w" sizes="(max-width: 1250px) 100vw, 1250px" /></a><p id="caption-attachment-5495" class="wp-caption-text">Connect with FTP/SFTP</p></div>
</div>
<div></div>
<div style="padding-left: 30px;">3. After successfully connected with FTP/SFTP we have to enter FTP path from where we have to get the file list and set it into result variable.</div>
<div></div>
<div style="padding-left: 60px;">
<div id="attachment_5497" style="width: 1156px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5497" class="wp-image-5497 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1.png" alt="SSIS - Get Latest file list from FTP to ADO.net table in the variable" width="1146" height="665" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1.png 1146w, https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1-300x174.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1-768x446.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/set-ftp-path-and-result-variable-1-1024x594.png 1024w" sizes="(max-width: 1146px) 100vw, 1146px" /></a><p id="caption-attachment-5497" class="wp-caption-text">Get Latest file list from FTP to ADO.net table in a variable</p></div>
</div>
<div></div>
<div></div>
<div style="padding-left: 30px;">4. Now let&#8217;s check what ADO.net DataTable columns name and ordinal.</div>
<div></div>
<div style="padding-left: 60px;">
<div id="attachment_5498" style="width: 1271px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5498" class="wp-image-5498 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list.png" alt="SSIS - Set Latest ADO.net DataTable Variable" width="1261" height="673" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list.png 1261w, https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list-300x160.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list-768x410.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/see-adonet-data-table-columns-list-1024x547.png 1024w" sizes="(max-width: 1261px) 100vw, 1261px" /></a><p id="caption-attachment-5498" class="wp-caption-text">Set Latest ADO.net DataTable Variable</p></div>
</div>
<div></div>
<div style="padding-left: 60px;">5. That&#8217;s it we have successfully completed our first task. Let&#8217;s move on next step.</div>
<div></div>
<div>
<h3><span id="1_Example_to_get_values_from_JSON_into_variables" style="font-size: 12pt;">Get latest FTP File Path in a variable using Script Task</span></h3>
<p>Follow these steps to accomplish the task:</p>
<p style="padding-left: 30px;">1. Drag and drop <strong>SSIS Script Task</strong> the design panel and link it with the ZS SFTP Task.</p>
<div id="attachment_5499" style="width: 259px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-add-script-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5499" class="wp-image-5499 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-add-script-task.png" alt="Add SSIS - Script Task" width="249" height="145" /></a><p id="caption-attachment-5499" class="wp-caption-text">Add SSIS &#8211; Script Task</p></div>
<p>&nbsp;</p>
<p style="padding-left: 30px;">2. Before proceeding with Script Task let&#8217;s add one new SSIS variables first that will store the Latest FTP File Path.</p>
</div>
<div id="attachment_5501" style="width: 1332px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5501" class="wp-image-5501 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package.png" alt="Add SSIS Latest File Variable" width="1322" height="754" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package.png 1322w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package-300x171.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package-768x438.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/add-new-latest-file-variable-in-package-1024x584.png 1024w" sizes="(max-width: 1322px) 100vw, 1322px" /></a><p id="caption-attachment-5501" class="wp-caption-text">Add Latest File Variable</p></div>
<p>&nbsp;</p>
<p style="padding-left: 30px;">3. Now edit Script Task and add User::v_dtFileLists and User::v_LatestFilePath to ReadOnly/ReadWrite variable lists:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-7479" src="https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-from-ftp-configure-script-task.png" alt="" width="737" height="320" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-from-ftp-configure-script-task.png 737w, https://zappysys.com/blog/wp-content/uploads/2018/12/download-latest-file-from-ftp-configure-script-task-300x130.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></p>
<p style="padding-left: 30px;">4. Then proceed and press &#8220;Edit Script&#8221; button to edit the code the Script Task &#8212; it will open the &#8220;ScriptMain.cs&#8221; C# file for you in new VS Project. And Write The Following Code in it.</p>
<pre class="crayon-plain-tag">DataTable dt = (DataTable)Dts.Variables["User::v_dtFileLists"].Value;

DataView dv = dt.DefaultView;
dv.Sort = "CreationTime desc";
DataTable sortedDT = dv.ToTable();
if (sortedDT.Rows.Count &gt; 0)
{
	Dts.Variables["User::v_LatestFilePath"].Value = sortedDT.Rows[0][0].ToString();
}
dt=null;
dv = null;
sortedDT = null;</pre>
<div id="attachment_5502" style="width: 893px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/sort-data-table-and-get-latest-file-path.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5502" class="wp-image-5502 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/sort-data-table-and-get-latest-file-path.png" alt="SSIS - Get Latest File Path in Variable" width="883" height="720" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/sort-data-table-and-get-latest-file-path.png 883w, https://zappysys.com/blog/wp-content/uploads/2018/12/sort-data-table-and-get-latest-file-path-300x245.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/sort-data-table-and-get-latest-file-path-768x626.png 768w" sizes="(max-width: 883px) 100vw, 883px" /></a><p id="caption-attachment-5502" class="wp-caption-text">Get Latest File Path in Variable</p></div>
<p>&nbsp;</p>
<p style="padding-left: 30px;">5. Click Ok In &#8220;Script Task&#8221; And it will save and close the &#8220;ScriptMain.cs&#8221; Task.</p>
<p style="padding-left: 30px;">6. That&#8217;s it we have successfully completed our second task. Let&#8217;s move on next step.</p>
<h3><span style="font-size: 12pt;">Download Latest File from FTP using the latest file path variable</span></h3>
<p>Follow these steps to accomplish the task:</p>
<p style="padding-left: 30px;">1. Drag and drop <strong>ZS</strong> <strong>Secure FTP Task</strong> the design panel and link it with Script Task.</p>
<div id="attachment_5506" style="width: 258px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-add-SFTP.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5506" class="wp-image-5506 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-add-SFTP.png" alt="Add SSIS - ZS Secure FTP Task" width="248" height="220" /></a><p id="caption-attachment-5506" class="wp-caption-text">Add SSIS &#8211; ZS Secure FTP Task</p></div>
<p>&nbsp;</p>
<p style="padding-left: 30px;">2. Let&#8217;s use that latest file variable and FTP Connection to download the latest file in the local folder. Follow the mentioned steps of the below screen.</p>
<div id="attachment_5507" style="width: 684px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-download-latestfile-using-variable-in-SFTP.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5507" class="wp-image-5507 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-download-latestfile-using-variable-in-SFTP.png" alt="Download Latest File using variable using SSIS -Secure FTP Task" width="674" height="655" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-download-latestfile-using-variable-in-SFTP.png 674w, https://zappysys.com/blog/wp-content/uploads/2018/12/blob-dlf-download-latestfile-using-variable-in-SFTP-300x292.png 300w" sizes="(max-width: 674px) 100vw, 674px" /></a><p id="caption-attachment-5507" class="wp-caption-text">Download Latest File using variable using SSIS -Secure FTP Task</p></div>
<p style="padding-left: 30px;">3. Click OK to close Secure FTP TASK UI.</p>
<p>Finally, run the package and you will be able to see the latest file downloaded on your local folder from the FTP/SFTP.</p>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>To conclude, we can say that working with FTP/SFTP is now very simple. In this article, we looked at SSIS SFTP task examples on how to Download latest File from FTP using SSIS in the local folder. We also learned how to Sort ADO.net DataTable and Set latest file path in the variable using <strong>SSIS Script Task</strong>.  We used variables, expressions, and SSIS Script Task. If you liked the tasks you can start using them by downloading SSIS PowerPack from our <a href="https://zappysys.com/products/ssis-powerpack/">website here</a>.</p>
<h2><span id="References">References</span></h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/">About SSIS PowerPack</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/">About Secure FTP Task</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/control-flow/script-task?view=sql-server-2017">SISS Script Task</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/integration-services-ssis-variables?view=sql-server-2017">About SSIS Variables</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/download-latest-file-from-ftp-using-ssis/">Download latest File from FTP using SSIS (SFTP / FTPS)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS SFTP task examples to upload, download, move and delete files / folders</title>
		<link>https://zappysys.com/blog/ssis-sftp-task-examples-upload-download-move-delete-files-folders/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 12 Mar 2018 21:45:40 +0000</pubDate>
				<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftps]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[Task]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2981</guid>

					<description><![CDATA[<p>Introduction &#8211; Using SSIS SFTP task (FTP, SFTP, FTPS) In this article, we will show SSIS SFTP task examples. This task supports multiple protocols (Classic FTP, SFTP, FTPS). Uploading files using SFTP or downloading files are common requirements in SSIS. In order to work with FTP, Microsoft SSIS includes the FTP Task that allows to [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-sftp-task-examples-upload-download-move-delete-files-folders/">SSIS SFTP task examples to upload, download, move and delete files / folders</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction &#8211; Using SSIS SFTP task (FTP, SFTP, FTPS)</h2>
<p><img loading="lazy" decoding="async" class="size-full alignleft" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/sftp-task/ssis-sftp-ftp-ftps-task.png" width="128" height="128" />In this article, we will show <strong>SSIS SFTP task examples</strong>. This task supports multiple protocols (Classic FTP, SFTP, FTPS).</p>
<p>Uploading files using SFTP or downloading files are common requirements in SSIS. In order to work with FTP, Microsoft SSIS includes the FTP Task that allows to upload files to FTP, download files, creating local and remote directories an more. However, there is no native task to work with SFTP. Also Native FTP task doesn&#8217;t support many advanced options such as FTP over SSL (i.e. FTPS).  In this article, we will show how to use the <a href="//zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">SSIS SFTP task</a> included in ZappySys <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a>.</p>
<p>ZappySys SFTP Task will let you send files to SFTP/FTP/FTPS server, receive files from SFTP/FTP/FTPS server. With ZappySys SFTP Task, you can not only create/delete files and folders on ftp server but also get file properties (creation date, last modified, last read dates, size and more), verify if the files exist, rename and move files and more.</p>
<h2></h2>
<h2>SSIS SFTP Task Video Tutorial</h2>
<p>The following video shows a nice tutorial about a ZappySys SSIS SFTP Task with examples:</p>
<div class="su-youtube su-u-responsive-media-yes"><iframe loading="lazy" width="600" height="400" src="https://www.youtube.com/embed/qZfA3OpnlAw?" frameborder="0" allowfullscreen allow="autoplay; encrypted-media; picture-in-picture" title=""></iframe></div>
<h2>Requirements</h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Also, make sure to have SSDT</li>
<li>Finally, do not forget to install ZappySys <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a></li>
</ol>
<h2>Whats is FTP, FTPS, SFTP, FTP/SSL?</h2>
<p>Many people still have confusion over various protocols around FTP terminology. Most common terms you hear are as below.</p>
<ul>
<li>FTP</li>
<li>Classic FTP</li>
<li>Secure FTP</li>
<li>SFTP</li>
<li>FTPS</li>
<li>FTP/SSL</li>
<li>FTP over SSL</li>
<li>FTP Over SSH</li>
</ul>
<p>You must be overwhelmed by now 🙂 &#8230; So are they all same or different? See below for quick clarification in nutshell.</p>
<p>Mainly there are 2 protocols for FTP and yes they are very different but still used to do Files Transfer to / from remote server.</p>
<ol>
<li><strong>Classic FTP</strong> &#8211; sometimes referred as just <strong>FTP</strong> (Typically server runs on Port 21)</li>
<li><strong>SFTP</strong> &#8211; Sometimes referred as <strong>Secure FTP</strong> or <strong>FTP over SSH</strong> (Typically server runs on Port 22)</li>
</ol>
<p>So in short SFTP is not same as Classic FTP protocol. SFTP is more secure because traffic is always encrypted. On the other hand Classic FTP is not encrypted by default but you can use <strong>FTP over SSL</strong> to request encrypted traffic in classic FTP. <strong>FTP over SSL</strong> also referred as <strong>FTPS or FTP/SSL</strong>.</p>
<h2>Getting Started</h2>
<p>In order to start, we will show several examples. ZappySys includes an SSIS SFTP task that will allow to work with SFTP, FTP or even FTPS. Let´s start with an example. In this SSIS SFTP task example, we will show how to download files from SFTP to local folders.</p>
<ol>
<li>First, in a new SSIS project, drag and drop the <strong>ZS Secure FTP Task. </strong>This task will let you send and receive files in FTP:
<div id="attachment_2986" style="width: 696px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-FTP-SSIS-Task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2986" class="size-full wp-image-2986" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-FTP-SSIS-Task.png" alt="Drag and drop FTPS task" width="686" height="386" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-FTP-SSIS-Task.png 686w, https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-FTP-SSIS-Task-300x169.png 300w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-2986" class="wp-caption-text">Using SSIS SFTP Task in the control Flow Designer</p></div></li>
<li>Secondly, double click the <strong>ZS Secure FTP Task </strong>and select the <strong>Download FTP server file(s) to local directory. </strong>This option will download files. In Path AccessMode we can use <strong>Direct </strong>to write the path directly or to use an SSIS variable. In path, you can use &#8220;<strong>/ &#8221; </strong>to specify the root folder <strong>/source </strong>would be a folder named source in the root. If there were another folder inside source named child1, the path would be <strong>/source/child1</strong>.  There is a nice option that you can check to include folders and child folders. If you need to include them, check the option <strong>Recursive scan. </strong>In target, the tab can be written directly (<strong>direct)</strong> and using SSIS variables. The variables will be explained later. In path you specify the path of the target. You can throw an exception if there is a need to overwrite files and folders. Finally, in Connection, press <strong>New</strong> button to create a new connection:
<div id="attachment_2987" style="width: 692px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-source-ssis-sftp-send-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2987" class="size-full wp-image-2987" src="https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-source-ssis-sftp-send-files.png" alt="Download ftps files" width="682" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-source-ssis-sftp-send-files.png 682w, https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-source-ssis-sftp-send-files-300x269.png 300w" sizes="(max-width: 682px) 100vw, 682px" /></a><p id="caption-attachment-2987" class="wp-caption-text">SSIS Secure FTP Task &#8211; Download files from FTP / SFTP Server</p></div></li>
<li>The following options are available in SSIS Secure FTP Task:
<div id="attachment_3026" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/storage-action-ssis-ftps-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3026" class="size-full wp-image-3026" src="https://zappysys.com/blog/wp-content/uploads/2018/03/storage-action-ssis-ftps-task.png" alt="SSIS upload and download actions" width="680" height="474" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/storage-action-ssis-ftps-task.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/03/storage-action-ssis-ftps-task-300x209.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-3026" class="wp-caption-text">Option to upload, download files in SSIS</p></div></li>
<li>You can also overwrite files and folder, skip all, overwrite if source is older, overwrite if the file size is different, rename files and more:
<div id="attachment_3027" style="width: 689px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/overwrite-action-ssis-ftps-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3027" class="size-full wp-image-3027" src="https://zappysys.com/blog/wp-content/uploads/2018/03/overwrite-action-ssis-ftps-task.png" alt="Option to overwrite files in SSIS FTPS" width="679" height="590" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/overwrite-action-ssis-ftps-task.png 679w, https://zappysys.com/blog/wp-content/uploads/2018/03/overwrite-action-ssis-ftps-task-300x261.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></a><p id="caption-attachment-3027" class="wp-caption-text">Overwrite files in SSIS</p></div></li>
</ol>
<h3>Configuring the SSIS SFTP Connection Manager</h3>
<p>In this new section, we will show how to configure the Connection Manager. We configure before the Secure FTP task, and we pressed the New button to create a new connection.</p>
<ol>
<li>In the connection manager for SFTP, we will work with the SFTP Connection Manager. We will choose if the protocol is FTP, FTPS or SFTP. Also, we need to specify the host. In this example, we are using a localhost, but in other cases, you will need to specify the IP. By default, the<strong> SFTP</strong> port is <strong>22</strong>. If it is a different port in your case, specify the port, otherwise leave blank. The <strong>FTP</strong> default port is <strong>21</strong> and FTPS<strong> 990</strong>.  If you have multiple files, make sure to check the option <strong>Retain the same connection.</strong>
<div id="attachment_2984" style="width: 670px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/sftp-user-pwd-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2984" class="wp-image-2984 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/sftp-user-pwd-ssis.png" alt="SSIS FTP Task" width="660" height="617" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/sftp-user-pwd-ssis.png 660w, https://zappysys.com/blog/wp-content/uploads/2018/03/sftp-user-pwd-ssis-300x280.png 300w" sizes="(max-width: 660px) 100vw, 660px" /></a><p id="caption-attachment-2984" class="wp-caption-text">SSIS SFTP Connection manager (Support for Classic FTP, SFTP, FTPS (i.e. FTP / SSL))</p></div></li>
<li>There are different types of <strong>Logon Types</strong>. A username and a password is the most common way to login, but you can also use other types like the Public/private key authentication, X509 certificate authentication, KerversosV5 user/password/domain, NTLM single sign-on (GSSAPI) and NTLM user/password/domain (GSSAPI).
<div id="attachment_3028" style="width: 668px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/logon-type-supported-ssis-ftps.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3028" class="size-full wp-image-3028" src="https://zappysys.com/blog/wp-content/uploads/2018/03/logon-type-supported-ssis-ftps.png" alt="Logon types supported" width="658" height="557" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/logon-type-supported-ssis-ftps.png 658w, https://zappysys.com/blog/wp-content/uploads/2018/03/logon-type-supported-ssis-ftps-300x254.png 300w" sizes="(max-width: 658px) 100vw, 658px" /></a><p id="caption-attachment-3028" class="wp-caption-text">SFTP Connection Manager &#8211; Logon types (i.e. Username/password, Public / Private Key, NTLM )</p></div></li>
<li>If everything is OK, it will copy all the files from the SFTP in the source folder in the C:\destination folder.</li>
</ol>
<h3>Working with advanced filters</h3>
<p>In order to understand filters, we will create an example for you. This time we will create SSIS SFTP task example to show how to exclude some files from the downloading process.</p>
<ol>
<li>In addition, it is also possible to add advanced filters to the SSIS SFTP task to exclude or include files and folders. The following example shows how to use the Advanced filters. In the <strong>Secure FTP Task, </strong>go to the Advanced Filter page and in Exclude RegX we will write \.exe$ to exclude the file with exe extension to be downloaded. You can use RegX (regular expressions) in the advanced filter:
<div id="attachment_3037" style="width: 693px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/working-with-advanced-filters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3037" class="size-full wp-image-3037" src="https://zappysys.com/blog/wp-content/uploads/2018/03/working-with-advanced-filters.png" alt="Advanced filters" width="683" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/working-with-advanced-filters.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/03/working-with-advanced-filters-300x260.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-3037" class="wp-caption-text">Advanced filters FTP</p></div></li>
</ol>
<p>&nbsp;</p>
<h3>Working with wildcards in SSIS SFTP task (Multiple files)</h3>
<p>In order to understand wildcards, the new example will show how to work with Wildcards will help you to work with multiple files or folder with common characteristics.</p>
<ol>
<li>The following example shows how to copy all the files will all the extensions in the source folder. We use the *.*, which means that any file name with any extension will be downloaded:
<div id="attachment_2992" style="width: 691px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/sfpt-connection-manager-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2992" class="size-full wp-image-2992" src="https://zappysys.com/blog/wp-content/uploads/2018/03/sfpt-connection-manager-ssis.png" alt="SSIS FPTS connection" width="681" height="590" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/sfpt-connection-manager-ssis.png 681w, https://zappysys.com/blog/wp-content/uploads/2018/03/sfpt-connection-manager-ssis-300x260.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a><p id="caption-attachment-2992" class="wp-caption-text">SSIS SFTP connection manager</p></div></li>
<li>If we want to download all the files with extension txt, use the following Path:<br />
<pre class="crayon-plain-tag">/source/*.txt;</pre>
</li>
<li>Another example would be to download all the files with the following names: file1.txt, file2.txt and file3.txt.  We could use the following Path:<br />
<pre class="crayon-plain-tag">/source/file?.txt</pre>
</li>
</ol>
<p>&nbsp;</p>
<h3><strong>Working with SSIS expressions and variables in SFTP / FTPS to delete FTP files</strong></h3>
<p>In order to understand expressions, the following example will show how to work with SSIS expressions combined with variables in the SSIS SFTP task. In this example we will delete files in SFTP using variables and expressions.</p>
<div id="shellMainStage" class="shell mainStage">
<div id="chatServiceContainer" class="shell main">
<div class="chatContainer">
<div id="chatComponent" class="chatComponentContainer swx showFocusRing" dir="ltr">
<div id="swxContent1" class="swxContent">
<div class="fragmentsContainer hideContent">
<div class="fragment">
<div class="conversationControl chat themeLight allowTextSelection">
<div class="conversation scrollable scrollViewport scrollViewportV">
<div class="history scrollViewport-inner">
<div class="scroller">
<div class="messageHistory largeAllowed visible" role="list">
<div class="bubble">
<div id="msg_15748596827534091469" class="content">
<div class="messageTextWrapper">
<p class="urlPreviewText">ZappySys Providers simple and powerful Placeholders. You can still use SSIS expression language. Placeholders allow direct Variable Use easy to see compared to hidden SSIS Expression (C# style). Placeholders have simple embedding use of variables.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ol>
<li> First, we will first create a variable in SSIS. In the SSIS Project, go to the menu and select SSIS and variables. Create a variable with the Data type string and specify a Value. In this example the file name is <strong>MyFile</strong> and the Value<strong> file1</strong>.
<div id="attachment_2994" style="width: 782px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis.sftp-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2994" class="size-full wp-image-2994" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis.sftp-variable.png" alt="Create a SSIS variable" width="772" height="205" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis.sftp-variable.png 772w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis.sftp-variable-300x80.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis.sftp-variable-768x204.png 768w" sizes="(max-width: 772px) 100vw, 772px" /></a><p id="caption-attachment-2994" class="wp-caption-text">Create an SSIS variable</p></div></li>
<li>As a second step, we will write in path the value<strong> \destination\{{User.MyFile}}.txt. </strong>This will concatenate the folder destination with the variable MyFile. The task will delete the file1.txt from the SFTP folder.
<div id="attachment_2995" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-expressions-task-ftp.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2995" class="size-full wp-image-2995" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-expressions-task-ftp.png" alt="Add a SSIS expression" width="680" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-expressions-task-ftp.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-expressions-task-ftp-300x261.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-2995" class="wp-caption-text">Create SSIS expressions</p></div></li>
<li>The next example will show how to create a SFTP file using expressions and variables in SSIS:
<div id="attachment_3034" style="width: 690px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftps-expressions-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3034" class="size-full wp-image-3034" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftps-expressions-task.png" alt="Create ftps file" width="680" height="588" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftps-expressions-task.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftps-expressions-task-300x259.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-3034" class="wp-caption-text">Create file ftp</p></div></li>
<li>Content to write is the content of the file. In <strong>Target, </strong>go to path and write the following: For more information on placeholders <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm#A1" target="_blank" rel="noopener">check this post</a> and also check <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004918633-How-to-format-Path-URL-using-date-time-format" target="_blank" rel="noopener">this post</a>.<br />
<pre class="crayon-plain-tag">/destination/{{User::FileName,MM-dd-yyyy}}</pre>
</li>
<li>We are using a variable in SSIS named FileName of type DateTime. We are concatenating the SFTP folder destination with the variable. As you can see, the expressions with ZappySys are very simple.</li>
</ol>
<h3>Example working with variables in the SSIS FTP Task to upload files</h3>
<p>In order to understand variables, this example about SSIS TASKS FOR SFTP will show how to work with variables. We will specify the path in a variable.</p>
<ol>
<li>In this example, we will create a variable with a path. The Data type will be string and the Value will contain the path:
<div id="attachment_2996" style="width: 781px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-working-with-variables.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2996" class="size-full wp-image-2996" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-working-with-variables.png" alt="Values in variables" width="771" height="206" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-working-with-variables.png 771w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-working-with-variables-300x80.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-working-with-variables-768x205.png 768w" sizes="(max-width: 771px) 100vw, 771px" /></a><p id="caption-attachment-2996" class="wp-caption-text">SSIS variable values</p></div></li>
<li> Secondly, we will go to Path AccessMode, we will select Variable and select the variable in Path variable:
<div id="attachment_2997" style="width: 699px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-upload-file-sftp-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2997" class="size-full wp-image-2997" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-upload-file-sftp-variable.png" alt="Send files SFTP" width="689" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-upload-file-sftp-variable.png 689w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-upload-file-sftp-variable-300x258.png 300w" sizes="(max-width: 689px) 100vw, 689px" /></a><p id="caption-attachment-2997" class="wp-caption-text">ssis upload files SFTP</p></div></li>
</ol>
<h3>Working with variables to create a file in FTP</h3>
<p>In order to understand the use of variables, will show how to create a file in SFTP. In this new SSIS SFTP task example, we will create a new file using variables.</p>
<ol>
<li>First, we will create an SSIS variable named Content that will store the file content. Create a variable of type String and write some text in it.</li>
<li>Secondly, in AccessMode, select Content Variable and select <strong>Create new FTP</strong> <strong>file.  </strong>In target <strong>path, </strong>you need to specify the file name that will be created. Next, select the User::Content variable to add content to the file:
<div id="attachment_3000" style="width: 692px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-sftp-create-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3000" class="size-full wp-image-3000" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-sftp-create-file.png" alt="SSIS FTPS task example" width="682" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-sftp-create-file.png 682w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-sftp-create-file-300x261.png 300w" sizes="(max-width: 682px) 100vw, 682px" /></a><p id="caption-attachment-3000" class="wp-caption-text">Example for SSIS SFTP task</p></div></li>
</ol>
<h3>Example to verify if file exists in SSIS SFTP task</h3>
<p>Finally, we will verify if a file in SFTP exists or not using the SSIS SFTP task. The new SSIS SFTP task example will show how to work with variables and another useful ZappySys task used to get values of variables.</p>
<ol>
<li>In order to start, we will use the SSIS variables, create a variable of type string named FileExists. In <strong>Storage Action, </strong>select <strong>Get FTP file exist status. </strong>In path, select the path of the file to verify if it exists or not.
<div id="attachment_3007" style="width: 689px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-ftp-file-exists.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3007" class="wp-image-3007 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-ftp-file-exists.png" alt="SSIS SFTP task example to check if file exists" width="679" height="588" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-ftp-file-exists.png 679w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-task-ftp-file-exists-300x260.png 300w" sizes="(max-width: 679px) 100vw, 679px" /></a><p id="caption-attachment-3007" class="wp-caption-text">Verify if file exists in SFTP</p></div></li>
<li>Secondly, we will use the <strong>ZS Logging Task </strong>to check the value of the variable File Exists. This task will show the value of the variable in the log. Drag and drop the task and join it with the ZS Secure FTP Task:
<div id="attachment_3006" style="width: 745px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-log-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3006" class="size-full wp-image-3006" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-log-task.png" alt="ZappySys log task" width="735" height="484" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-log-task.png 735w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-log-task-300x198.png 300w" sizes="(max-width: 735px) 100vw, 735px" /></a><p id="caption-attachment-3006" class="wp-caption-text">The SSIS Log task</p></div></li>
<li>In order to get the value, we will insert it in the Logging Task. To do that, insert the Variable and select the FileExists variable:
<div id="attachment_3005" style="width: 634px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftp-verify-folder-exists.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3005" class="size-full wp-image-3005" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftp-verify-folder-exists.png" alt="Configuring variable" width="624" height="501" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftp-verify-folder-exists.png 624w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-ftp-verify-folder-exists-300x241.png 300w" sizes="(max-width: 624px) 100vw, 624px" /></a><p id="caption-attachment-3005" class="wp-caption-text">Add the variable in the task logging</p></div></li>
<li>Finally, run the package and verify the Output (you can use View and Output to see the output) and check the value of the Logging Task. If the file exists, the value will be true. If it does not exist, the value will be false.
<div id="attachment_3004" style="width: 1036px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3004" class="size-full wp-image-3004" src="https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables.png" alt="Verify the value of the variable in the SSIS output" width="1026" height="234" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables.png 1026w, https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables-300x68.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables-768x175.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/SFTP-read-variables-1024x234.png 1024w" sizes="(max-width: 1026px) 100vw, 1026px" /></a><p id="caption-attachment-3004" class="wp-caption-text">Verify the variable in Output</p></div></li>
</ol>
<h2>How to loop through SFTP / FTP files in SSIS</h2>
<p>You can also loop through files to perform custom action file by by. SFTP Task support Action to <strong>get File List as ADO.net Recordset</strong></p>
<p>To get File list from FTP Server perform the following steps.</p>
<ol>
<li>Download and Install SSIS PowerPack <a href="//zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">from here</a></li>
<li>Open Visual Studio and Create New SSIS Project.</li>
<li>In the SSIS control flow designer drag &amp; drop <strong>ZS Secure FTP Task</strong></li>
<li>Double click to configure SSIS SFTP Task.</li>
<li>From Storage Action select <strong><strong>Get FTP files as ADO.net DataTable<br />
</strong></strong></p>
<div id="attachment_3055" style="width: 903px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-loop-secure-ftp-sftp-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3055" class="size-full wp-image-3055" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-loop-secure-ftp-sftp-files.png" alt="SSIS SFTP Task - Loop through Files / Folders stored on FTP Server" width="893" height="480" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-loop-secure-ftp-sftp-files.png 893w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-loop-secure-ftp-sftp-files-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-loop-secure-ftp-sftp-files-768x413.png 768w" sizes="(max-width: 893px) 100vw, 893px" /></a><p id="caption-attachment-3055" class="wp-caption-text">SSIS SFTP Task &#8211; Loop through Files / Folders stored on FTP Server</p></div>
<p>&nbsp;</p>
<p>&nbsp;</li>
<li>Create new FTP Connection by clicking New next to connection dropdown.</li>
<li>Select Source Path (e.g  <strong>\myroot\folder\*.txt </strong> )</li>
<li>Select or create new SSIS Variable (e.g. <strong>varFiles</strong> ) which will hold file list result (Must be Object datatype variable).</li>
<li>Click OK to close.</li>
<li>Create 3 more SSIS variables to hold File Path (String), Name (String) and Size (Int32). We will use in the next step.</li>
<li>Now drag SSIS ForEach Loop Container Task from SSIS Toolbox</li>
<li>Edit Loop Task and Select <strong>Foreach ADO Enumerator</strong> from the Enumerator dropdown</li>
<li>Select variable (e.g. <strong><strong>varFiles)<br />
</strong></strong></p>
<div id="attachment_346" style="width: 635px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-346" class="wp-image-346 size-full" src="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png" alt="Loop through files in SSIS using ForEach Loop Task (use ADO.net Recordset variable)" width="625" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png 625w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-300x270.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-346" class="wp-caption-text">Loop through files in SSIS using ForEach Loop Task (use ADO.net Recordset variable)</p></div></li>
<li>Click on Variable Mappings Tab and configure like below.
<div id="attachment_345" style="width: 582px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-345" class="size-full wp-image-345" src="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png" alt="Variable Mappings for ForEach Loop Task - Loop through files in a folder using SSIS" width="572" height="272" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png 572w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping-300x143.png 300w" sizes="(max-width: 572px) 100vw, 572px" /></a><p id="caption-attachment-345" class="wp-caption-text">Variable Mappings for ForEach Loop Task &#8211; Loop through files in a folder using SSIS</p></div></li>
<li>Drag ZS Logging Task and place inside Loop and Display variables</li>
<li>Thats</li>
</ol>
<p>For more information to <a href="//zappysys.com/blog/get-list-of-files-and-folders-in-ssis-for-looping/" target="_blank" rel="noopener">loop through files on local machine using SSIS check this article</a>.</p>
<p>&nbsp;</p>
<h2>Algorithms / Ciphers supported by Secure FTP Task</h2>
<p>Secure FTP Task comes with many option to tweak many aspects about security so you can turn on and off algorithms used by components.</p>
<p><a href="https://zappysys.com/forums/topic/ciphers-algorithms-supported-sftp-connection/" target="_blank" rel="noopener">Click here to learn more</a> about supported Ciphers / Macs and Encryption Algorithms used by SSIS SFTP Task.</p>
<h2>Conclusion</h2>
<p>To conclude, we can say that working with SFTP is now very simple. In this article, we looked at SSIS SFTP task examples on how to upload, download, delete files and folders. We used variables, wildcards and expressions. If you liked the tasks you can start using them by downloading SSIS PowerPack from our <a href="https://zappysys.com/products/ssis-powerpack/">web site here</a>. We saw different SSIS SFTP task examples to understand how to use the task in different scenarios.</p>
<p>Thanks for your time.</p>
<h2>References</h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/">About SSIS PowerPack</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/expressions/integration-services-ssis-expressions">Integration Services (SSIS) Expressions</a></li>
</ul>
<p>Keywords: SSIS SFTP task example,upload SFTP files, download SFTP files.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-sftp-task-examples-upload-download-move-delete-files-folders/">SSIS SFTP task examples to upload, download, move and delete files / folders</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
