{"id":5490,"date":"2018-12-01T10:47:56","date_gmt":"2018-12-01T10:47:56","guid":{"rendered":"https:\/\/zappysys.com\/blog\/?p=5490"},"modified":"2019-07-15T13:50:58","modified_gmt":"2019-07-15T13:50:58","slug":"download-latest-file-from-ftp-using-ssis","status":"publish","type":"post","link":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/","title":{"rendered":"Download latest File from FTP using SSIS (SFTP \/ FTPS)"},"content":{"rendered":"<h2><span id=\"Introduction\">Introduction<\/span><\/h2>\n<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>\n<p>In this blog,\u00a0we will learn\u00a0how 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\u00a0Task.<\/p>\n<p>We also learn how to get and set variables and how to use it in SSIS Script Task and Secure FTP Task.<\/p>\n<div style=\"clear: both;\"><div class=\"content_block\" id=\"custom_post_widget-2523\"><h2><span id=\"Prerequisites\">Prerequisites<\/span><\/h2>\r\nBefore we perform the steps listed in this article, you will need to make sure the following prerequisites are met:\r\n<ol style=\"margin-left: 1.5em;\">\r\n \t<li><abbr title=\"SQL Server Integration Services\">SSIS<\/abbr> designer installed.\u00a0Sometimes 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>\r\n \t<li>Basic knowledge of SSIS package\u00a0development using\u00a0<em>Microsoft SQL Server Integration Services<\/em>.<\/li>\r\n \t<li>Make sure\u00a0<span style=\"text-decoration: underline;\"><a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\" target=\"_blank\" rel=\"noopener\">ZappySys SSIS PowerPack<\/a><\/span>\u00a0is installed (<a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/download\/\" target=\"_blank\" rel=\"noopener\">download it<\/a>, if you haven't already).<\/li>\r\n \t<li>(<em>Optional step<\/em>)<em>.<\/em>\u00a0<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>\r\n<\/ol><\/div><\/div>\n<h2><\/h2>\n<h2><span id=\"Requirements\">Requirements<\/span><\/h2>\n<ol>\n<li>First, you will need to have SSIS installed<\/li>\n<li>Also, make sure to have SSDT<\/li>\n<li>Make sure to have installed <a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\">ZappySys\u00a0SSIS PowerPack<\/a>.<\/li>\n<\/ol>\n<h2><span id=\"Whats_is_FTP_FTPS_SFTP_FTPSSL\">What is FTP, FTPS, SFTP, FTP\/SSL?<\/span><\/h2>\n<p>Many people still have confusion over various protocols around FTP terminology. Most common terms you hear are as below.<\/p>\n<ul>\n<li>FTP<\/li>\n<li>Classic FTP<\/li>\n<li>Secure FTP<\/li>\n<li>SFTP<\/li>\n<li>FTPS<\/li>\n<li>FTP\/SSL<\/li>\n<li>FTP over SSL<\/li>\n<li>FTP Over SSH<\/li>\n<\/ul>\n<p>You must be overwhelmed by now? So are they all same or different? See below for quick clarification in nutshell.<\/p>\n<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>\n<ol>\n<li><strong>Classic FTP<\/strong>\u00a0\u2013 sometimes referred as just\u00a0<strong>FTP<\/strong>\u00a0(Typically server runs on Port 21)<\/li>\n<li><strong>SFTP<\/strong>\u00a0\u2013 Sometimes referred as\u00a0<strong>Secure FTP<\/strong>\u00a0or\u00a0<strong>FTP over SSH<\/strong>\u00a0(Typically server runs on Port 22)<\/li>\n<\/ol>\n<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\u00a0<strong>FTP over SSL<\/strong>\u00a0to request encrypted traffic in classic FTP.\u00a0<strong>FTP over SSL<\/strong>\u00a0also referred as\u00a0<strong>FTPS or FTP\/SSL<\/strong>.<\/p>\n<h2><\/h2>\n<h2>Getting Started<\/h2>\n<p>In order to start, we will show several examples. ZappySys includes an SSIS &#8211;\u00a0<a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-sftp-task-ftp-ftps\/\">Secure FTP Task<\/a>\u00a0that 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>\n<p>In this example, we will show 3 examples.<\/p>\n<ol>\n<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>\n<li>Secondly, we will show how to sort ADO.net DataTable and get latest FTP File Path in a variable using <strong>Script\u00a0Task<\/strong>.<\/li>\n<li>Third, we will\u00a0Download Latest File from FTP using SSIS\u00a0<strong><a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-sftp-task-ftp-ftps\/\">Secure FTP Task<\/a>\u00a0<\/strong>using that latest file path variable.<\/li>\n<\/ol>\n<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\u00a0Secure FTP Task<\/span><\/h3>\n<p>Follow these steps to accomplish the task:<\/p>\n<ol>\n<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>\n<\/ol>\n<div id=\"attachment_2780\" class=\"wp-caption aligncenter\">\n<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>\n<\/div>\n<div><\/div>\n<div><\/div>\n<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>\n<div><\/div>\n<div style=\"padding-left: 60px;\">\n<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>\n<\/div>\n<div><\/div>\n<div style=\"padding-left: 30px;\">3. After successfully connected with FTP\/SFTP we have to enter\u00a0FTP path from where we have to get the file list and set it into\u00a0result variable.<\/div>\n<div><\/div>\n<div style=\"padding-left: 60px;\">\n<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>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div style=\"padding-left: 30px;\">4. Now let&#8217;s check what ADO.net DataTable columns name and ordinal.<\/div>\n<div><\/div>\n<div style=\"padding-left: 60px;\">\n<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>\n<\/div>\n<div><\/div>\n<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>\n<div><\/div>\n<div>\n<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\u00a0Task<\/span><\/h3>\n<p>Follow these steps to accomplish the task:<\/p>\n<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>\n<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>\n<p>&nbsp;<\/p>\n<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>\n<\/div>\n<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>\n<p>&nbsp;<\/p>\n<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 \/>\n<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>\n<p style=\"padding-left: 30px;\">4. Then proceed and\u00a0press &#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>\n<pre class=\"lang:default decode:true\">DataTable dt = (DataTable)Dts.Variables[\"User::v_dtFileLists\"].Value;\r\n\r\nDataView dv = dt.DefaultView;\r\ndv.Sort = \"CreationTime desc\";\r\nDataTable sortedDT = dv.ToTable();\r\nif (sortedDT.Rows.Count &gt; 0)\r\n{\r\n\tDts.Variables[\"User::v_LatestFilePath\"].Value = sortedDT.Rows[0][0].ToString();\r\n}\r\ndt=null;\r\ndv = null;\r\nsortedDT = null;<\/pre>\n<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>\n<p>&nbsp;<\/p>\n<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>\n<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>\n<h3><span style=\"font-size: 12pt;\">Download Latest File from FTP using the latest file path variable<\/span><\/h3>\n<p>Follow these steps to accomplish the task:<\/p>\n<p style=\"padding-left: 30px;\">1. Drag and drop <strong>ZS<\/strong>\u00a0<strong>Secure FTP Task<\/strong> the design panel and link it with Script Task.<\/p>\n<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>\n<p>&nbsp;<\/p>\n<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>\n<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>\n<p style=\"padding-left: 30px;\">3. Click OK to close Secure FTP TASK UI.<\/p>\n<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>\n<h2><span id=\"Conclusion\">Conclusion<\/span><\/h2>\n<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\u00a0on 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>.\u00a0 We used variables, expressions, and SSIS Script Task. If you liked the tasks you can start using them by downloading SSIS PowerPack from our\u00a0<a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\">website here<\/a>.<\/p>\n<h2><span id=\"References\">References<\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/\">About SSIS PowerPack<\/a><\/li>\n<li><a href=\"https:\/\/zappysys.com\/products\/ssis-powerpack\/ssis-sftp-task-ftp-ftps\/\">About Secure FTP Task<\/a><\/li>\n<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>\n<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>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog,\u00a0we will learn\u00a0how 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 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":5517,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[138],"tags":[296,295,294,417],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog<\/title>\r\n<meta name=\"description\" content=\"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog\" \/>\r\n<meta property=\"og:description\" content=\"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/\" \/>\r\n<meta property=\"og:site_name\" content=\"ZappySys Blog\" \/>\r\n<meta property=\"article:published_time\" content=\"2018-12-01T10:47:56+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2019-07-15T13:50:58+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png\" \/>\r\n\t<meta property=\"og:image:width\" content=\"293\" \/>\r\n\t<meta property=\"og:image:height\" content=\"293\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\r\n<meta name=\"author\" content=\"ZappySys\" \/>\r\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ZappySys\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/\",\"url\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/\",\"name\":\"Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog\",\"isPartOf\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png\",\"datePublished\":\"2018-12-01T10:47:56+00:00\",\"dateModified\":\"2019-07-15T13:50:58+00:00\",\"author\":{\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35\"},\"description\":\"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.\",\"breadcrumb\":{\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage\",\"url\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png\",\"contentUrl\":\"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png\",\"width\":293,\"height\":293,\"caption\":\"Download Latest File from FTP using SSIS\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/zappysys.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Download latest File from FTP using SSIS (SFTP \/ FTPS)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zappysys.com\/blog\/#website\",\"url\":\"https:\/\/zappysys.com\/blog\/\",\"name\":\"ZappySys Blog\",\"description\":\"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zappysys.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35\",\"name\":\"ZappySys\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g\",\"caption\":\"ZappySys\"},\"url\":\"https:\/\/zappysys.com\/blog\/author\/hshah\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog","description":"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/","og_locale":"en_US","og_type":"article","og_title":"Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog","og_description":"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.","og_url":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/","og_site_name":"ZappySys Blog","article_published_time":"2018-12-01T10:47:56+00:00","article_modified_time":"2019-07-15T13:50:58+00:00","og_image":[{"width":293,"height":293,"url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png","type":"image\/png"}],"author":"ZappySys","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ZappySys","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/","url":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/","name":"Download latest File from FTP using SSIS (SFTP \/ FTPS) | ZappySys Blog","isPartOf":{"@id":"https:\/\/zappysys.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage"},"image":{"@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage"},"thumbnailUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png","datePublished":"2018-12-01T10:47:56+00:00","dateModified":"2019-07-15T13:50:58+00:00","author":{"@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35"},"description":"How to Download Latest File from FTP using SSIS Secure FTP Task. How to connect with FTP\/SFTP and Get Latest File list in ADO.net DataTable variable.","breadcrumb":{"@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#primaryimage","url":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png","contentUrl":"https:\/\/zappysys.com\/blog\/wp-content\/uploads\/2018\/12\/download-latest-file-using-zs-sftp-task-1.png","width":293,"height":293,"caption":"Download Latest File from FTP using SSIS"},{"@type":"BreadcrumbList","@id":"https:\/\/zappysys.com\/blog\/download-latest-file-from-ftp-using-ssis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zappysys.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Download latest File from FTP using SSIS (SFTP \/ FTPS)"}]},{"@type":"WebSite","@id":"https:\/\/zappysys.com\/blog\/#website","url":"https:\/\/zappysys.com\/blog\/","name":"ZappySys Blog","description":"SSIS \/ ODBC Drivers \/ API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zappysys.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/c9dc782c929d0027e2e87e3951ce9d35","name":"ZappySys","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zappysys.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/076a738938c19d459fbfe125c759a0ea?s=96&d=mm&r=g","caption":"ZappySys"},"url":"https:\/\/zappysys.com\/blog\/author\/hshah\/"}]}},"_links":{"self":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/5490"}],"collection":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/comments?post=5490"}],"version-history":[{"count":40,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/5490\/revisions"}],"predecessor-version":[{"id":7481,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/posts\/5490\/revisions\/7481"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media\/5517"}],"wp:attachment":[{"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/media?parent=5490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/categories?post=5490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zappysys.com\/blog\/wp-json\/wp\/v2\/tags?post=5490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}