<?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>S3 (Simple Storage Service) Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/cloud-computing/aws-amazon-web-services/s3-simple-storage-service/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/cloud-computing/aws-amazon-web-services/s3-simple-storage-service/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Mon, 07 Apr 2025 13:01:41 +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>S3 (Simple Storage Service) Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/cloud-computing/aws-amazon-web-services/s3-simple-storage-service/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Download the Latest File from Amazon S3 Storage using SSIS</title>
		<link>https://zappysys.com/blog/download-latest-file-amazon-s3-storage-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 27 Dec 2019 12:33:04 +0000</pubDate>
				<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS Amazon S3 Connection]]></category>
		<category><![CDATA[SSIS Amazon Storage Task]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[storage]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8626</guid>

					<description><![CDATA[<p>Introduction In our previous article, we saw SSIS Amazon S3 Storage Task examples. Now let&#8217;s look at how to Download the Latest File from Amazon S3 Storage using SSIS. Microsoft SSIS includes the Amazon S3 Storage Task that allows us to upload files to Amazon S3 Storage, download files, creating local and remote directories an more. In [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/download-latest-file-amazon-s3-storage-using-ssis/">Download the Latest File from Amazon S3 Storage using SSIS</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/2019/03/s3-e1553183075864.png"><img decoding="async" class="wp-image-6547 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/03/s3-e1553183075864.png" alt="Amazon S3" width="150" height="150" /></a></p>
<p>In our previous article, we saw <a href="https://zappysys.com/blog/ssis-amazon-s3-storage-task-examples-download-upload-move-delete-files-folders/" target="_blank" rel="noopener">SSIS Amazon S3 Storage Task examples</a>. Now let&#8217;s look at how to Download the Latest File from Amazon S3 Storage using SSIS. Microsoft SSIS includes the Amazon S3 Storage Task that allows us to upload files to Amazon S3 Storage, download files, creating local and remote directories an more. In this article, we will show how to use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">SSIS Amazon S3 Storage task</a> included in ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>.</p>
<p>In nutshell, this post will focus on how to Download the Latest File from Amazon S3 Storage.</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><span id="What_is_Amazon_S3_Storage">What is Amazon S3 Storage</span></h2>
<p>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9’s) of durability, and stores data for millions of applications for companies all around the world.</p>
<h2><span id="Getting_Started">Getting Started</span></h2>
<p>In order to start, we will show several examples. ZappySys includes an <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">SSIS Amazon S3 Storage Task</a> that will allow you to access files/folders from Amazon S3 Storage to the Local machine, Upload files(s) to Amazon S3 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 the Latest File from Amazon S3 Storage.</p>
<h2><span id="SSIS_Amazon_S3_Storage_Task_Examples">Step-By-Step to Download the Latest File from Amazon S3 Storage</span></h2>
<p>Let´s start with an example. In this SSIS Amazon S3 Storage Task File task example, we will download the latest file using <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">Amazon S3 Storage Task</a>.</p>
<ol>
<li>First of All, Drag and Drop Amazon S3 Storage Task from SSIS Toolbox and double click it to edit
<div id="attachment_6708" style="width: 706px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-add-s3-task.png" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-6708" class="wp-image-6708 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-add-s3-task.png" alt="Drag and Drop Amazon S3 Storage Task" width="696" height="404" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-add-s3-task.png 696w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-add-s3-task-300x174.png 300w" sizes="(max-width: 696px) 100vw, 696px" /></a><p id="caption-attachment-6708" class="wp-caption-text">Drag and Drop Amazon S3 Storage Task</p></div></li>
<li>The following options are available in Amazon S3 Storage Task:
<div id="attachment_6709" style="width: 723px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-aws-s3-storage-task-options.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6709" class="wp-image-6709 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-aws-s3-storage-task-options.png" alt="Options to upload, download files in SSIS" width="713" height="689" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-aws-s3-storage-task-options.png 713w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-aws-s3-storage-task-options-300x290.png 300w" sizes="(max-width: 713px) 100vw, 713px" /></a><p id="caption-attachment-6709" class="wp-caption-text">Options to upload, download files in SSIS</p></div></li>
<li>You can also overwrite files and folder, skip all, overwrite if the source is older, overwrite if the file size is different, rename files and more:
<div id="attachment_6678" style="width: 692px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/overwrite-action-ssis-za-am-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6678" class="wp-image-6678 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/overwrite-action-ssis-za-am-task.png" alt="Overwrite files in SSIS" width="682" height="492" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/overwrite-action-ssis-za-am-task.png 682w, https://zappysys.com/blog/wp-content/uploads/2019/03/overwrite-action-ssis-za-am-task-300x216.png 300w" sizes="(max-width: 682px) 100vw, 682px" /></a><p id="caption-attachment-6678" class="wp-caption-text">Overwrite files in SSIS</p></div></li>
<li>Let&#8217;s select the <strong>Download Amazon file(s) to local directory</strong>. Now select/add The Source path, Check Recursive Scan<em>(*Optional)</em> to get all the sub-files and subfolders and files, after that add Target Path if you want to, This option will download files. In Path AccessMode we can use Direct to write the path directly or to use an SSIS variable.
<div id="attachment_6735" style="width: 595px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-az-blob-aws-s3-download-files.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6735" class="wp-image-6735 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-az-blob-aws-s3-download-files.png" alt="ssis-az-blob-aws-s3-download-files" width="585" height="522" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-az-blob-aws-s3-download-files.png 585w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-az-blob-aws-s3-download-files-300x268.png 300w" sizes="(max-width: 585px) 100vw, 585px" /></a><p id="caption-attachment-6735" class="wp-caption-text">SSIS Amazon S3 Storage Task – Download files from Amazon S3 Storage</p></div></li>
<li>Now go to Advanced Filter &amp; Sorting and configure it like below screen to download the latest file only.
<div id="attachment_8629" style="width: 606px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/12/ssis-amazon-s3-and-azure-storage-task-filter-sorting.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8629" class="wp-image-8629 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/ssis-amazon-s3-and-azure-storage-task-filter-sorting.png" alt="Storage Task configuration to download the latest file only using sorting" width="596" height="567" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/ssis-amazon-s3-and-azure-storage-task-filter-sorting.png 596w, https://zappysys.com/blog/wp-content/uploads/2019/12/ssis-amazon-s3-and-azure-storage-task-filter-sorting-300x285.png 300w" sizes="(max-width: 596px) 100vw, 596px" /></a><p id="caption-attachment-8629" class="wp-caption-text">Storage Task configuration to download the latest file only using sorting</p></div></li>
<li>That&#8217;s it now execute the package and it will download the latest file from the Amazon S3 Storage Task to Local File Machine.</li>
<li>Sometimes you may need to make advanced filtering on file path, file date, size, etc. for that refer to <a href="https://zappysys.com/blog/advanced-path-filtering-for-amazon-azure-storage-ssis-task/" target="_blank" rel="noopener">this article</a> for more details.</li>
</ol>
<h2>Conclusion</h2>
<p>To conclude, we can say that working with Amazon S3 Storage is now very simple. In this article, we looked at how to Download the Latest File from Amazon S3 Storage using SSIS. We used Adnavced Filtering &amp; sorting option. If you liked the tasks you can start using them by downloading SSIS PowerPack from our <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">web site here</a>.</p>
<p>Thanks for your time.</p>
<h2>References</h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">About SSIS PowerPack</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/expressions/integration-services-ssis-expressions" target="_blank" rel="noopener">Integration Services (SSIS) Expressions</a></li>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=amazon-s3-storage-task.htm" target="_blank" rel="noopener">Amazon Storage Task</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/download-latest-file-amazon-s3-storage-using-ssis/">Download the Latest File from Amazon S3 Storage using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load 10M rows from SQL Server to Snowflake in 3 minutes</title>
		<link>https://zappysys.com/blog/load-10-million-rows-from-sql-server-to-snowflake/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 17 Dec 2019 16:55:54 +0000</pubDate>
				<category><![CDATA[AWS (Amazon Web Services)]]></category>
		<category><![CDATA[Cloud Computing]]></category>
		<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS Tasks]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Export CSV Task]]></category>
		<category><![CDATA[snowflake]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[zip]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8538</guid>

					<description><![CDATA[<p>Introduction In this article, we will cover the points on how to load 10 million rows from SQL Server to Snowflake in just 3 minutes. Snowflake is a data warehousing platform that resides in a cloud. Basically, it is a data warehouse software exposed as a service. It allows integrating many data sources via internal [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/load-10-million-rows-from-sql-server-to-snowflake/">Load 10M rows from SQL Server to Snowflake in 3 minutes</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="size-thumbnail wp-image-8580 align= alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/12/sql-server-to-snowflake-150x150.png" alt="" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/sql-server-to-snowflake-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/12/sql-server-to-snowflake-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/12/sql-server-to-snowflake.png 400w" sizes="(max-width: 150px) 100vw, 150px" />In this article, we will cover the points on how to load 10 million rows from SQL Server to Snowflake in just 3 minutes.</p>
<p style="text-align: justify;">Snowflake is a data warehousing platform that resides in a cloud. Basically, it is a data warehouse software exposed as a service. It allows integrating many data sources via internal Snowflake Partner apps and loading them into the Snowflake storage engine. Another part of Snowflake is a computing engine that is responsible for serving your SQL queries. Both engines can work independently thus users that are querying a data warehouse are not affected by a data load that is happening at the same time. Snowflake is an elastic service, which means you pay only for the resources used. Specifically, you pay only for each second of the processing time you use.</p>
<p style="text-align: justify;">To show how data loading works in Snowflake, we will take 10 million rows from SQL Server and load them into Snowflake using SSIS and <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a>. These SSIS PowerPack connectors will be used to achieve the task:</p>
<div class="content_block" id="custom_post_widget-8706"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//zappysys.com/images/SSIS-PowerPack/ssis-export-csv-file-task.png" alt="JSON Parser Transform" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV File Task</a></div>
</div></div>
<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>Step-by-step &#8211; How to load 10 million rows from SQL Server to Snowflake in 3 minutes</h2>
<h3>Getting started</h3>
<p style="text-align: justify;">To achieve the goal, we will use a slightly modified Northwind database (example database from Microsoft) and SnowSQL &#8211; a command-line tool provided by Snowflake. So in the first steps, you will need to install the Northwind database and SnowSQL. After that, we will proceed to create a table in Snowflake &#8211; a table we will load the data into &#8211; and a file format which will be used to load data from the Snowflake staging area into the destination table. Once that&#8217;s complete, we will proceed in creating an SSIS package, adding and configuring the connectors, and finally running it to get the results. Let&#8217;s proceed!</p>
<h3>Install a Northwind database</h3>
<p>Download and run the creation script of a modified <a href="https://zappysys.com/blog/wp-content/uploads/2019/12/Northwind.zip">Northwind</a> database. The only thing that was modified is a &#8220;CustomersForSnowflake&#8221; view added which returns 10M rows.</p>
<h3>Install and configure SnowSQL command-line tool</h3>
<p>Download and install SnowSQL; you will find the instructions on how to do that in <a href="https://docs.snowflake.net/manuals/user-guide/snowsql-install-config.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/user-guide/snowsql-install-config.html</a>.</p>
<p>Once installed, you will need to configure the default Snowflake account name, user name, and password:</p>
<ol>
<li>Go to Windows File Explorer and enter this path:<br />
<code>%USERPROFILE%\.snowsql\</code><br />
Usually, when entered the path looks similar to this one:<br />
<code>C:\Users\myUserName\.snowsql</code></li>
<li>Find a file named <strong>config </strong>and open it.</li>
<li>Then configure your credentials:</li>
</ol>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-8587" src="https://zappysys.com/blog/wp-content/uploads/2019/12/016-sql-server-to-snowflake-configure-snowsql-username.png" alt="" width="712" height="427" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/016-sql-server-to-snowflake-configure-snowsql-username.png 712w, https://zappysys.com/blog/wp-content/uploads/2019/12/016-sql-server-to-snowflake-configure-snowsql-username-300x180.png 300w" sizes="(max-width: 712px) 100vw, 712px" /><br />
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> When you deploy the package to a production server, instead of using your own user name, enter the username under which you run SSIS packages, e.g. SQL Server Agent&#8217;s account. Username and password can be specified <a href="https://docs.snowflake.net/manuals/user-guide/snowsql-start.html#connection-syntax" target="_blank" rel="noopener">as arguments</a> in a command-line when executing SnowSQL. A password can also be specified in <a href="https://docs.snowflake.net/manuals/user-guide/snowsql-start.html#specifying-passwords-when-connecting" target="_blank" rel="noopener">Environment variables</a>.</div></div>
<h3>Create a table in Snowflake</h3>
<p>Login to your Snowflake account, open a Worksheet and execute this query:</p><pre class="crayon-plain-tag">create or replace table Customers(
ID number,
CustomerID nchar(5),
CompanyName nvarchar(40),
ContactName nvarchar(30),
ContactTitle nvarchar(30),
Address nvarchar(60),
City nvarchar(15),
Region nvarchar(15),
PostalCode nvarchar(10),
Country nvarchar(15),
Phone nvarchar(24),
Fax nvarchar(24)
)</pre><p>
&nbsp;</p>
<p>We will load 10M customers from the Northwind database and load them into this table.</p>
<h3>Create a file format in Snowflake</h3>
<p>Then in the same Worksheet create a file format for zipped CSV files by executing this query:</p><pre class="crayon-plain-tag">create or replace file format GzipCsvFormat
type = csv
field_delimiter = ','
null_if = ('NULL', 'null')
empty_field_as_null = true
compression = gzip
field_optionally_enclosed_by = '"'</pre><p>
&nbsp;</p>
<p>We will use this file format when loading data from a Snowflake stage to the Snowflake destination table. This file format defines CSV format which is used by ZappySys Export CSV Task in SSIS.</p>
<h3>Create an SSIS package</h3>
<p>We are ready to create a new SSIS package and load some data into Snowflake. We are going to use two methods of how we load data into Snowflake. In one method we will load data into Snowflake&#8217;s local storage, while in the second one we will stage data in Amazon S3 bucket. Decide how you want to stage files, and then choose the appropriate workflow when creating a new package:</p>
<div id="attachment_8554" style="width: 640px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8554" class="wp-image-8554 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/001-sql-server-to-snowflake-create-ssis-package.png" alt="Loading 3 million rows from SQL Server to Snowflake" width="630" height="519" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/001-sql-server-to-snowflake-create-ssis-package.png 630w, https://zappysys.com/blog/wp-content/uploads/2019/12/001-sql-server-to-snowflake-create-ssis-package-300x247.png 300w" sizes="(max-width: 630px) 100vw, 630px" /><p id="caption-attachment-8554" class="wp-caption-text">Loading 10 million rows from SQL Server to Snowflake</p></div>
<h3>Add &amp; configure ZappySys Export CSV Task</h3>
<p>Firstly, drag and drop ZappySys Export CSV Task from SSIS toolbox and follow the instructions on how to configure it:</p>
<h4>Configure source</h4>
<ol>
<li>Proceed with configuring the data source, from which you will be exporting data. We will use the Northwind database as an example:
<div id="attachment_8555" style="width: 647px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8555" class="wp-image-8555 size-full" style="-webkit-user-drag: none; display: inline-block; margin-bottom: -1ex;" src="https://zappysys.com/blog/wp-content/uploads/2019/12/002-sql-server-to-snowflake-configure-ole-db-source-connection.png" alt="Export CSV Task: configuring OLE DB Connection to export data from SQL Server to Snowflake" width="637" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/002-sql-server-to-snowflake-configure-ole-db-source-connection.png 637w, https://zappysys.com/blog/wp-content/uploads/2019/12/002-sql-server-to-snowflake-configure-ole-db-source-connection-300x138.png 300w" sizes="(max-width: 637px) 100vw, 637px" /><p id="caption-attachment-8555" class="wp-caption-text">Export CSV Task: configuring OLE DB Connection to export data from SQL Server to Snowflake</p></div></li>
<li>Then move on and select it and enter the query or table name you want to export data from:
<div id="attachment_8557" style="width: 647px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8557" class="wp-image-8557 size-full" style="-webkit-user-drag: none; display: inline-block; margin-bottom: -1ex;" src="https://zappysys.com/blog/wp-content/uploads/2019/12/003-sql-server-to-snowflake-configure-sql-query.png" alt="Export CSV Task: configuring source SQL query for data loading from SQL Server to Snowflake" width="637" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/003-sql-server-to-snowflake-configure-sql-query.png 637w, https://zappysys.com/blog/wp-content/uploads/2019/12/003-sql-server-to-snowflake-configure-sql-query-300x279.png 300w" sizes="(max-width: 637px) 100vw, 637px" /><p id="caption-attachment-8557" class="wp-caption-text">Export CSV Task: configuring source SQL query for data loading from SQL Server to Snowflake</p></div>
<p>We will be using this query:<br />
<code>select top 10000000 * from CustomersForSnowflake</code></li>
<li>Then in the <em>Split Options</em> tab split the exported CSV into many files, e.g. into 50 MB chunks:
<div id="attachment_8558" style="width: 508px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8558" class="wp-image-8558 size-full" style="-webkit-user-drag: none; display: inline-block; margin-bottom: -1ex;" src="https://zappysys.com/blog/wp-content/uploads/2019/12/007-sql-server-to-snowflake-split-rows.png" alt="Using data split options in the Export CSV Task" width="498" height="309" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/007-sql-server-to-snowflake-split-rows.png 498w, https://zappysys.com/blog/wp-content/uploads/2019/12/007-sql-server-to-snowflake-split-rows-300x186.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/12/007-sql-server-to-snowflake-split-rows-436x272.png 436w" sizes="(max-width: 498px) 100vw, 498px" /><p id="caption-attachment-8558" class="wp-caption-text">Using data split options in the Export CSV Task</p></div>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> Snowflake recommends having files that are 10-100 MB in size when <em><span style="text-decoration: underline;">compressed</span></em>. So it is perfectly safe to configure the value to 100 MB and above.</div></div></li>
</ol>
<h4>Configure target</h4>
<p>Depending on which staging approach you chose to use, set the export target to a local path or S3 bucket:</p>
<h5>Using local Snowflake storage</h5>
<p>Just set the appropriate <em>Save Mode</em> and a file path:</p>
<div id="attachment_8693" style="width: 568px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8693" class="wp-image-8693 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/006a-sql-server-to-snowflake-configure-local-target-path-to-export-csv-files-to-1.png" alt="Saving files locally to upload them to Snowflake local stage later" width="558" height="534" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/006a-sql-server-to-snowflake-configure-local-target-path-to-export-csv-files-to-1.png 558w, https://zappysys.com/blog/wp-content/uploads/2019/12/006a-sql-server-to-snowflake-configure-local-target-path-to-export-csv-files-to-1-300x287.png 300w" sizes="(max-width: 558px) 100vw, 558px" /><p id="caption-attachment-8693" class="wp-caption-text">Saving files locally to upload them to Snowflake local stage later</p></div>
<h5>Using S3 storage</h5>
<p>For storing staging files in S3, follow these steps:</p>
<ol>
<li>Set <em>Save Mode</em> to <strong>Save to Connection</strong> and select <strong>&lt;New ZS-AWS-STORAGE Connection&gt;</strong>:
<div id="attachment_8559" style="width: 559px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8559" class="wp-image-8559 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/005-sql-server-to-snowflake-configure-s3-target-connection.png" alt="Export CSV Task: configuring Amazon S3 endpoint as the target for data export" width="549" height="355" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/005-sql-server-to-snowflake-configure-s3-target-connection.png 549w, https://zappysys.com/blog/wp-content/uploads/2019/12/005-sql-server-to-snowflake-configure-s3-target-connection-300x194.png 300w" sizes="(max-width: 549px) 100vw, 549px" /><p id="caption-attachment-8559" class="wp-caption-text">Export CSV Task: configuring Amazon S3 endpoint as the target for data export</p></div></li>
<li>Then select <strong>S3</strong> as <em>Storage Service</em> and fill in <em>Access and Secret Key</em>, select your region (optional):
<div id="attachment_8561" style="width: 576px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8561" class="wp-image-8561 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/008-sql-server-to-snowflake-configure-s3-target-connection-entering-access-and-secret-keys.png" alt="Configuring Amazon Connection Manager to store staging data in S3" width="566" height="553" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/008-sql-server-to-snowflake-configure-s3-target-connection-entering-access-and-secret-keys.png 566w, https://zappysys.com/blog/wp-content/uploads/2019/12/008-sql-server-to-snowflake-configure-s3-target-connection-entering-access-and-secret-keys-300x293.png 300w" sizes="(max-width: 566px) 100vw, 566px" /><p id="caption-attachment-8561" class="wp-caption-text">Configuring Amazon Connection Manager to store staging data in S3</p></div></li>
<li>Then in the Export CSV Task window, in <strong>Target</strong> tab configure it similarly:
<div id="attachment_8698" style="width: 637px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8698" class="size-full wp-image-8698" src="https://zappysys.com/blog/wp-content/uploads/2019/12/006-sql-server-to-snowflake-configure-s3-target-path-to-export-csv-files-to-s3-2.png" alt="Export CSV Task: configuring target to store staging data in S3" width="627" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/006-sql-server-to-snowflake-configure-s3-target-path-to-export-csv-files-to-s3-2.png 627w, https://zappysys.com/blog/wp-content/uploads/2019/12/006-sql-server-to-snowflake-configure-s3-target-path-to-export-csv-files-to-s3-2-300x284.png 300w" sizes="(max-width: 627px) 100vw, 627px" /><p id="caption-attachment-8698" class="wp-caption-text">Export CSV Task: configuring target to store staging data in S3</p></div>
<p>Another option you may consider is to use <a href="https://zappysys.com/blog/ssis-amazon-s3-storage-task-examples-download-upload-move-delete-files-folders/">Amazon Storage Task</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-blob-storage-task/">Azure Storage Task</a> to upload files to S3 in a separate step after the Export CSV Step. For this perform the following steps.</p>
<ol>
<li>On the Target tab, set Save Mode to <strong>Save to Path (Local Disk) instead of Connection to S3 or Azure</strong>.</li>
<li>Drag &amp; Drop <a href="https://zappysys.com/blog/ssis-amazon-s3-storage-task-examples-download-upload-move-delete-files-folders/">Amazon Storage Task</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-blob-storage-task/">Azure Storage Task</a>  and connect with the previous Export CSV Step</li>
<li>Configure Storage Task to upload Local files to S3 or Azure Blob Storage.</li>
<li>Continue to the next section for more instructions.</li>
</ol>
</li>
</ol>
<h3>Add Execute Process Task to create a staging area</h3>
<p>We are ready to add Execute Process Task to create a staging area in Snowflake. Again, depending on where you will store staging files, Snowflake&#8217;s local storage or Amazon S3, use one of the approaches below:</p>
<p><strong>Create Snowflake local staging</strong></p>
<div id="attachment_8562" style="width: 788px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8562" class="wp-image-8562 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/009-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage.png" alt="Creating a local stage in Snowflake using SnowSQL command-line tool and SSIS" width="778" height="314" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/009-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage.png 778w, https://zappysys.com/blog/wp-content/uploads/2019/12/009-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage-300x121.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/12/009-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage-768x310.png 768w" sizes="(max-width: 778px) 100vw, 778px" /><p id="caption-attachment-8562" class="wp-caption-text">Creating a local stage in Snowflake using SnowSQL command-line tool and SSIS</p></div>
<p>File path:</p>
<p><code>C:\Program Files\Snowflake SnowSQL\snowsql.exe</code></p>
<p>Arguments:</p>
<p><code>-q "CREATE OR REPLACE STAGE CustomersStaging" -d DEMO_DB -s Public</code></p>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> Replace <strong>DEMO_DB</strong> with the database name you are using. Also, do the same thing with schema <strong>Public</strong>.</div></div>
<p><strong>Create Amazon S3 staging</strong></p>
<p><img loading="lazy" decoding="async" class="wp-image-8563 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/011-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage-in-s3.png" alt="Creating an Amazon S3 stage in Snowflake using SnowSQL command-line tool and SSIS" width="737" height="314" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/011-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage-in-s3.png 737w, https://zappysys.com/blog/wp-content/uploads/2019/12/011-sql-server-to-snowflake-configure-snow-sql-to-create-a-stage-in-s3-300x128.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></p>
<p>Creating an Amazon S3 stage in Snowflake using SnowSQL command-line tool and SSISFile path:</p>
<p><code>C:\Program Files\Snowflake SnowSQL\snowsql.exe</code></p>
<p>Arguments:</p>
<p><code>CREATE OR REPLACE STAGE CustomersStaging url='s3://your-bucket-name/destinationFolder/' credentials=(aws_key_id='AKIAXXXXXXXXXXXXXXXX' aws_secret_key='6p1ayaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaLXz88')</code></p>
<h3>Add Execute Process Task to upload files to the staging area (local staging approach only)</h3>
<p>We still need to upload CSV files that were saved locally for local Snowflake staging. So add another Execute Process Task and configure it similarly:</p>
<h3><img loading="lazy" decoding="async" class="wp-image-8564 size-full" style="font-size: 16px;" src="https://zappysys.com/blog/wp-content/uploads/2019/12/010-sql-server-to-snowflake-configure-snow-sql-to-put-CSV-files-into-stage.png" alt="Uploading local CSV files to Snowflake stage using SnowSQL command-line tool and SSIS" width="726" height="314" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/010-sql-server-to-snowflake-configure-snow-sql-to-put-CSV-files-into-stage.png 726w, https://zappysys.com/blog/wp-content/uploads/2019/12/010-sql-server-to-snowflake-configure-snow-sql-to-put-CSV-files-into-stage-300x130.png 300w" sizes="(max-width: 726px) 100vw, 726px" /></h3>
<p>Uploading local CSV files to Snowflake stage using SnowSQL command-line tool and SSISFile path:</p>
<p><code>C:\Program Files\Snowflake SnowSQL\snowsql.exe</code></p>
<p>Arguments:</p>
<p><code>-q "PUT file://e:/temp/*.csv @DEMO_DB.PUBLIC.CustomersStaging"</code></p>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF8B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE:</strong> e:/temp/ is a directory we used in Export CSV Task. Replace <strong>DEMO_DB</strong> with the database name you are using. Also, do the same thing with schema <strong>Public</strong>.</div></div>
<h3>Add Execute Process Task to copy files from the Snowflake/Amazon S3 stage to Snowflake table</h3>
<p>Finally, add the final Execute Process Task to issue a command to load files from the stage into a real Snowflake table:</p>
<div id="attachment_8565" style="width: 736px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8565" class="wp-image-8565 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/012-sql-server-to-snowflake-configure-snow-sql-to-copy-data-from-stage-to-table.png" alt="Copying data from a staging area to a Snowflake table using SSIS" width="726" height="313" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/012-sql-server-to-snowflake-configure-snow-sql-to-copy-data-from-stage-to-table.png 726w, https://zappysys.com/blog/wp-content/uploads/2019/12/012-sql-server-to-snowflake-configure-snow-sql-to-copy-data-from-stage-to-table-300x129.png 300w" sizes="(max-width: 726px) 100vw, 726px" /><p id="caption-attachment-8565" class="wp-caption-text">Copying data from a staging area to a Snowflake table using SSIS</p></div>
<p>File path:</p>
<p><code>C:\Program Files\Snowflake SnowSQL\snowsql.exe</code></p>
<p>Arguments:</p>
<p><code>-q "COPY INTO CUSTOMERS FROM @CustomersStaging file_format = (format_name = 'GZIPCSVFORMAT')" -d DEMO_DB -s Public</code></p>
<h3>Execute the package</h3>
<p>We are ready to execute the package, so just run it. In this example you see the workflow when using Amazon S3 as stage:</p>
<div id="attachment_8569" style="width: 359px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8569" class="wp-image-8569 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-execute-the-package.png" alt="Executing an SSIS package to load data from Snowflake to SQL Server" width="349" height="389" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-execute-the-package.png 349w, https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-execute-the-package-269x300.png 269w" sizes="(max-width: 349px) 100vw, 349px" /><p id="caption-attachment-8569" class="wp-caption-text">Executing an SSIS package to load data from Snowflake to SQL Server</p></div>
<h3>The Results</h3>
<p>Once the package executes, we can check the results:</p>
<div id="attachment_8570" style="width: 363px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8570" class="wp-image-8570 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/014-sql-server-to-snowflake-the-results-ssis-package.png" alt="Successful execution of SSIS package when loading data from Snowflake to SQL Server" width="353" height="390" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/014-sql-server-to-snowflake-the-results-ssis-package.png 353w, https://zappysys.com/blog/wp-content/uploads/2019/12/014-sql-server-to-snowflake-the-results-ssis-package-272x300.png 272w" sizes="(max-width: 353px) 100vw, 353px" /><p id="caption-attachment-8570" class="wp-caption-text">Successful execution of SSIS package when loading data from Snowflake to SQL Server</p></div>
<p>If we go to Snowflake and execute the SELECT query, we see all 10M customers loaded:</p>
<div id="attachment_8568" style="width: 728px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8568" class="wp-image-8568 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-the-results.png" alt="Successful loading of 10 million rows from SQL Server to Snowflake using SSIS and ZappySys SSIS PowerPack" width="718" height="396" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-the-results.png 718w, https://zappysys.com/blog/wp-content/uploads/2019/12/013-sql-server-to-snowflake-the-results-300x165.png 300w" sizes="(max-width: 718px) 100vw, 718px" /><p id="caption-attachment-8568" class="wp-caption-text">Successful loading of 10 million rows from SQL Server to Snowflake using SSIS and ZappySys SSIS PowerPack</p></div>
<p>All done in less than 3 mins:</p>
<p><img loading="lazy" decoding="async" class="wp-image-8702 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/12/017-sql-server-to-snowflake-loads-data-in-less-than-3-mins-e1580146280905.png" alt="Loading 10 million rows from SQL Server to Snowflake using SSIS and ZappySys SSIS PowerPack just in 3 minutes" width="717" height="423" srcset="https://zappysys.com/blog/wp-content/uploads/2019/12/017-sql-server-to-snowflake-loads-data-in-less-than-3-mins-e1580146280905.png 717w, https://zappysys.com/blog/wp-content/uploads/2019/12/017-sql-server-to-snowflake-loads-data-in-less-than-3-mins-e1580146280905-300x177.png 300w" sizes="(max-width: 717px) 100vw, 717px" /></p>
<h2>Conclusion</h2>
<p style="text-align: justify;">We achieved just what we aimed for &#8211; we loaded 10 million rows from SQL Server to Snowflake; all done in less than 3 minutes! Two approaches were taken into consideration: in one we staged CSV files in the local Snowflake stage and in the other we staged files in the Amazon S3 bucket. To accomplish this we used <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">ZappySys Export CSV Task</a>, which allowed us to export data from the SQL Server view to CSV format, split files into smaller ones, zip them and store them locally or upload to the Amazon S3 bucket. Finally, we used a standard SSIS Task &#8220;Execute Process Task&#8221; to issue Snowflake commands such as creating the stage area in Snowflake, uploading CSVs into the local stage and loading data into the Snowflake table.</p>
<h2>Download a sample package</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/12/Load-10M-rows-from-SQL-Server-into-Snowflake-1.zip">Load 10M rows from SQL Server into Snowflake.dtsx.zip</a></p>
<h2>References</h2>
<p><a href="https://docs.snowflake.net/manuals/user-guide/data-load-bulk.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/user-guide/data-load-bulk.html</a></p>
<p><a href="https://docs.snowflake.net/manuals/user-guide/snowsql.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/user-guide/snowsql.html</a></p>
<p><a href="https://docs.snowflake.net/manuals/user-guide/data-load-s3-create-stage.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/user-guide/data-load-s3-create-stage.html</a></p>
<p><a href="https://docs.snowflake.net/manuals/sql-reference/sql/create-file-format.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/sql-reference/sql/create-file-format.html</a></p>
<p><a href="https://docs.snowflake.net/manuals/sql-reference/sql/put.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/sql-reference/sql/put.html</a></p>
<p><a href="https://docs.snowflake.net/manuals/sql-reference/sql/copy-into-table.html" target="_blank" rel="noopener">https://docs.snowflake.net/manuals/sql-reference/sql/copy-into-table.html</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/load-10-million-rows-from-sql-server-to-snowflake/">Load 10M rows from SQL Server to Snowflake in 3 minutes</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Import Amazon S3 files into SQL Server (CSV/JSON/XML Driver)</title>
		<link>https://zappysys.com/blog/import-amazon-s3-files-sql-server-csv-json-xml-driver/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 12 Aug 2019 16:32:00 +0000</pubDate>
				<category><![CDATA[Amazon S3 CSV Driver]]></category>
		<category><![CDATA[Amazon S3 JSON Driver]]></category>
		<category><![CDATA[Amazon S3 XML Driver]]></category>
		<category><![CDATA[ODBC Drivers]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7206</guid>

					<description><![CDATA[<p>Introduction There might be a case when you have many CSV, JSON or XML files in Amazon S3 bucket and you want them to be imported straight into a SQL Server table. Here come ZappySys ODBC PowerPack and ZappySys Data Gateway (part of ODBC PowerPack) which will enable you to accomplish that. ZappySys ODBC PowerPack includes powerful [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-amazon-s3-files-sql-server-csv-json-xml-driver/">Import Amazon S3 files into SQL Server (CSV/JSON/XML Driver)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p style="text-align: justify;"><img loading="lazy" decoding="async" class="alignnone wp-image-7581 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/06/s3-to-sql-150x150.png" alt="" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/s3-to-sql-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/06/s3-to-sql-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/06/s3-to-sql.png 400w" sizes="(max-width: 150px) 100vw, 150px" />There might be a case when you have many CSV, JSON or XML files in <a href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">Amazon S3</a> bucket and you want them to be imported straight into a SQL Server table. Here come <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> and <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> (part of ODBC PowerPack) which will enable you to accomplish that. ZappySys ODBC PowerPack includes powerful Amazon S3 CSV, Amazon S3 JSON and Amazon S3 XML drivers that let you connect to an S3 bucket and read the contents from the files in the bucket. Bringing in ZappySys Data Gateway allows doing that right from a SQL Server. Let&#8217;s begin and see how to import Amazon S3 files into SQL Server.</p>
<p>&nbsp;</p>
<p>These drivers are related to this article:</p>
<div class="content_block" id="custom_post_widget-7227"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//i1.wp.com/zappysys.com/images/odbc-powerpack/odbc-amazon-s3-xml-driver.png?w=100&amp;ssl=1" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-xml-files/" target="_blank" rel="noopener">Amazon S3 Driver (for XML Files)</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-7229"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="//i0.wp.com/zappysys.com/images/odbc-powerpack/odbc-amazon-s3-json-driver.png?w=100&amp;ssl=1" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-json-files/" target="_blank" rel="noopener">Amazon S3 Driver (for JSON Files)</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-7233"><div style="display: table-row; background: #f7f7f7;">
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc;"><img loading="lazy" decoding="async" style="vertical-align: middle; width: 50px; height: 50px; max-width: 50px;" src="https://i2.wp.com/zappysys.com/images/odbc-powerpack/odbc-amazon-s3-csv-driver.png?w=100&amp;ssl=1" alt="Web API Destination" width="50" height="50" /></div>
<div style="display: table-cell; padding: 1em; border: 1px solid #ccc; border-left: none; width: 100%;"><a href="//zappysys.com/products/odbc-powerpack/amazon-s3-odbc-driver-csv-files/" target="_blank" rel="noopener">Amazon S3 Driver (for CSV Files)</a></div>
</div></div>
<h2>Prerequisites</h2>
<ol>
<li>Have an <a href="https://aws.amazon.com/" target="_blank" rel="noopener">AWS</a> account.</li>
<li>Existing <a href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">Amazon S3</a> bucket.</li>
<li>SQL Server instance installed (can be a <a href="https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-2016-express-localdb" target="_blank" rel="noopener">SQL Server Express LocalDB</a> instance).</li>
<li><a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener">SQL Server Management Studio</a> (SSMS) installed.</li>
<li><a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed (must be installed on a Windows machine; can be a different machine than SQL Server is installed on).</li>
</ol>
<h2>Getting started</h2>
<p style="text-align: justify;">We will start from a simple example of how to load contacts from a JSON that are located in Amazon S3 bucket, then we will proceed by loading contacts from many XML files that are compressed in ZIP, and finally, we will traverse many folders and subfolders to gather CSVs and load contacts from them.</p>
<h2>Step-by-Step &#8211; Import JSON file located at Amazon S3 into SQL Server</h2>
<h3><span style="font-size: 14pt;">Open and configure ZappySys Data Gateway</span></h3>
<div class="content_block" id="custom_post_widget-7369">Now let's look at steps to configure Data Gateway after installation:
<ol>
 	<li>Assuming you have installed <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> using default options (Which also enables Data Gateway Service)</li>
 	<li>Search "Gateway" in your start menu and click ZappySys Data Gateway
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/start-menu-open-zappysys-data-gateway.png" alt="Open ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Open ZappySys Data Gateway</p>

</div></li>
 	<li>First make sure Gateway Service is running (Verify Start icon is disabled)</li>
 	<li>Also verify Port on General Tab
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ZappySys-data-gateway-port-5000.png" alt="Port Number setting on ZappySys Data Gateway" /></a>
<p class="wp-caption-text">Port Number setting on ZappySys Data Gateway</p>

</div></li>
 	<li>Now go to Users tab. <strong>Click Add</strong> icon to add a new user. Check Is admin to give access to all data sources you add in future. If you don't check admin then you have to manually configure user permission for each data source.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/zappysys-data-gateway-add-user.png" alt="Add Data Gateway User" /></a>
<p class="wp-caption-text">Add Data Gateway User</p>

</div></li>
</ol>
&nbsp;</div>
<h3><a id="create-json-data-source"></a>Create an Amazon S3 JSON data source in ZappySys Data Gateway</h3>
<ol>
<li>The first thing you will have to do is to create a data source in ZappySys Data Gateway. Just click <strong>Add</strong> button, give the data source a name, e.g. &#8220;<strong>MyContactsJSON</strong>&#8220;, and then select <strong>Native &#8211; ZappySys Amazon S3 JSON Driver</strong>:
<div id="attachment_7373" style="width: 637px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7373" class="wp-image-7373 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/100-create-new-data-source-in-data-gateway-to-load-json-files-into-sql-server.png" alt="Adding a JSON data source in ZappySys Data Gateway to load it from Amazon S3 bucket into SQL Server" width="627" height="552" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/100-create-new-data-source-in-data-gateway-to-load-json-files-into-sql-server.png 627w, https://zappysys.com/blog/wp-content/uploads/2019/06/100-create-new-data-source-in-data-gateway-to-load-json-files-into-sql-server-300x264.png 300w" sizes="(max-width: 627px) 100vw, 627px" /><p id="caption-attachment-7373" class="wp-caption-text">Adding a JSON data source in ZappySys Data Gateway to load it from Amazon S3 bucket into SQL Server</p></div></li>
<li>Then click <strong>Edit</strong> and add the Data Gateway user you created in <strong>Users</strong> tab. We will use this user later when adding a Linked Server to the Data Gateway to authenticate:
<div id="attachment_7557" style="width: 688px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7557" class="wp-image-7557 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/125-add-data-gateway-user-to-json-data-source-to-get-json-data-into-sql-server.png" alt="Adding a user to the newly created JSON data source" width="678" height="627" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/125-add-data-gateway-user-to-json-data-source-to-get-json-data-into-sql-server.png 678w, https://zappysys.com/blog/wp-content/uploads/2019/06/125-add-data-gateway-user-to-json-data-source-to-get-json-data-into-sql-server-300x277.png 300w" sizes="(max-width: 678px) 100vw, 678px" /><p id="caption-attachment-7557" class="wp-caption-text">Adding a user to the newly created Amazon S3 JSON data source</p></div></li>
<li>Once you do that, then click <strong>Edit</strong> to configure the data source:
<div id="attachment_7374" style="width: 637px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7374" class="wp-image-7374 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/200-modify-data-source-in-data-gateway-to-load-json-files-into-sql-server.png" alt="Preparing to configure the JSON data source to load a JSON from Amazon S3 bucket to SQL Server" width="627" height="445" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/200-modify-data-source-in-data-gateway-to-load-json-files-into-sql-server.png 627w, https://zappysys.com/blog/wp-content/uploads/2019/06/200-modify-data-source-in-data-gateway-to-load-json-files-into-sql-server-300x213.png 300w" sizes="(max-width: 627px) 100vw, 627px" /><p id="caption-attachment-7374" class="wp-caption-text">Preparing to configure the Amazon S3 JSON data source to load a JSON from Amazon S3 bucket to SQL Server</p></div></li>
<li>When a window opens, click <strong>Click here to Configure the Connection</strong> and enter your <em>Access Key</em> and <em>Secret Key</em>:
<div id="attachment_7376" style="width: 655px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7376" class="wp-image-7376 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/300-create-connection-to-amazon-s3-to-load-json-into-sql-server-1.png" alt="Configuring the authentication to Amazon S3 bucket in ZappySys Data Gateway" width="645" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/300-create-connection-to-amazon-s3-to-load-json-into-sql-server-1.png 645w, https://zappysys.com/blog/wp-content/uploads/2019/06/300-create-connection-to-amazon-s3-to-load-json-into-sql-server-1-276x300.png 276w" sizes="(max-width: 645px) 100vw, 645px" /><p id="caption-attachment-7376" class="wp-caption-text">Configuring the authentication to Amazon S3 bucket in ZappySys Data Gateway</p></div></li>
<li>After that, select a JSON file you want to load, and then click <strong>Select Filter</strong> button to choose data you want to be displayed in SQL Server:
<div id="attachment_7377" style="width: 668px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7377" class="wp-image-7377 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/400-configure-amazon-s3-json-data-source-to-load-data-into-sql-server.png" alt="Configuring the JSON data source to load a JSON from Amazon S3 bucket into SQL Server" width="658" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/400-configure-amazon-s3-json-data-source-to-load-data-into-sql-server.png 658w, https://zappysys.com/blog/wp-content/uploads/2019/06/400-configure-amazon-s3-json-data-source-to-load-data-into-sql-server-281x300.png 281w" sizes="(max-width: 658px) 100vw, 658px" /><p id="caption-attachment-7377" class="wp-caption-text">Configuring the JSON data source to load a JSON from Amazon S3 bucket into SQL Server</p></div></li>
<li>Go to the <strong>Preview</strong> tab and click the <strong>Preview Data</strong> button to make sure everything is configured correctly and preview the results:
<div id="attachment_7378" style="width: 668px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7378" class="wp-image-7378 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/500-preview-the-results-of-amazon-s3-json-data-source-to-load-data-into-sql-server.png" alt="Previewing JSON data in the data source based on Amazon S3 JSON Driver" width="658" height="653" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/500-preview-the-results-of-amazon-s3-json-data-source-to-load-data-into-sql-server.png 658w, https://zappysys.com/blog/wp-content/uploads/2019/06/500-preview-the-results-of-amazon-s3-json-data-source-to-load-data-into-sql-server-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/06/500-preview-the-results-of-amazon-s3-json-data-source-to-load-data-into-sql-server-300x298.png 300w" sizes="(max-width: 658px) 100vw, 658px" /><p id="caption-attachment-7378" class="wp-caption-text">Previewing JSON data in the data source based on Amazon S3 JSON Driver</p></div></li>
</ol>
<p style="text-align: justify;">Now you are ready to create a Linked Server and connect to the data source you just created. If you used &#8220;<strong>MyContactsJSON</strong>&#8221; as the data source name, make sure to use the same name when creating a Linked Server.</p>
<h3><a id="set-up-a-sql-server-linked-server"></a>Set up a SQL Server Linked Server</h3>
<div class="content_block" id="custom_post_widget-5432">Once you configured the data source in Gateway, we can now set up a Linked Server in a SQL Server.
<ol style="margin-left: 10px;">
 	<li>Open SSMS and connect to a SQL Server.</li>
 	<li>Go to Root &gt; Server Objects &gt; Linked Servers node. Right click and click <strong>New Linked Server...
</strong>
<div class="wp-caption alignnone">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/create-new-linked-server-ssms.png" alt="Add Linked Server in SQL Server" />
</a>
<p class="wp-caption-text">Adding Linked Server in SQL Server</p>

</div></li>
 	<li>Now enter the linked server name, select Provider as SQL Native Client.</li>
 	<li>Enter data source as <strong><span class="lang:default decode:true crayon-inline">GatewayServerName,PORT_NUMBER</span></strong> where server name is where ZappySys Gateway is running (can be the same as SQL Server machine or a remote machine). Default PORT_NUMBER is 5000 but confirm that on the Gateway &gt; General tab in case it's different.</li>
 	<li>Enter Catalog Name. This must match name from Data gateway Data sources grid &gt; Name column
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/11/ssms-sql-server-configure-linked-server-2.png" alt="Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection" />
</a>
<p class="wp-caption-text">Configure Linked Server Provider, Catalog, Server, Port for ZappySys Data Gateway Connection</p>
</div>
<div style="color: #31708f;background-color: #d9edf7;border-color: #bce8f1;padding: 15px;margin-bottom: 20px;border: 1px solid transparent;border-radius: 4px;">
<strong>INFO:</strong><br/>
<ul>
    <li>
      For <strong>SQL Server 2012, 2014, 2016, 2017, and 2019</strong>, use the <em>SQL Server Native Client 11.0</em> as the Provider.
    </li>
    <li>
      For <strong>SQL Server 2022 or higher</strong>, use the <em>Microsoft OLE DB Driver for SQL Server</em> as the Provider.
    </li>
  </ul>
</div></li>
 	<li>Click on Security Tab and select the last option "<strong>Be made using this security context</strong>". Enter your gateway user account here.
<div class="wp-caption alignnone">
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5456" src="https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2.png" alt="" width="690" height="625" srcset="https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2.png 690w, https://zappysys.com/blog/wp-content/uploads/2018/11/add-linked-server-sql-server-3-security-2-300x272.png 300w" sizes="(max-width: 690px) 100vw, 690px" />
<p class="wp-caption-text">Configuring Linked Server credentials</p>
</li>
<li>
        <p>Optional: Under the Server Options Tab, Enable <b>RPC</b> and <b>RPC Out</b> and Disable Promotion of Distributed Transactions<b>(MSDTC)</b>.</p>
		<div class="wp-caption alignnone">
			<img decoding="async" class="block margin-bottom-10 img-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/11/linked-server-options-rpc-msdtc.png" title="RPC and MSDTC Settings" alt="RPC and MSDTC Settings" />
			<p class="wp-caption-text">RPC and MSDTC Settings</p>
		</div>
        <hr />
        <p>
            You need to enable RPC Out if you plan to use <b><i>EXEC(...) AT [MY_LINKED_SERVER_NAME]</i></b> rather than OPENQUERY.
            <br />
            If don't enabled it, you will encounter the <i>'Server "MY_LINKED_SERVER_NAME" is not configured for RPC'</i> error.
        </p>
        <p>
            Query Example:
            <code class="sql">EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</code>
        </p>
        <hr />
        <p>
            If you plan to use <b><i>'INSERT INTO...EXEC(....) AT [MY_LINKED_SERVER_NAME]'</i></b> in that case you need to Disable Promotion of Distributed Transactions(MSDTC).
            <br />
            If don't disabled it, you will encounter the <i>'The operation could not be performed because OLE DB provider "SQLNCLI11/MSOLEDBSQL" for linked server "MY_LINKED_SERVER_NAME" was unable to begin a distributed transaction.'</i> error.
        </p>
        <p>
            Query Example:
<pre class="">Insert Into dbo.Products 
EXEC('Select * from Products') AT [MY_LINKED_SERVER_NAME]</pre>
        </p>
        <hr />
</li>
 	<li>Click OK to save the Linked Server.</li>
</ol></div>
<h3>Execute the SQL query</h3>
<p style="text-align: justify;">Once you created the Linked Server to ZappySys Data Gateway, you are ready to execute the SQL query and load data into SQL Server. Supposedly, you created the Linked Server with the name &#8220;GATEWAY&#8221;, then open SSMS and execute this query:</p>
<p><code>SELECT * INTO MyContacts FROM openquery([GATEWAY], 'SELECT * FROM $')<br />
SELECT * FROM MyContacts</code></p>
<h3>The results</h3>
<p>You should see similar results after you execute the query:</p>
<div id="attachment_7536" style="width: 609px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7536" class="wp-image-7536 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/600-the-results-of-importing-amazon-s3-data-into-sql-server-using-json-driver.png" alt="" width="599" height="257" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/600-the-results-of-importing-amazon-s3-data-into-sql-server-using-json-driver.png 599w, https://zappysys.com/blog/wp-content/uploads/2019/06/600-the-results-of-importing-amazon-s3-data-into-sql-server-using-json-driver-300x129.png 300w" sizes="(max-width: 599px) 100vw, 599px" /><p id="caption-attachment-7536" class="wp-caption-text">The results of getting JSON data straight from Amazon S3 bucket using ZappySys Amazon S3 JSON driver</p></div>
<p>Now we are ready to proceed to the next section and import many XML files at once.</p>
<h2>Step-by-Step &#8211; Import many XML files located at Amazon S3 into SQL Server</h2>
<h3>Overview</h3>
<p>Supposedly, you have many XMLs where each one is zipped and you want to load them all into a SQL Server table:</p>
<div id="attachment_7548" style="width: 668px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7548" class="wp-image-7548 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/650-load-many-compressed-xml-files-from-amazon-s3-bucket-into-sql-server-1.png" alt="Zipped XML files located in Amazon S3 bucket to be loaded into SQL Server" width="658" height="311" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/650-load-many-compressed-xml-files-from-amazon-s3-bucket-into-sql-server-1.png 658w, https://zappysys.com/blog/wp-content/uploads/2019/06/650-load-many-compressed-xml-files-from-amazon-s3-bucket-into-sql-server-1-300x142.png 300w" sizes="(max-width: 658px) 100vw, 658px" /><p id="caption-attachment-7548" class="wp-caption-text">Zipped XML files located in Amazon S3 bucket to be loaded into SQL Server</p></div>
<p>The first thing you will have to do is to create a data source, based on ZappySys Amazon S3 XML Driver. Let&#8217;s proceed and just do that.</p>
<h3>Create an Amazon S3 XML data source in ZappySys Data Gateway</h3>
<p>Follow the same steps as in <a href="#create-json-data-source">Create an Amazon S3 JSON data source in ZappySys Data Gateway</a> section when adding a new data source, except for these two steps:</p>
<ol>
<li>When adding a data source select <strong>Native &#8211; ZappySys Amazon S3 XML Driver</strong> as <em>Connector Type</em>:
<div id="attachment_7573" style="width: 430px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7573" class="wp-image-7573 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/685-create-new-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver.png" alt="Choosing &quot;ZappySys Amazon S3 XML Driver&quot; to load XMLs to SQL Server" width="420" height="296" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/685-create-new-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver.png 420w, https://zappysys.com/blog/wp-content/uploads/2019/06/685-create-new-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver-300x211.png 300w" sizes="(max-width: 420px) 100vw, 420px" /><p id="caption-attachment-7573" class="wp-caption-text">Choosing &#8220;ZappySys Amazon S3 XML Driver&#8221; to load XMLs to SQL Server</p></div></li>
<li>Then click <strong>Edit</strong> and edit the data source similarly like in this window:
<div id="attachment_7547" style="width: 668px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7547" class="wp-image-7547 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/700-configure-amazon-s3-xml-data-source-to-load-into-sql-server-1.png" alt="Configuring data source based on ZappySys XML Driver to load XMLs into SQL Server" width="658" height="516" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/700-configure-amazon-s3-xml-data-source-to-load-into-sql-server-1.png 658w, https://zappysys.com/blog/wp-content/uploads/2019/06/700-configure-amazon-s3-xml-data-source-to-load-into-sql-server-1-300x235.png 300w" sizes="(max-width: 658px) 100vw, 658px" /><p id="caption-attachment-7547" class="wp-caption-text">Configuring data source based on ZappySys Amazon S3 XML Driver to load XMLs into SQL Server</p></div></li>
</ol>
<p>Now we are ready to set up a Linked Server to this newly created data source.</p>
<h3>Set up a SQL Server Linked Server</h3>
<p style="text-align: justify;">Follow the very same steps from the section above where we <a href="#set-up-a-sql-server-linked-server">added the Linked Server to a JSON data source</a>, except that change <em>Datasource</em> property of the Linked Server to match the name of the Amazon S3 XML data source you created. Once you do that, you are ready to load XMLs into your SQL Server.</p>
<h3>Execute the SQL query</h3>
<p>Again, if you created the Linked Server with name &#8220;GATEWAY&#8221;, execute this SQL query in SSMS:</p>
<p><code>SELECT * INTO MyContacts FROM openquery([GATEWAY], 'SELECT * FROM $')<br />
SELECT * FROM MyContacts</code></p>
<h3>The results</h3>
<p>You should see a similar view once you execute the query:</p>
<div id="attachment_7550" style="width: 614px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7550" class="wp-image-7550 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/750-the-result-of-importing-xml-data-from-amazon-s3-into-sql-server.png" alt="The data of many XMLs loaded from Amazon S3 bucket into SQL Server" width="604" height="360" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/750-the-result-of-importing-xml-data-from-amazon-s3-into-sql-server.png 604w, https://zappysys.com/blog/wp-content/uploads/2019/06/750-the-result-of-importing-xml-data-from-amazon-s3-into-sql-server-300x179.png 300w" sizes="(max-width: 604px) 100vw, 604px" /><p id="caption-attachment-7550" class="wp-caption-text">The data of many XMLs loaded from Amazon S3 bucket into SQL Server</p></div>
<p>Now we are ready to move to the next section and recursively scan CSVs and load them into SQL Server.</p>
<h2>Step-by-Step &#8211; Import CSV file located at Amazon S3 into SQL Server</h2>
<h3>Overview</h3>
<p>Let&#8217;s say you have many CSVs that are located in a folder tree, including subfolders and you want them all in your SQL Server:</p>
<div id="attachment_7552" style="width: 666px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7552" class="wp-image-7552 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/800-load-many-csv-files-from-subfolders-from-amazon-s3-bucket-into-sql-server.png" alt="Many CSV files located in Amazon S3 bucket folders and subfolders to be loaded into SQL Server" width="656" height="299" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/800-load-many-csv-files-from-subfolders-from-amazon-s3-bucket-into-sql-server.png 656w, https://zappysys.com/blog/wp-content/uploads/2019/06/800-load-many-csv-files-from-subfolders-from-amazon-s3-bucket-into-sql-server-300x137.png 300w" sizes="(max-width: 656px) 100vw, 656px" /><p id="caption-attachment-7552" class="wp-caption-text">Many CSV files located in Amazon S3 bucket folders and subfolders to be loaded into SQL Server</p></div>
<p>We will follow the same steps to accomplish that as we did for loading JSON and XMLs.</p>
<h3>Create an Amazon S3 CSV data source in ZappySys Data Gateway</h3>
<p>Follow the steps as in <a href="#create-json-data-source">Create an Amazon S3 JSON data source in ZappySys Data Gateway</a> section when adding a new data source, except for these two steps:</p>
<ol>
<li>When adding a CSV data source select <strong>Native &#8211; ZappySys Amazon S3 CSV Driver</strong> as <em>Connector Type</em>:
<div id="attachment_7574" style="width: 430px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7574" class="wp-image-7574 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/875-create-new-csv-data-source-in-data-gateway-to-load-csv-files-into-sql-selver.png" alt="Choosing &quot;ZappySys Amazon S3 CSV Driver&quot; to load CSVs to SQL Server" width="420" height="296" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/875-create-new-csv-data-source-in-data-gateway-to-load-csv-files-into-sql-selver.png 420w, https://zappysys.com/blog/wp-content/uploads/2019/06/875-create-new-csv-data-source-in-data-gateway-to-load-csv-files-into-sql-selver-300x211.png 300w" sizes="(max-width: 420px) 100vw, 420px" /><p id="caption-attachment-7574" class="wp-caption-text">Choosing &#8220;ZappySys Amazon S3 CSV Driver&#8221; to load CSVs to SQL Server</p></div></li>
<li>Then click <strong>Edit</strong> and edit the data source similarly:
<div id="attachment_7554" style="width: 752px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7554" class="wp-image-7554 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/900-configure-amazon-s3-csv-data-source-to-scan-csvs-recursively-and-load-into-sql-server.png" alt="Configuring data source based on ZappySys CSV Driver to load CSVs into SQL Server" width="742" height="582" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/900-configure-amazon-s3-csv-data-source-to-scan-csvs-recursively-and-load-into-sql-server.png 742w, https://zappysys.com/blog/wp-content/uploads/2019/06/900-configure-amazon-s3-csv-data-source-to-scan-csvs-recursively-and-load-into-sql-server-300x235.png 300w" sizes="(max-width: 742px) 100vw, 742px" /><p id="caption-attachment-7554" class="wp-caption-text">Configuring data source based on ZappySys Amazon S3 CSV Driver to load CSVs into SQL Server</p></div></li>
</ol>
<p>Now we are ready to proceed and add a Linked Server to this data source.</p>
<h3>Set up a SQL Server Linked Server</h3>
<p style="text-align: justify;">Again, follow the very same steps from the section above where we <a href="#set-up-a-sql-server-linked-server">added the Linked Server to a JSON data source</a>, except that change <em>Datasource</em> property of the Linked Server to match the name of the Amazon S3 CSV data source we created. Once you do that, you are ready to load CSVs into your SQL Server.</p>
<h3>Execute the SQL query</h3>
<p>Once again, if you created the Linked Server with name &#8220;GATEWAY&#8221;, execute this SQL query in SSMS:</p>
<p><code>SELECT * INTO MyContacts FROM openquery([GATEWAY], 'SELECT * FROM $')<br />
SELECT * FROM MyContacts</code></p>
<h3>The results</h3>
<p>You should see a similar view, once you execute the query:</p>
<div id="attachment_7559" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7559" class="wp-image-7559 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/950-the-result-of-importing-multiple-csv-files-from-amazon-s3-into-sql-server-1.png" alt="The results of loading many CSVs from Amazon S3 bucket into SQL Server" width="758" height="365" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/950-the-result-of-importing-multiple-csv-files-from-amazon-s3-into-sql-server-1.png 758w, https://zappysys.com/blog/wp-content/uploads/2019/06/950-the-result-of-importing-multiple-csv-files-from-amazon-s3-into-sql-server-1-300x144.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-7559" class="wp-caption-text">The results of loading many CSVs from Amazon S3 bucket into SQL Server</p></div>
<h2>Conclusion</h2>
<p style="text-align: justify;">We had a goal to import Amazon S3 files into SQL Server from SQL Server itself. We learned how to load JSON, XML and CSV files into SQL Server, which some of them were zipped and were located at different folders and subfolders. It was possible to accomplish that using <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ODBC PowerPack</a>, <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/" target="_blank" rel="noopener">ZappySys Data Gateway</a> and ODBC PowerPack drivers &#8211; Amazon S3 JSON Driver, Amazon S3 XML Driver, and Amazon S3 CSV Driver. At first, we created data sources in the Data Gateway, then we created Linked Servers in SQL Server and connected to ZappySys Data Gateway, which finally made it possible to load data from Amazon S3 bucket straight from SQL queries in SSMS.</p>
<h2>Check Amazon S3 Integration with Other BI Tools (Power BI, Excel, SSRS, MS Access, etc.)</h2>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<p>The post <a href="https://zappysys.com/blog/import-amazon-s3-files-sql-server-csv-json-xml-driver/">Import Amazon S3 files into SQL Server (CSV/JSON/XML Driver)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Read Amazon S3 Storage Files in SSIS (CSV, JSON, XML)</title>
		<link>https://zappysys.com/blog/read-amazon-storage-s3-files-ssis-csv-json-xml/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 16 Mar 2019 09:43:13 +0000</pubDate>
				<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS Amazon S3 Connection]]></category>
		<category><![CDATA[SSIS Amazon S3 CSV Source]]></category>
		<category><![CDATA[SSIS Amazon S3 JSON Source]]></category>
		<category><![CDATA[SSIS Amazon S3 XML Source]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6544</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw how to load data into Amazon S3. Now in this blog, we will see How to read Amazon S3 Storage 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 to multiple destinations [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-amazon-storage-s3-files-ssis-csv-json-xml/">Read Amazon S3 Storage 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/2019/03/s3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignleft wp-image-6547 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/s3-e1553183075864.png" alt="Amazon S3 - AWS Storage" width="150" height="150" /></a>In our previous blog we saw <a href="https://zappysys.com/blog/load-data-sql-server-to-amazon-s3/" target="_blank" rel="noopener">how to load data into Amazon S3</a>. Now in this blog, we will see <strong>How to read Amazon S3 Storage 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 perform File operations on Amazon S3 Files (e.g. Download, Upload, Create, Delete) then <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-amazon-storage-task/" target="_blank" rel="noopener">check these articles</a>.</p>
<p>In nutshell, this post will focus on how to Read Amazon S3 Storage CSV, JSON and XML Files using respective SSIS Source tasks.</p>
<p>&nbsp;</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: 35px"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-s3-csv-source/ssis-amazon-s3-csv-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 CSV File Source" width="32" height="32" /></td>
<td style="width: 356px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-source/" target="_blank" rel="noopener">Amazon S3 CSV File Source</a></td>
</tr>
<tr>
<td style="width: 35px"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-s3-csv-destination/ssis-amazon-s3-csv-file-destination.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 CSV File Destination" width="32" height="32" /></td>
<td style="width: 356px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-destination/" target="_blank" rel="noopener">Amazon S3 CSV File Destination</a></td>
</tr>
<tr>
<td style="width: 35px"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-s3-xml-source/ssis-amazon-s3-xml-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 XML File Source" width="32" height="32" /></td>
<td style="width: 356px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-xml-file-source/" target="_blank" rel="noopener">Amazon S3 XML File Source</a></td>
</tr>
<tr>
<td style="width: 35px"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-s3-json-source/ssis-amazon-s3-json-file-source.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 JSON File Source" width="32" height="32" /></td>
<td style="width: 356px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-json-file-source/" target="_blank" rel="noopener">Amazon S3 JSON File Source</a><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 Amazon S3 account access key / secret key.</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>What is Amazon S3 Storage</h2>
<p>Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. This means customers of all sizes and industries can use it to store and protect any amount of data for a range of use cases, such as websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides easy-to-use management features so you can organize your data and configure finely-tuned access controls to meet your specific business, organizational, and compliance requirements. Amazon S3 is designed for 99.999999999% (11 9&#8217;s) of durability, and stores data for millions of applications for companies all around the world.</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_amazon_aws_cloud" target="_blank" rel="noopener">SSIS Amazon S3 Source for CSV/JSON/XML File</a> that will help you in reading CSV, JSON and XML Files from Amazon S3 to the Local machine, Upload files(s) to Amazon S3 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 Amazon S3 Storage.</p>
<p>You can connect to your <a href="https://console.aws.amazon.com/?nc2=h_m_mc" target="_blank" rel="noopener">Amazon S3 Account</a> by entering your storage account credentials.</p>
<h2>Read Amazon S3 Storage Files in SSIS (CSV, JSON, XML)</h2>
<p>Let´s start with an example. In this SSIS Amazon S3 Source for CSV/JSON/XML File task example, we will read CSV/JSON/XML files from Amazon S3 Storage 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>Drag and Drop relevant Amazon S3 Source for CSV/JSON/XML File Task from the SSIS Toolbox.
<div id="attachment_6590" style="width: 710px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-add-tasks.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6590" class="wp-image-6590 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-add-tasks.png" alt="Add Amazon S3 Source Tasks" width="700" height="244" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-add-tasks.png 700w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-add-tasks-300x105.png 300w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-6590" class="wp-caption-text">Add Amazon S3 Source Tasks</p></div></li>
<li>Create a connection for Amazon S3 Storage Account.
<div id="attachment_6551" style="width: 765px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-select-connection-manager.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6551" class="wp-image-6551 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-select-connection-manager.png" alt="Create Amazon S3 Storage Connection" width="755" height="528" srcset="https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-select-connection-manager.png 755w, https://zappysys.com/blog/wp-content/uploads/2019/03/ssis-amazon-s3-source-select-connection-manager-300x210.png 300w" sizes="(max-width: 755px) 100vw, 755px" /></a><p id="caption-attachment-6551" class="wp-caption-text">Create Amazon S3 Storage Connection</p></div></li>
<li>Select the relevant single file to read from Amazon S3 Storage 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 Amazon S3 Storage</p></div></li>
<li>We can also read the multiple files stored in Amazon S3 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 Amazon S3 Source 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 Amazon S3 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 Amazon S3 Storage Files in SSIS. We used <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-source/" target="_blank" rel="noopener">Amazon S3 Source for CSV file</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-json-file-source/" target="_blank" rel="noopener">Amazon S3 Source for JSON file</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-xml-file-source/" target="_blank" rel="noopener">Amazon S3 Source for XML file</a> to read the file(s) from Amazon S3 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_amazon_aws_cloud" target="_blank" rel="noopener">SSIS Amazon S3 Source for CSV/JSON/XML File</a></li>
<li><a href="http://aws.amazon.com/s3/faqs/" target="_blank" rel="noopener">Introduction to Amazon S3 Storage Service</a></li>
<li><a href="https://www.youtube.com/watch?v=zdWPTvtW0E0" target="_blank" rel="noopener">How to Get Your Amazon AWS Access Key &amp; Secret Key</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-amazon-storage-s3-files-ssis-csv-json-xml/">Read Amazon S3 Storage 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>Import / Export data from Amazon Athena using SSIS</title>
		<link>https://zappysys.com/blog/import-export-data-amazon-athena-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 14 Dec 2017 04:25:21 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS Amazon S3 CSV Source]]></category>
		<category><![CDATA[SSIS Amazon S3 JSON Source]]></category>
		<category><![CDATA[SSIS Amazon Storage Task]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[Amazon Athena]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2367</guid>

					<description><![CDATA[<p>Introduction In our previous post we explored unlimited possibilities to call Amazon AWS API using SSIS. Now in this post we will learn how to import / export data from Amazon Athena using SSIS. Amazon Athena is very similar service like Google BigQuery which we documented already.  To read data from Amazon Athena we will use [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-export-data-amazon-athena-using-ssis/">Import / Export data from Amazon Athena using SSIS</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/2017/12/amazon-athena-integration-logo.png"><img loading="lazy" decoding="async" class="wp-image-2378 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-integration-logo.png" alt="" width="147" height="115" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-integration-logo.png 510w, https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-integration-logo-300x235.png 300w" sizes="(max-width: 147px) 100vw, 147px" /></a>In our previous post we explored unlimited possibilities to <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/" target="_blank" rel="noopener">call Amazon AWS API using SSIS</a>. Now in this post we will learn how to import / export data from Amazon Athena using SSIS. Amazon Athena is very similar service like <a href="https://zappysys.com/blog/get-data-google-bigquery-using-ssis/" target="_blank" rel="noopener">Google BigQuery which we documented already</a>.  To read data from Amazon Athena we will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZappySys JSON / REST API Source</a> which supports excellent JSON parsing capability <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">like this</a>.</p>
<h2></h2>
<h2></h2>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we do hello world demo for calling Amazon AWS API, you will need to make sure following prerequisites are met.</p>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Access to valid AWS credentials (Access Key, Secret Key for your IAM User). <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" target="_blank" rel="noopener">Click here to learn more</a> about IAM users and Access Key/Secret Key</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>SSIS PowerPack</em></a> is installed. <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">Click here to download</a>.</li>
</ol>
<h2>Steps needed to read data from Amazon Athena</h2>
<p>To read data from Amazon Athena you need to do atleast 3 steps at very high level. Later on this article we will see each step in depth.</p>
<ol>
<li>Call <a href="https://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html" target="_blank" rel="noopener">StartQueryExecution API</a> to send SQL Query (Its Job Style API so this call starts Job)</li>
<li>Keep checking Job Status by calling  <a href="https://docs.aws.amazon.com/athena/latest/APIReference/API_GetQueryExecution.html" target="_blank" rel="noopener">GetQueryExecution API</a> (In the response check State field for Status &#8211; We need to look for word SUCCESS)</li>
<li>Once Job is finished it produces CSV file in S3 Bucket (Output Location is supplied in Step-1)</li>
</ol>
<div id="attachment_8355" style="width: 923px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8355" class="size-full wp-image-8355" src="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png" alt="Read Amazon Athena Query output in SSIS (S3 CSV files)" width="913" height="658" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png 913w, https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output-300x216.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output-768x553.png 768w" sizes="(max-width: 913px) 100vw, 913px" /></a><p id="caption-attachment-8355" class="wp-caption-text">Read Amazon Athena Query output in SSIS (S3 CSV files)</p></div>
<h2>AWS Console &#8211; Athena Query Editor / Configure Output Settings</h2>
<p>Few things you might have to setup before you can call Athena API in SSIS</p>
<ol>
<li>Make sure your IAM user has correct permission (We used existing policies for ease of use but you can use custom policy for precise permission set)</li>
<li>Configure default output location for your Athena queries</li>
</ol>
<div id="attachment_8360" style="width: 996px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/configure-amazon-athena-permission-policy.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8360" class="size-full wp-image-8360" src="https://zappysys.com/blog/wp-content/uploads/2017/12/configure-amazon-athena-permission-policy.png" alt="Configure IAM user permission to call Amazon Athena API" width="986" height="581" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/configure-amazon-athena-permission-policy.png 986w, https://zappysys.com/blog/wp-content/uploads/2017/12/configure-amazon-athena-permission-policy-300x177.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/configure-amazon-athena-permission-policy-768x453.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a><p id="caption-attachment-8360" class="wp-caption-text">Configure IAM user permission to call Amazon Athena API</p></div>
<div id="attachment_8361" style="width: 837px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/set-athena-query-output-location.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8361" class="size-full wp-image-8361" src="https://zappysys.com/blog/wp-content/uploads/2017/12/set-athena-query-output-location.png" alt="Set Athena Query Output Location" width="827" height="454" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/set-athena-query-output-location.png 827w, https://zappysys.com/blog/wp-content/uploads/2017/12/set-athena-query-output-location-300x165.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/set-athena-query-output-location-768x422.png 768w" sizes="(max-width: 827px) 100vw, 827px" /></a><p id="caption-attachment-8361" class="wp-caption-text">Set Athena Query Output Location</p></div>
<div id="attachment_8362" style="width: 1080px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8362" class="size-full wp-image-8362" src="https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console.png" alt="Testing Athena Query inside Amazon AWS Console (Query Editor)" width="1070" height="628" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console.png 1070w, https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console-300x176.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console-768x451.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/12/amazon-athena-test-query-editor-aws-console-1024x601.png 1024w" sizes="(max-width: 1070px) 100vw, 1070px" /></a><p id="caption-attachment-8362" class="wp-caption-text">Testing Athena Query inside Amazon AWS Console (Query Editor)</p></div>
<h2>Creating Connection to call Athena API in SSIS</h2>
<p>Any API calls made to Amazon Athena service using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">ZappySys JSON / REST API Source</a>  or  <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> needs OAuth connection.</p>
<p>For REST API Task configure as below (More details about using REST API Task is in the next section).</p>
<ol>
<li>Drag ZS REST API Task from Control Flow Toolbox<img decoding="async" class="figureimage" title="SSIS REST Api Web Service Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/rest-api-task/ssis-rest-api-web-service-task-drag.png" alt="SSIS REST Api Task - Drag and Drop" /></li>
<li>Double click to edit.</li>
<li>Change Request URL Access Mode to [<strong>Url from Connection</strong>]</li>
<li>Now select <strong>&lt;&lt;New OAuth Connection&gt;&gt;</strong> from connection drop down</li>
<li>On OAuth connection select <strong>Amazon AWS API v4</strong> as Provider</li>
<li>Enter your <strong>Access Key</strong> and <strong>Secret Key</strong></li>
</ol>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Amazon AWS account must have access to Athena API calls and S3 Bucket </div></div>
<div id="attachment_2370" style="width: 702px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-aws-api-connection-call-rest.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2370" class="size-full wp-image-2370" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-aws-api-connection-call-rest.png" alt="Create SSIS Connection for Amazon AWS API Call (Athena REST API Example)" width="692" height="651" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-aws-api-connection-call-rest.png 692w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-aws-api-connection-call-rest-300x282.png 300w" sizes="(max-width: 692px) 100vw, 692px" /></a><p id="caption-attachment-2370" class="wp-caption-text">Create SSIS Connection for Amazon AWS API Call (Athena REST API Example)</p></div>
<h2>Creating Table in Amazon Athena using API call</h2>
<p>For this demo we assume you have already created sample table in Amazon Athena. If you wish to automate creating amazon athena table using SSIS then you need to call <a href="https://docs.aws.amazon.com/athena/latest/ug/create-table.html" target="_blank" rel="noopener">CREATE TABLE</a> DDL command using <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a>.</p>
<ol>
<li>In the previous <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> select OAuth connection (See previous section)</li>
<li>Enter <strong>Request Url</strong> as below<strong><br />
</strong><br />
<pre class="crayon-plain-tag">https://athena.us-east-1.amazonaws.com/</pre>
</li>
<li>In the <strong>HTTP Headers</strong> enter below 2 headers<br />
<pre class="crayon-plain-tag">X-Amz-Target: AmazonAthena.StartQueryExecution
Content-Type: application/x-amz-json-1.1</pre>
</li>
<li>Change Request method to <strong>POST</strong></li>
<li>In the Body enter below<br />
<pre class="crayon-plain-tag">{
 "ResultConfiguration": {
 "OutputLocation": "s3://my-bucket/output-files/"
 },
 "QueryString": "create external table tbl01 (CustomerID STRING, CompanyName STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION 's3://my-bucket/input-files/';",
 "ClientRequestToken": "{{System::ExecutionInstanceGUID}}"
}</pre>
<strong>Notice:</strong> Rather than using hard coded  DDL SQL Statement we can use variable placeholder (e.g. <pre class="crayon-plain-tag">"QueryString": "{{User::Query,FUN_JSONENCODE}}"</pre>   ). Use <pre class="crayon-plain-tag">FUN_JSONENCODE</pre> to replace new line with \r\n else JSON becomes invalid.</li>
<li>Now click <strong>Test Request / Response</strong>. This will create a new Athena table which we will query in later section.</li>
</ol>
<p>&nbsp;</p>
<p>Notice that in above Body ClientRequestToken is a unique number each time you have to call <a href="http://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html#athena-StartQueryExecution-request-ClientRequestToken" target="_blank" rel="noopener">StartQueryExecution API</a> to make it simple we used SSIS system variable <strong>System::ExecutionInstanceGUID</strong>. Its unique for each execution. You can also use newid() function from SQL Server and save result to variable if you like.</p>
<p>Here is the screenshot of above Request</p>
<div id="attachment_2368" style="width: 821px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2368" class="size-full wp-image-2368" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png" alt="RESt API Task - Create table in Amazon Athena using SSIS (StartQueryExecution API Call)" width="811" height="760" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png 811w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table-300x281.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table-768x720.png 768w" sizes="(max-width: 811px) 100vw, 811px" /></a><p id="caption-attachment-2368" class="wp-caption-text">RESt API Task &#8211; Create table in Amazon Athena using SSIS (StartQueryExecution API Call)</p></div>
<p>&nbsp;</p>
<h2>Uploading data for Amazon Athena (Source files)</h2>
<p>Once you have athena table created, we will need some data to query. Loading data to amazon athena table is nothing but upload files to S3. If you noticed we added below line in CREATE TABLE statement in the previous section. This means all source files are located at this S3 location.</p><pre class="crayon-plain-tag">LOCATION 's3://my-bucket/input-files/'</pre><p>
We have written blog post to explain this process (<a href="https://zappysys.com/blog/load-data-sql-server-to-amazon-s3/" target="_blank" rel="noopener">Click Here &#8211; How to load data from SQL server to S3 files</a>).</p>
<h2>Extract data from Amazon Athena using SSIS (Query Athena)</h2>
<p>Now its time to read some data by writing SQL query for Athena data (i.e. S3 files). As we mentioned earlier, reading data from Athena can be done using following steps.</p>
<ol>
<li>Call  <a href="http://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html#athena-StartQueryExecution-request-ClientRequestToken" target="_blank" rel="noopener">StartQueryExecution API</a>  using REST API Task to execute your Query (It returns you QueryExecutionID). Use same technique as Create Table example. Replace CREATE Table command in body with your SQL Query (New line must be replaced by \r\n in JSON).</li>
<li>Use REST API Task to call <a href="https://docs.aws.amazon.com/athena/latest/APIReference/API_GetQueryExecution.html" target="_blank" rel="noopener">GetQueryExecution API</a> and configure periodic status check loop (Task keeps waiting until Success or Failure Value not found in Response)</li>
<li>Once data is available read data using <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-source/" target="_blank" rel="noopener">S3 CSV File Source</a></li>
<li>At last you can clean up query output files or keep it if some other process wants to read it (You can also <a href="https://stackoverflow.com/questions/41413528/amazon-aws-athena-removing-temp-files" target="_blank" rel="noopener">clean up S3 files using bucket retention policy</a> automatically at scheduled interval).</li>
</ol>
<p>Now lets see each step in depth</p>
<h3>Step1-Start Amazon Athena Query Execution</h3>
<p>Now first thing is to execute Athena Query by calling <a href="http://docs.aws.amazon.com/athena/latest/APIReference/API_StartQueryExecution.html#athena-StartQueryExecution-request-ClientRequestToken" target="_blank" rel="noopener">StartQueryExecution API</a> . Below steps are almost same steps as we saw in section <strong>Creating Table in Amazon Athena using API call</strong></p>
<p>Only part is different here is SQL query is SELECT query rather than CREATE TABLE.</p>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS toolbox<br />
<img decoding="async" class="figureimage" title="SSIS REST Api Web Service Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/rest-api-task/ssis-rest-api-web-service-task-drag.png" alt="SSIS REST Api Task - Drag and Drop" /></li>
<li>Enter <strong>Request Url</strong> as below<strong><br />
</strong><br />
<pre class="crayon-plain-tag">https://athena.us-east-1.amazonaws.com/</pre>
</li>
<li>In the <strong>HTTP Headers</strong> enter below 2 headers<br />
<pre class="crayon-plain-tag">X-Amz-Target: AmazonAthena.StartQueryExecution
Content-Type: application/x-amz-json-1.1</pre>
</li>
<li>Change Request method to <strong>POST</strong></li>
<li>In the Body enter below<br />
<pre class="crayon-plain-tag">{
  "ResultConfiguration": {
    "OutputLocation": "s3://my-bucket/output-files/"
  },
  "QueryString": "select * from sampledb.elb_logs\r\nlimit 100000",
  "ClientRequestToken": "{{System::ExecutionInstanceGUID}}"
}</pre>
<strong>Notice:</strong> Rather than using hard coded  SQL Query we can use variable placeholder (e.g. <pre class="crayon-plain-tag">"QueryString": "{{User::Query,FUN_JSONENCODE}}"</pre>   ). Use <pre class="crayon-plain-tag">FUN_JSONENCODE</pre> to replace new line with \r\n else JSON becomes invalid.</p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png"><img loading="lazy" decoding="async" class="size-full wp-image-2368" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png" alt="RESt API Task - Create table in Amazon Athena using SSIS (StartQueryExecution API Call)" width="811" height="760" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table.png 811w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table-300x281.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-create-table-768x720.png 768w" sizes="(max-width: 811px) 100vw, 811px" /></a></li>
<li>Now go to <strong>Response Settings</strong> Tab and configure below way to extract QueryExecutionId (we will need it later).
<p>Set Extract Type as Json.<br />
Enter Expression as <pre class="crayon-plain-tag">$.QueryExecutionId</pre>
Check Save output to Variable and create new Variable (we can name as QueryExecutionId )</p>
<div id="attachment_8356" style="width: 860px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-save-query-execution-id.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8356" class="size-full wp-image-8356" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-save-query-execution-id.png" alt="Call Athena SQL, Save Amazon Athena QueryExecutionId in SSIS Variable" width="850" height="336" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-save-query-execution-id.png 850w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-save-query-execution-id-300x119.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-save-query-execution-id-768x304.png 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><p id="caption-attachment-8356" class="wp-caption-text">Call Athena SQL, Save Amazon Athena QueryExecutionId in SSIS Variable</p></div></li>
<li>That&#8217;s it now we can move to next step</li>
</ol>
<p>&nbsp;</p>
<h3>Step2 &#8211; Wait until Athena Query Execution is done</h3>
<p>New version of ZS REST API Task includes <strong>Status check</strong> feature. This feature avoids complex looping logic. Here is how to configure to check Job Status (Wait until Query execution is finished). Steps are almost same as previous section except three things ( Headers, Body and Status Check Tab)</p>
<p>For Status check we will call <a href="https://docs.aws.amazon.com/athena/latest/APIReference/API_GetQueryExecution.html" target="_blank" rel="noopener">GetQueryExecution API</a> .</p>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a> from SSIS toolbox<br />
<img decoding="async" class="figureimage" title="SSIS REST Api Web Service Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/rest-api-task/ssis-rest-api-web-service-task-drag.png" alt="SSIS REST Api Task - Drag and Drop" /></li>
<li>Enter <strong>Request Url</strong> as below<strong><br />
</strong><br />
<pre class="crayon-plain-tag">https://athena.us-east-1.amazonaws.com/</pre>
</li>
<li>In the <strong>HTTP Headers</strong> enter below 2 headers<br />
<pre class="crayon-plain-tag">X-Amz-Target: AmazonAthena.GetQueryExecution
Content-Type: application/x-amz-json-1.1</pre>
</li>
<li>Change Request method to <strong>POST</strong></li>
<li>In the <strong>Body</strong> enter below<br />
<pre class="crayon-plain-tag">{"QueryExecutionId": "{{User::QueryExecutionId}}"}</pre>
<strong>Notice:</strong> Here we have used Variable in the body. This variable we extracted in the previous step. It contains QueryExecution ID for the Job we submitted.</p>
<div id="attachment_8358" style="width: 860px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-getqueryexecution-status-check-loop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8358" class="size-full wp-image-8358" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-getqueryexecution-status-check-loop.png" alt="SSIS Amazon Athena - Call GetQueryExecution API (Status Check)" width="850" height="556" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-getqueryexecution-status-check-loop.png 850w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-getqueryexecution-status-check-loop-300x196.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-amazon-athena-getqueryexecution-status-check-loop-768x502.png 768w" sizes="(max-width: 850px) 100vw, 850px" /></a><p id="caption-attachment-8358" class="wp-caption-text">SSIS Amazon Athena &#8211; Call GetQueryExecution API (Status Check)</p></div></li>
<li>Now go to <strong>Status Check</strong> Tab and configure below way to implement Status check loop. We want to stop check once status is SUCCESS or FAILED or CANCELLED. If we find FAILED or CANCELLED in State field then we must fail the step with error.
<ol>
<li>Check Enable Status Check</li>
<li>Enter Success Value as <pre class="crayon-plain-tag">SUCCEEDED</pre></li>
<li>Check Fail Task option and enter this regex in the text box <pre class="crayon-plain-tag">FAILED|CANCELLED</pre></li>
<li>In the Interval enter 5 seconds delay after each iteration.</li>
</ol>
</li>
<li>That&#8217;s it. Status check Tab will look like below. Now we can move to next step
<div id="attachment_8357" style="width: 536px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/rest-api-job-status-check-loop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8357" class="size-full wp-image-8357" src="https://zappysys.com/blog/wp-content/uploads/2017/12/rest-api-job-status-check-loop.png" alt="REST API Status check Loop - Keep checking until JOB is done" width="526" height="391" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/rest-api-job-status-check-loop.png 526w, https://zappysys.com/blog/wp-content/uploads/2017/12/rest-api-job-status-check-loop-300x223.png 300w" sizes="(max-width: 526px) 100vw, 526px" /></a><p id="caption-attachment-8357" class="wp-caption-text">REST API Status check Loop &#8211; Keep checking until JOB is done</p></div></li>
</ol>
<p>&nbsp;</p>
<h3>Step3-Read data from Athena Query output files (CSV / JSON stored in S3 bucket)</h3>
<p>When you create Athena table you have to specify query output folder and data input location and file format (e.g. CSV, JSON, Avro, ORC, Parquet &#8230;) they can be GZip, Snappy Compressed. Once you execute query it generates CSV file. Zappysys can read CSV, TSV or JSON files using <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-source/" target="_blank" rel="noopener">S3 CSV File Source</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-json-file-source/" target="_blank" rel="noopener">S3 JSON File Source</a> connectors. In this section we will use CSV connector to read Athena output files.</p>
<p>Here is how to Athena output data</p>
<ol>
<li>Drag and drop Data flow task from SSIS Toolbox<br />
<img decoding="async" class="figureimage" title="SSIS Data Flow Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" /></li>
<li>Double click data flow and drag and drop  <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-csv-file-source/" target="_blank" rel="noopener">ZS Amazon S3 CSV File Source</a><br />
<img decoding="async" class="figureimage" title="SSIS Amazon S3 CSV Source - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-s3-csv-source/ssis-amazon-s3-csv-file-source-drag.png" alt="SSIS Amazon S3 CSV Source - Drag and Drop" /></li>
<li>Double click to configure it.</li>
<li> Click New Connection and configure S3 Connection</li>
<li>Once connection is created, browse to S3 bucket / folder location where Athena outputs files.</li>
<li>Replace file name with variable like below<br />
<pre class="crayon-plain-tag">my-bucket/output-files/{{User::QueryExecutionId}}.csv</pre>
&nbsp;</li>
</ol>
<p>&nbsp;</p>
<div id="attachment_2371" style="width: 1214px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2371" class="size-full wp-image-2371" src="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files.png" alt="Reading data from Amazon Athena CSV files (Stored in S3)" width="1204" height="675" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files.png 1204w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files-300x168.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files-768x431.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/12/ssis-read-athena-csv-output-from-aws-s3-storage-csv-files-1024x574.png 1024w" sizes="(max-width: 1204px) 100vw, 1204px" /></a><p id="caption-attachment-2371" class="wp-caption-text">Reading data from Amazon Athena CSV files (Stored in S3)</p></div>
<h2>Putting all together &#8211; Athena Data Extract Example</h2>
<p>Here is final package with all pieces we talked.</p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png"><img loading="lazy" decoding="async" class="size-full wp-image-8355" src="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png" alt="Read Amazon Athena Query output in SSIS (S3 CSV files)" width="913" height="658" srcset="https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output.png 913w, https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output-300x216.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/12/query-read-data-from-amazon-athena-ssis-s3-csv-output-768x553.png 768w" sizes="(max-width: 913px) 100vw, 913px" /></a></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>You have seen that using ZappySys SSIS PowerPack how quickly you can integrate with Amazon Athena and other AWS Cloud Services.  <a href="https://zappysys.com/products/ssis-powerpack/">Download SSIS PowerPack</a> and try it out by yourself.</p>
<p><strong>Keywords:</strong> Extract data from Amazon Athena | Read from Amazon Athena Query file | Import / Export data from Amazon Athena | Fetch data from Amazon Athena</p>
<p>The post <a href="https://zappysys.com/blog/import-export-data-amazon-athena-using-ssis/">Import / Export data from Amazon Athena using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</title>
		<link>https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 03 Nov 2017 15:25:28 +0000</pubDate>
				<category><![CDATA[AWS (Amazon Web Services)]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[SSIS Connection Manager]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS REST API Task]]></category>
		<category><![CDATA[SSIS XML Source (File / SOAP)]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[elasticsearch]]></category>
		<category><![CDATA[fiddler]]></category>
		<category><![CDATA[lambda]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[sqs]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2241</guid>

					<description><![CDATA[<p>Introduction In this blog post you will learn how to call Amazon AWS API using SSIS (virtually any API) without a single line of code (No more JAVA, C#, Ruby, Python). Yes you heard it right 🙂 . If you are a SSIS / ETL Developer or even coder everyone loves drag &#38; drop interface. SSIS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/">How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</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/2017/11/amazon-web-services-logo.jpg"><img loading="lazy" decoding="async" class="wp-image-2317 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo.jpg" alt="" width="322" height="181" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo.jpg 800w, https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo-300x169.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/amazon-web-services-logo-768x432.jpg 768w" sizes="(max-width: 322px) 100vw, 322px" /></a>In this blog post you will learn how to <strong>call Amazon AWS API using SSIS</strong> (virtually any API) without a single line of code (No more JAVA, C#, Ruby, Python). Yes you heard it right 🙂 . If you are a SSIS / ETL Developer or even coder everyone loves drag &amp; drop interface. SSIS has many advantages over other approaches such as Programming SDKs, Command Lines. Main advantage is ease of use, security and long term maintenance without learning expensive coding approach.</p>
<p>In this post we will use following components to show various possibilities to implement Amazon AWS API integration scenarios inside your ETL workflows.</p>
<div class="su-table su-table-alternate">
<div>
<table>
<colgroup>
<col width="100" />
<col /></colgroup>
<tbody>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/SSIS-Json-Source-Adapter.png" alt="Custom SSIS Components - Json Source" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON / REST API Source</a> (REST API, JSON File or OData Service): Use this dataflow component when you have to <strong>fetch data from REST API webservice like a table</strong>. This component allows you to extract JSON data from webservice and de-normalize nested structure so you can save to Relational database such as SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local JSON files or direct JSON string (Wildcard pattern supported too e.g. c:\data\file*.json).</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/web-api-destination/ssis-web-api-destination.png" alt="SSIS Custom Target Adapter - Web API Destination" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/">Web API Destination</a> (POST data to API URL) : Use this dataflow component when you have to call API inside Dataflow (see <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">POST to URL</a>). Possible Use case: Call Lambda function with various parameters for each input record found in database.</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-rest-api-web-service-task.png" alt="Custom SSIS Tasks - SSIS Rest Api Web Service Task" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/">REST API Task</a> : Use this task when you don’t want to pull REST API data in tabular format but want to call rest API for POST data to server, DELETE data from server or things like download HTML page, extract Authentication tokens etc where you not necessarily dealing data in tabular format. This task also allows you many other options such as saving RAW response into variable or file.</td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="//zappysys.com/images/ssis-powerpack/ssis-xml-source.png" alt="Custom SSIS Components - XML Source (Read File/SOAP/REST Web Service)" width="72" height="72" /></td>
<td><a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/">XML Source</a> (SOAP, File, REST) : Use this dataflow component when you have to fetch data from XML or SOAP webservice and consume data like a table. This component allows you to extract data from webservice and save to SQL Server or any other target (Oracle, FlatFile, Excel, MySQL). This component also supports reading local XML files or direct XML string.</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we do hello world demo for calling Amazon AWS API, you will need to make sure following prerequisites are met.</p>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Access to valid AWS credentials (Access Key, Secret Key for your IAM User). <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html" target="_blank" rel="noopener">Click here to learn more</a> about IAM users and Access Key/Secret Key</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>SSIS PowerPack</em></a> is installed. <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">Click here to download</a>.</li>
</ol>
<h2>Step-By-Step Example-1 (Call AWS API)</h2>
<p>Now lets call some simple GET API call using SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">REST API Task</a>.</p>
<ol>
<li>Install  <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>SSIS PowerPack</em></a> (Skip this step if you already installed SSIS PowerPack.</li>
<li>Open Visual Studio and create new Integration Services Project</li>
<li>Open SSIS Package and check your SSIS Toolbox you will see many tasks/components starting with ZS</li>
<li>From Control flow SSIS Toolbox Drag &amp; drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-rest-api-web-service-task/" target="_blank" rel="noopener">ZS REST API Task</a>.</li>
<li>Double click the REST API task to configure it.</li>
<li>On REST API Task change URL Access mode drop down to <strong>URL from Connection</strong></li>
<li>Now in the connection dropdown click New <strong>ZS-OAUTH</strong> connection and configure connection as below
<ol>
<li>Once you see OAuth connection dialog box change Provider Type from Custom to <strong>Amazon AWS API</strong> (v4)</li>
<li>In the ClientId enter your AWS <strong>Access Key</strong></li>
<li>In the ClientSecret enter your AWS <strong>Secret Key</strong></li>
<li>Click OK to save connection
<div id="attachment_2258" style="width: 720px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2258" class="size-full wp-image-2258" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png" alt="Configure SSIS OAuth Connection - Use Amazon AWS API Provider, Enter Access Key, Secret Key" width="710" height="535" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4.png 710w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-oauth-connection-amazon-aws-api-provider-use-signature-v4-300x226.png 300w" sizes="(max-width: 710px) 100vw, 710px" /></a><p id="caption-attachment-2258" class="wp-caption-text">Configure SSIS OAuth Connection &#8211; Use Amazon AWS API Provider, Enter Access Key, Secret Key</p></div></li>
</ol>
</li>
<li>On REST API Task change few more settings as below
<ol>
<li>Enter API URL you like to call (In our case we will use <a href="http://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceGET.html" target="_blank" rel="noopener">S3 API (Simple Storage Service)</a>. We assume you have ListBucket permission to make this call. If you dont have such permission try to get Full path of File (choose small file) . You have to tweak API url to adjust Service Type, Region,Bucket, Path<br />
<pre class="crayon-plain-tag">https://s3.us-east-1.amazonaws.com
-- OR -- Use below (list files) if you have single bucket permission---
https://s3.us-east-1.amazonaws.com/YOUR-BUCKET</pre>
</li>
<li>Click Test Request. If you have valid Permission and setup looks ok then you will see Response window like below. Using this technique you can call any API to execute AWS operations (E.g. start EC2 VM, Create SQS Queue, Call Lambda Function, Drop or Update resource)
<div id="attachment_2260" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2260" class="size-full wp-image-2260" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png" alt="Calling Amazon AWS API Using SSIS REST API Task Example. (Call any AWS API without SDK. such as EC2 API, SQS API, Lambda API, Redshift API, DynamoDB API)" width="712" height="615" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway.png 712w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-api-without-sdk-s3-ec2-sqs-lambda-api-gateway-300x259.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-2260" class="wp-caption-text">Calling Amazon AWS API Using SSIS REST API Task Example. (Call any AWS API without SDK. such as EC2 API, SQS API, Lambda API, Redshift API, DynamoDB API)</p></div></li>
</ol>
</li>
</ol>
<h2>Step-By-Step Example-2 (Loading data from AWS API to SQL Server)</h2>
<p>Now lets do more interesting scenario. We will call AWS S3 API to get S3 File list from Bucket. After extract we will save that list to SQL Server Table. Since Amazon S3 API is XML based API we will use ZappySys <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">SSIS XML Source</a>. For JSON based API use JSON Source instead. XML Source / JSON Source both can parse API response into Rows and Columns so you can easily store it into SQL Server. Now lets see how to do this.</p>
<ol>
<li>From Control flow SSIS Toolbox Drag &amp; drop Data Flow Task</li>
<li>Double click Data Flow Task. From SSIS Toolbox Drag &amp; drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-source/" target="_blank" rel="noopener">ZS SSIS XML Source</a>.</li>
<li>Double click the XML Source to configure it.</li>
<li>In the URL text box enter API URL like below to list S3 Files for specified bucket (Change YOUR-BUCKET to your own name)<br />
<pre class="crayon-plain-tag">https://s3.us-east-1.amazonaws.com/YOUR-BUCKET</pre>
</li>
<li>Now check Use Credentials and Select same Amazon API connection we created in previous example.</li>
<li>Click on Select Filter (This step allows us to flatten the XML hierarchy. Select the node which is Array icon like below. If prompted to treat selected node as array click Yes.
<div id="attachment_2319" style="width: 958px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2319" class="size-full wp-image-2319" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png" alt="Configure SSIS XML Source - Get Amazon S3 File List from specific bucket (AWS API)" width="948" height="728" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png 948w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-300x230.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-read-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-768x590.png 768w" sizes="(max-width: 948px) 100vw, 948px" /></a><p id="caption-attachment-2319" class="wp-caption-text">Configure SSIS XML Source &#8211; Get Amazon S3 File List from specific bucket (AWS API)</p></div></li>
<li>Click Preview to see your data. Click OK to save.
<div id="attachment_2320" style="width: 705px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2320" class="size-full wp-image-2320" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png" alt="Preview Data in XML Source - Amazon S3 File List (Calling AWS API)" width="695" height="372" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source.png 695w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-preview-data-amazon-aws-api-get-s3-bucket-file-list-xml-source-300x161.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-2320" class="wp-caption-text">Preview Data in XML Source &#8211; Amazon S3 File List (Calling AWS API)</p></div></li>
<li>Now attach your XML source to target like OLEDB Destination to load data to SQL Server or other Target (e.g. Oracle, MySQL)</li>
<li>Execute SSIS Package to load data from Amazon AWS API to SQL Server.
<div id="attachment_2321" style="width: 917px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2321" class="size-full wp-image-2321" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png" alt="SSIS Package - Read Amazon S3 File List and load into SQL Server Table (Call AWS API Example)" width="907" height="597" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api.png 907w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api-300x197.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-example-read-amazon-to-sql-server-call-aws-api-768x506.png 768w" sizes="(max-width: 907px) 100vw, 907px" /></a><p id="caption-attachment-2321" class="wp-caption-text">SSIS Package &#8211; Read Amazon S3 File List and load into SQL Server Table (Call AWS API Example)</p></div></li>
</ol>
<h2></h2>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">File Upload Example &#8211; Low level API &#8211; Call PUT request</span></h2>
<p>There will be a time when you want to take total control of your AWS API calls. One example is if you wish to Upload / Write data to S3 then components like ZappySys Amazon S3 CSV Destination or Amazon Storage Task might need additional permission such as <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html" target="_blank" rel="noopener">HeadObject</a> . If you have only write permission on bucket then this will fail to execute Task. In such case you can use REST API Task like below way.</p>
<p>Basically we exported data from Relation Database to CSV File using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV File Task</a> and then we uploaded file content using REST API Task.</p>
<h3>Upload Text File to S3 (i.e. JSON, CSV, XML &#8230;)</h3>
<p>Your URL Format can be like this. Region codes can be <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints" target="_blank" rel="noopener">found here</a></p><pre class="crayon-plain-tag">https://YOUR-BUCKET.s3.YOUR-REGION.amazonaws.com/YOUR-FILE
https://YOUR-BUCKET.s3.YOUR-REGION.amazonaws.com/SOME-FOLDER/SOME-SUB-FOLDER/YOUR-FILE</pre><p>
&nbsp;</p>
<div id="attachment_8925" style="width: 902px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8925" class="size-full wp-image-8925" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png" alt="Upload file to Amazon S3 - Call low level API (PUT request)" width="892" height="752" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request.png 892w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request-300x253.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-upload-file-to-s3-bucket-low-level-rest-api-put-request-768x647.png 768w" sizes="(max-width: 892px) 100vw, 892px" /></a><p id="caption-attachment-8925" class="wp-caption-text">Upload file to Amazon S3 &#8211; Call low level API (PUT request)</p></div>
<p>&nbsp;</p>
<h3>Upload Binary File to S3 (i.e. Zip, mp3, gzip, png, jpeg&#8230;)</h3>
<p>Above method only works for Text Files. If you have Binary files (e.g. Zip file, mp3, png, jpeg) then you can use below workaround.</p>
<ol>
<li>Check Is Multi Part / File Upload Option next to the Body editor (<a href="https://zappysys.com/blog/rest-api-file-upload-using-ssis-multi-part-post/" target="_blank" rel="noopener">Read this Post for more info</a>)</li>
<li>In the Body enter file path like below<br />
<pre class="crayon-plain-tag">@c:\folder\some-file.xyz</pre>
</li>
<li>That&#8217;s it, now your binary file can be uploaded to S3 same way as Text file we uploaded in earlier section.</li>
</ol>
<p>&nbsp;</p>
<p><strong>NOTE:</strong> <span style="text-decoration: underline;">Binary file option only works in the latest Build Uploaded after 5/21/2020</span></p>
<p>&nbsp;</p>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">Debugging AWS API Command Line Requests using Fiddler (Web Proxy)</span></h2>
<p>Before we see more examples of calling AWS API lets first learn how to capture Request data using <a href="https://aws.amazon.com/cli/" target="_blank" rel="noopener">aws command line</a> (CLI). We will use <a href="https://zappysys.com/blog/how-to-use-fiddler-to-analyze-http-web-requests/" target="_blank" rel="noopener">Fiddler</a> to capture AWS API Requests.</p>
<ol>
<li>Download and <a href="https://www.telerik.com/download/fiddler" target="_blank" rel="noopener">Install Fiddler</a> (Free Tool)</li>
<li>Install  <a href="https://aws.amazon.com/cli/" target="_blank" rel="noopener">aws command line</a></li>
<li>Open command prompt and type aws configure command to set credentials.  For more info see <a href="http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html" target="_blank" rel="noopener">configure aws credentials</a> .. see below example.<br />
<pre class="crayon-plain-tag">c:&gt; aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json</pre>
</li>
<li>Once you set credentials launch Fiddler</li>
<li>On the Fiddler Tools menu &gt; Click Fiddler Option &gt; HTTPS &gt; Check <strong>Decrypt HTTPS Traffic</strong></li>
<li>Once you do that you may be asked to Trust Fiddler Certificate click OK</li>
<li>Close and Open Fiddler to apply setting</li>
<li>Now any command you type in aws command line will show up in fiddler. This command we can use in SSIS REST API Task or XML Source to call virtually Any API AWS supports.</li>
<li>For example to call some lambda function (supply input json data from file) use below command and watch Fiddler Trace. Notice we added <strong>&#8211;no-verify-ssl</strong> option so we can see requests in custom web proxy like fiddler (This option will trust Fiddler certificate).<br />
<pre class="crayon-plain-tag">c:\&gt;aws lambda invoke --function-name HelloWorld c:\temp\outputfile.txt --no-verify-ssl --payload file://c://test/customer.json</pre>
&nbsp;</p>
<div id="attachment_2314" style="width: 1175px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2314" class="size-full wp-image-2314" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png" alt="Capture AWS Commandline (CLI) request using Fiddler" width="1165" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler.png 1165w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-300x165.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-768x422.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-get-raw-rest-request-aws-commandline-cli-capture-fiddler-1024x563.png 1024w" sizes="(max-width: 1165px) 100vw, 1165px" /></a><p id="caption-attachment-2314" class="wp-caption-text">Capture AWS Commandline (CLI) request using Fiddler</p></div></li>
<li>Once you have this information you can use it inside ZappySys Components which supports API calls (e.g. REST API Task, JSON Source, XML Source). For this example we will use REST API Task to call same Lambda Function. Things to change to call any API is URL, Method, ContentType, Body. If its GET call then you wont have Body.
<div id="attachment_2315" style="width: 826px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2315" class="size-full wp-image-2315" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png" alt="Calling Amazon AWS Lambda Function using SSIS REST API Task" width="816" height="659" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task.png 816w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-amazon-aws-lambda-function-using-rest-api-task-768x620.png 768w" sizes="(max-width: 816px) 100vw, 816px" /></a><p id="caption-attachment-2315" class="wp-caption-text">Calling Amazon AWS Lambda Function using SSIS REST API Task</p></div>
<p>&nbsp;</li>
<li>That&#8217;s it.. You can now take this same concept and call virtually API AWS API right insight SSIS without any SDK or command line tools.</li>
</ol>
<h2>Call API Gateway Endpoint (Default URL)</h2>
<p>If you wish to call API hosted on Amazon API Gateway Service then enter direct URL. You have to use OAuth Connection (AWS v4 Provider) as previous section.</p>
<p>Typical URL may look like as below if you calling API gateway Endpoint.</p><pre class="crayon-plain-tag">https://c5hhigf5mh.execute-api.us-east-1.amazonaws.com/prod/pets</pre><p>
<h2>Call AWS API with Region and Custom Service Name</h2>
<p>There will be a time when you will have to call AWS API URL and it doesnt indicate Region / Service but you have to supply part of signature for Authentication.  In this case just enter AWS Service and Region along with ClientID, Secret Fields (Custom Service and  Region attributes were introduced in v3.0 or higher so if you are not seeing on OAuth Connection UI then you probably running older version).</p>
<p>&nbsp;</p>
<h2>Call Amazon Athena API</h2>
<p>Check <a href="https://zappysys.com/blog/import-export-data-amazon-athena-using-ssis/" target="_blank" rel="noopener">this article</a> for detailed instructions</p>
<h2><span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">Call AWS EC2 API</span></h2>
<p>Here is an example of calling EC2 API. This is example of listing EC2 instances.</p>
<p>Request:</p><pre class="crayon-plain-tag">POST https://ec2.us-east-1.amazonaws.com/
Content-Type: application/x-www-form-urlencoded; charset=utf-8

Action=DescribeInstances&amp;Version=2016-11-15</pre><p>
<h2>Call <span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">AWS </span>Lambda API</h2>
<p>Here is some example of calling Lambda function</p>
<p>Request:</p><pre class="crayon-plain-tag">POST https://lambda.YOUR-REGION.amazonaws.com/2015-03-31/functions/YOUR-FUNCTION/invocations

{you-json-input-goes-in-body}</pre><p>
<h2></h2>
<h2>Call AWS ElasticSearch</h2>
<p>If you are using <a href="https://aws.amazon.com/elasticsearch-service/" target="_blank" rel="noopener">AWS Hosted Managed ElasticSearch</a> then also you can use OAuth AWS v4 Provider as below. Assuming you have <a href="https://stackoverflow.com/questions/33751580/how-to-access-kibana-from-amazon-elasticsearch-service" target="_blank" rel="noopener">configured correct Policy</a> to allow your IAM User Account / IP address.</p>
<div id="attachment_6277" style="width: 836px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6277" class="size-full wp-image-6277" src="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png" alt="Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)" width="826" height="730" srcset="https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4.png 826w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-300x265.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/11/ssis-call-aws-elasticsearch-rest-api-sign-v4-768x679.png 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-6277" class="wp-caption-text">Call AWS Hosted ElasticSearch REST API in SSIS (V4 Request Signing)</p></div>
<h2>Call <span id="Using_SSIS_JSON_Source_to_read_from_REST_API_and_load_into_SQL_Server">AWS </span>API using Native Task/Components</h2>
<p>ZappySys provides many High quality Tasks / Components for AWS integration. See below list.</p>
<table id="cat_amazon_aws_cloud" style="margin: 0px 0px 1.5em !important; padding: 0px; outline: 0px; border: 1px solid #cccccc !important; border-image: none !important !important; width: 973px; color: #333333; text-transform: none; line-height: 2; text-indent: 0px; letter-spacing: normal; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; font-style: normal; font-weight: normal; word-spacing: 0px; vertical-align: baseline; white-space: normal; border-collapse: collapse !important; border-spacing: 0px; orphans: 2; widows: 2; background-color: #ffffff; font-variant-ligatures: normal; font-variant-caps: normal; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">
<tbody>
<tr class="su-even">
<th colspan="3"><strong>Amazon AWS Cloud Integration</strong></th>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-S3-Cloud-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon S3 Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">Amazon S3 Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-Redshift-Data-Transfer-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift Data Transfer Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-data-transfer-task/" target="_blank" rel="noopener">Amazon Redshift Data Transfer Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-Redshift-ExecuteSQL-Task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift ExecuteSql Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-redshift-execute-sql-task/" target="_blank" rel="noopener">Amazon Redshift ExecuteSql Task</a></td>
</tr>
<tr class="su-even">
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/images/ssis-powerpack/ssis-amazon-redshift-cluster-management-task.png?w=720&amp;ssl=1" alt="Custom SSIS Tasks - Amazon Redshift Cluster Management Task" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-cluster-management-task/" target="_blank" rel="noopener">Amazon Redshift Cluster Management Task</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamodb-source/" target="_blank" rel="noopener">Amazon DynamoDB Source</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Destination-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Destination" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamodb-destination/" target="_blank" rel="noopener">Amazon DynamoDB Destination</a></td>
</tr>
<tr>
<td><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/amazon-redshift-source/ssis-amazon-redshift-source.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon Redshift Source" width="24" height="24" /> <a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-source-connector/" target="_blank" rel="noopener">Amazon Redshift Source</a></td>
<td><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> Amazon SQS Queue Source</td>
<td> <img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Amazon-DynamoDB-Source-Adapter.png?w=720&amp;ssl=1" alt="Custom SSIS Components - Amazon DynamoDB Source" width="24" height="24" /> Amazon SQS Queue Destination</td>
</tr>
</tbody>
</table>
<h2>Conclusion</h2>
<p>Amazon AWS Cloud integration from SSIS packages becoming more and more common scenario. ZappySys provides easy to use no coding connectors to achieve many time consuming scenarios. Having clean drag and drop approach is not only faster but more secure using inbuilt SSIS framework. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack</a> to explore many other scenarios not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/how-to-call-amazon-aws-api-using-ssis-ec2-lambda-api-gateway-sqs/">How to call Amazon AWS API using SSIS (EC2, Lambda, API Gateway, SQS)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to check Amazon S3 Bucket location (Region)</title>
		<link>https://zappysys.com/blog/check-amazon-s3-bucket-location-region/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 15 Mar 2016 14:17:39 +0000</pubDate>
				<category><![CDATA[S3 (Simple Storage Service)]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[bucket]]></category>
		<category><![CDATA[command line tools]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[redshift copy]]></category>
		<category><![CDATA[Redshift Data Transfer Task]]></category>
		<category><![CDATA[s3]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ZappyShell]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=409</guid>

					<description><![CDATA[<p>Problem Sometimes if you loading data to Redshift via COPY command or using SSIS Redshift Data Transfer Task to move data to redshift then you will have to make sure your S3 Bucket is in the same region as Redshift Cluster. Many people don&#8217;t know how to verify that because its hidden in the console. This [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/check-amazon-s3-bucket-location-region/">How to check Amazon S3 Bucket location (Region)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Problem</h2>
<p>Sometimes if you loading data to Redshift via <a href="http://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html" target="_blank">COPY</a> command or using <a href="//zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-data-transfer-task/" target="_blank">SSIS Redshift Data Transfer Task</a> to move data to redshift then you will have to make sure your S3 Bucket is in the same region as Redshift Cluster. Many people don&#8217;t know how to verify that because its hidden in the console. This post will help you to find it easily.</p>
<h2>Find Amazon S3 bucket location (AWS Region endpoint)</h2>
<p>Below is step-by-step instructions how to find S3 Bucket region (i.e. location)</p>
<ol>
<li>Open your AWS Console by visiting <a href="https://console.aws.amazon.com/" target="_blank">https://console.aws.amazon.com/</a></li>
<li>From dashboard click on <strong>S3</strong> option (or visit <a href="https://console.aws.amazon.com/s3/home" target="_blank">https://console.aws.amazon.com/s3/home</a> )</li>
<li>You will see all buckets in the left side list</li>
<li>Click on desired S3 bucket name</li>
<li>Click on Properties Tab at the top</li>
<li>Now you will see <strong>Region</strong> for the selected bucket along with many other properties.</li>
</ol>
<p>Sometimes You may see US Standard as region name that means your bucket is located in US East (N. Virginia)</p>
<p>If you want to know Region Code rather than name check this link : <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region" target="_blank">Region Endpoints for Amazon S3 </a></p>
<div id="attachment_410" style="width: 592px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/03/how-to-find-amazon-s3-bucket-location-region-endpoint-aws.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-410" class="size-full wp-image-410" src="//zappysys.com/blog/wp-content/uploads/2016/03/how-to-find-amazon-s3-bucket-location-region-endpoint-aws.png" alt="How to find amazon s3 bucket location (AWS region endpoint)" width="582" height="272" srcset="https://zappysys.com/blog/wp-content/uploads/2016/03/how-to-find-amazon-s3-bucket-location-region-endpoint-aws.png 582w, https://zappysys.com/blog/wp-content/uploads/2016/03/how-to-find-amazon-s3-bucket-location-region-endpoint-aws-300x140.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></a><p id="caption-attachment-410" class="wp-caption-text">How to find amazon s3 bucket location (AWS region endpoint)</p></div>
<h2>Download/Upload data to S3 bucket via Command line</h2>
<p>If you want to automate S3 file download/upload then check <a href="//zappysys.com/products/zappyshell/" target="_blank">this command line tool</a></p>
<h3>ZappyShell Command line tools for Amazon S3</h3>
<p><img decoding="async" title="ZappyShell Command line tools for Amazon S3" src="//zappysys.com/onlinehelp/zappyshell/scr/images/zappyshell-for-aws-command-line-tools.png" alt="Command line tools for Amazon S3" /></p>
<p>&nbsp;</p>
<h3>Upload local files to Amazon S3 from command line</h3>
<p><img decoding="async" title="Upload local files to Amazon S3 from command line" src="//zappysys.com/onlinehelp/zappyshell/scr/images/amazon-s3-command-line-tools-upload-files.png" alt="Upload local files to Amazon S3 from command line" /></p>
<p>&nbsp;</p>
<h3>List S3 buckets using command line</h3>
<p><img decoding="async" title="List S3 buckets using command line" src="//zappysys.com/onlinehelp/zappyshell/scr/images/amazon-s3-command-line-tools-list-bucket.png" alt="List S3 buckets using command line" /></p>
<p>&nbsp;</p>
<h3>List S3 file information using command line</h3>
<p><img decoding="async" title="List S3 file information using command line" src="//zappysys.com/onlinehelp/zappyshell/scr/images/amazon-s3-command-line-tools-list-information.png" alt="List S3 file information using command line" /></p>
<p>&nbsp;</p>
<h3>List S3 files using command line</h3>
<p><img decoding="async" title="List S3 files using command line" src="//zappysys.com/onlinehelp/zappyshell/scr/images/amazon-s3-command-line-tools-list-s3-files.png" alt="List S3 files using command line" /></p>
<h2>Download/Upload data to S3 bucket from SSIS</h2>
<a href="https://zappysys.com/blog/check-amazon-s3-bucket-location-region/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FtlW7lpJoWEg%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Load data to Amazon Redshift using S3 Bucket and COPY command</h2>
<p>Below video shows how to use S3 bucket to perform bulk data load into Amazon Redshift using <a href="//zappysys.com/products/ssis-powerpack/ssis-amazon-redshift-data-transfer-task/" target="_blank">SSIS Redshift Data Transfer Task</a><br />
<a href="https://zappysys.com/blog/check-amazon-s3-bucket-location-region/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2F5S_p0fNn6a8%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Conclusion</h2>
<p>Amazon S3 provides most common way to store/load data for various AWS related services (e.g. EMR, Redshift). Zappysys is one of the top leading providers who make tools for AWS, NoSQL and other Cloud connectivity providers. Check <a href="//zappysys.com/products/ssis-powerpack/" target="_blank">SSIS PowerPack</a> (For SSIS) or <a href="//zappysys.com/products/zappyshell/" target="_blank">ZappyShell Command line for AWS</a> if you want command line solution. ZappyShell is just single exe file does all heavy lifting for you 🙂</p>
<p>Cheers!</p>
<p>The post <a href="https://zappysys.com/blog/check-amazon-s3-bucket-location-region/">How to check Amazon S3 Bucket location (Region)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
