<?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>CSV Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/csv/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/csv/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Fri, 14 Nov 2025 03:40:56 +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>CSV Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/csv/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Export / Create JSON File in Informatica (from SQL Query / Database Tables)</title>
		<link>https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 30 Mar 2023 17:17:30 +0000</pubDate>
				<category><![CDATA[ZappyShell]]></category>
		<category><![CDATA[command line tools]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[Informatica]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10020</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to create simple or complex JSON file in Informatica just in a few clicks. We will use the Powerful Export JSON Command line Builder from ZappyShell. Using this Portable / xCopy style command line you can build nested/complex JSON / XML or even CSV from single / [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/">Export / Create JSON File in Informatica (from SQL Query / Database Tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this article, you will learn how to create simple or complex JSON file in Informatica just in a few clicks. We will use the Powerful Export JSON Command line Builder from <a href="https://zappysys.com/products/zappyshell/data-export-command-line-tools-json-excel-csv-pdf/">ZappyShell</a>. Using this Portable / xCopy style command line you can build nested/complex JSON / XML or even CSV from single / multiple SQL Queries as Input or Select Database Tables as Source. Later you can copy generated command line from Tool and execute in any tool like Informatica / Talend / DataStage or Automation Script like Python / PowerShell.</p>
<h2>Prerequisite</h2>
<p>This article assumes you have access to Informatica Developer Tools and basic knowledge of command-line tools.</p>
<ol>
<li><a href="https://zappysys.com/products/zappyshell/">Download ZappyShell</a> Command line utility (Click on Download Button). You can get msi and Zip (Poratble / xCopy version)</li>
<li>If you want to use the Portable version just extract ZappyShell-xCopy zip to some folder lets say (C:\ZappyShell). If you installed MSI then its usually in C:\Program Files (x86)\ZappySys</li>
<li>Double click on DbCommandBuilder.exe <a href="https://zappysys.com/onlinehelp/zappyshell/index.htm#page=db/db.htm">as listed here</a>  to get started. At the end of this exercise, you will be able to generate something like the below JSON File in few clicks in Informatica or any other Tool / Programming Language you prefer which has option to invoke command line&#8230;</li>
<li>For all possible command line options <a href="https://zappysys.com/onlinehelp/zappyshell/scr/db/db-db-export.htm" target="_blank" rel="noopener">Refer this</a></li>
<li>So lets get started</li>
</ol>
<h2>Sample JSON Created by ZappyShell from Informatica</h2>
<p>&nbsp;</p>
<div style="width: 680px" class="wp-caption alignnone"><img fetchpriority="high" decoding="async" class="figureimage" title="Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-output.png" alt="Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)" width="670" height="626" /><p class="wp-caption-text">Sample JSON Created by Informatica Workflow (Create From Database SQL Query or Tables)</p></div>
<h2>Create Command Line to Export JSON File from Database SQL Query / Tables</h2>
<p>In this section, we will see how to build Command Line which you can then execute in Informatica Command Time and later Schedule Export Job to Produce JSON File on a predefined schedule or manually.</p>
<ol>
<li>Open DbCommandBuilder.exe and configure the Connection / Data source(s) <a href="https://zappysys.com/onlinehelp/zappyshell/index.htm#page=db/db.htm">as listed here</a> .<img decoding="async" class="figureimage" title="ZappyShell - Open Installed File or Directory" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/open-zappyshell.png" alt="ZappyShell - Open Installed File or Directory" /></li>
<li>Select JSON Export Option from the Dropdown. You can also choose XML, Excel or CSV<img decoding="async" class="figureimage" title="XML file generate" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-xml.png" alt="XML file generate" /></li>
<li>You can use the Custom Layout Option if you wish to Export using custom Output Layout else just choose tables you like to export or type SQL query.<br />
<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout.png" alt="JSON Custom Layout" /></li>
<li>Configure your Input Dataset(s) (can be SQL Queries or Tables) and define Desired Layout for your Output File.<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout-add-dataset.png" alt="JSON Custom Layout - Add Dataset" /></li>
<li>Here is just an example of how to define an Array for a nested layout in a JSON or XML file.<img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-json-custom-layout-add-element-in-document-array.png" alt="Layout Editor to define Structure of JSON / XML Output" /></li>
<li>t the end of configuration you may see command line like below (more examples <a href="https://zappysys.com/onlinehelp/zappyshell/scr/db/db-db-export.htm">listed here</a>)<strong>Example: Simple mode Export (Microsoft SQL Server)</strong><br />
<pre class="crayon-plain-tag">db.exe export customers --json -o c:\data\cust.json --connstr "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;" -y</pre>
<strong>Example: For Simple mode Export (MySQL SQL Server &#8211; ODBC Driver)</strong><br />
<pre class="crayon-plain-tag">export customers --out c:\data\customers.json --json --overwrite --connstr "Driver={MySQL ODBC 5.2 ANSI Driver};Server=your_server_name_or_ip;Port=3306;Uid=user1;pwd=SomeP@ssword;Database=your_db_name"</pre>
<strong><strong>Example: For custom layout mode Export<br />
</strong></strong><br />
<pre class="crayon-plain-tag">export --map c:\data\MySampleMap.xml -o c:\data\customers.json --json --connstr "Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;" -y</pre>
</li>
<li>Once the Command line is created you can click <strong>Run</strong> to test and then copy it into tools like Informatica Command Task (see next section).</li>
</ol>
<h2>Export / Create JSON File In Informatica</h2>
<ol>
<li>Once the command line is prepared (see previous section) we can open Informatica Developer (D)</li>
<li>Connect to your Repository and create a new workflow</li>
<li>Drag new Command Task, from Toolbox and double click to edit
<div id="attachment_10021" style="width: 691px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png"><img decoding="async" aria-describedby="caption-attachment-10021" class="size-full wp-image-10021" src="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png" alt="Informatica Command Task" width="681" height="281" srcset="https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task.png 681w, https://zappysys.com/blog/wp-content/uploads/2023/03/informatica-command-task-300x124.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></a><p id="caption-attachment-10021" class="wp-caption-text">Informatica Command Task</p></div></li>
<li>Enter the sample command line we obtained from the previous step</li>
<li>Save the workflow and run it&#8230; That&#8217;s it you will see the JSON file generated</li>
</ol>
<h2>Export / Create XML File In Informatica</h2>
<p>Same Steps as above except choose File format as XML and you will see output like the below once you run the command line.</p>
<div style="width: 905px" class="wp-caption alignnone"><img decoding="async" class="figureimage" title="Export / Create XML File In Informatica" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-xml.png" alt="Export / Create XML File In Informatica" width="895" height="160" /><p class="wp-caption-text">Export / Create XML File In Informatica</p></div>
<h2>Export / Create CSV File In Informatica</h2>
<p>Same Steps as above except choose File format as CSV and you will see output like the below once you run the command line.</p>
<div style="width: 817px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="figureimage" title="Generate CSV Files in Informatica" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/dbcommandbuilder/db-command-builder-csv-output.png" alt="Generate CSV Files in Informatica" width="807" height="507" /><p class="wp-caption-text">Generate CSV Files in Informatica</p></div>
<h2>Export / Create Excel File In Informatica</h2>
<p>Same Steps as above except choose File format as Excel and you will see output like the below once you run the command line.</p>
<p><img decoding="async" src="https://zappysys.com/onlinehelp/zappyshell/scr/images/export-sql-server-table-to-excel-split-by-column.png" alt="Export SQL Server Table to Excel files (split automatically using group by column)" /></p>
<h2>Conclusion</h2>
<p>In this post, we just saw how easy it is to generate JSON / XML / Excel or CSV files in tools like Informatica, Talend, python, PowerShell in few clicks without coding. You can schedule job to generate JSON / XML files from Database tables or SQL Query. <a href="https://zappysys.com/products/zappyshell/download/">Download ZappyShell</a> Today and try it to see what else you can do with it.</p>
<p>The post <a href="https://zappysys.com/blog/export-create-json-file-informatica-sql-query-database-tables/">Export / Create JSON File in Informatica (from SQL Query / Database Tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to convert SQL to CSV in SSIS</title>
		<link>https://zappysys.com/blog/convert-sql-to-csv-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Thu, 16 Jan 2020 22:54:16 +0000</pubDate>
				<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[SERVER]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8643</guid>

					<description><![CDATA[<p>How to convert SQL to CSV in SSIS There are several tricks related to converting SQL to CSV. For example, dates, working with variables, converting text, working with stored procedures. In this article, we will work with several tips to convert SQL Server data to the CSV format. For this article, we will use the [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/convert-sql-to-csv-ssis/">How to convert SQL to CSV in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>How to convert SQL to CSV in SSIS</h2>
<p>There are several tricks related to converting SQL to CSV. For example, dates, working with variables, converting text, working with stored procedures. In this article, we will work with several tips to convert SQL Server data to the CSV format.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div><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>
<p>For this article, we will use the following ZappySys component:</p>
<div class="su-table su-table-alternate">
<table width="300">
<tbody>
<tr style="line-height: 0px">
<td width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener"><br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/images/SSIS-PowerPack/ssis-export-csv-file-task.png" alt="SSIS REST API Web Service Task " width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">SSIS Export CSV File Task<br />
</a></td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
<h2>How to convert SQL to CSV using specific dates</h2>
<ol>
<li>First, to convert the date to a specific format, you can use the Export CSV task.</li>
<li>This task allows you to convert SQL Server tables into CSV files. We will show how to set the date to a specific format:
<div id="attachment_11503" style="width: 728px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-from-SSIS-SQL-Server-to-CSV-in-a-specific-date-format.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11503" class="size-full wp-image-11503" src="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-from-SSIS-SQL-Server-to-CSV-in-a-specific-date-format.png" alt="" width="718" height="595" srcset="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-from-SSIS-SQL-Server-to-CSV-in-a-specific-date-format.png 718w, https://zappysys.com/blog/wp-content/uploads/2020/01/Export-from-SSIS-SQL-Server-to-CSV-in-a-specific-date-format-300x249.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-11503" class="wp-caption-text">Export from SSIS SQL Server to CSV in a specific date format</p></div>
<div class="mceTemp"></div>
</li>
<li>The query used for this purpose is the following:<br />
<pre class="crayon-plain-tag">SELECT [OrderID] ,FORMAT([OrderDate], 'dd/MM/yyyy') as mydateformat FROM [dbo].[Orders]</pre>
</li>
<li>As you can see, you can send custom queries in the Export CSV task.<br />
In this example, we utilize the T-SQL Format function, which enables us to convert the date to a custom format. In this example, we are converting the OrderDate column into the format dd/MM/yyyy.</li>
<li>Also, specify the destination path:
<div id="attachment_11504" style="width: 728px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-path-csv.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11504" class="size-full wp-image-11504" src="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-path-csv.png" alt="" width="718" height="595" srcset="https://zappysys.com/blog/wp-content/uploads/2020/01/Export-path-csv.png 718w, https://zappysys.com/blog/wp-content/uploads/2020/01/Export-path-csv-300x249.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-11504" class="wp-caption-text">Export path csv</p></div>
<div class="mceTemp"></div>
</li>
<li>Finally, run the package. In this example, we converted the date to the format dd/MM/yyyy.</li>
</ol>
<h2>How to convert SQL Server to CSV using dynamic column names</h2>
<ol>
<li>A common question is to have column names based on SSIS variables. This time, we will show how to do this.</li>
<li>First of all, we will need an SSIS variable that will contain the column name:
<div id="attachment_11507" style="width: 644px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-variable-with-a-column-name.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11507" class="size-full wp-image-11507" src="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-variable-with-a-column-name.png" alt="" width="634" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-variable-with-a-column-name.png 634w, https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-variable-with-a-column-name-300x73.png 300w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-11507" class="wp-caption-text">SSIS variable with a column name</p></div>
<div class="mceTemp"></div>
</li>
<li>Secondly, we need to use the value of the variable as the column name. We will use the alias (AS in SQL) to create a custom name.
<div class="mceTemp"></div>
<div id="attachment_11506" style="width: 728px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-column-name.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11506" class="size-full wp-image-11506" src="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-column-name.png" alt="" width="718" height="595" srcset="https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-column-name.png 718w, https://zappysys.com/blog/wp-content/uploads/2020/01/SSIS-column-name-300x249.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-11506" class="wp-caption-text">SSIS column name</p></div></li>
<li>The SQL query will look like this:<br />
<pre class="crayon-plain-tag">SELECT [ShipperID] as {{User::column}} FROM [Northwind].[dbo].[Shippers]</pre>
</li>
<li>The previous example used the SSIS variable named column to store the name of the column. If the Variable value is &#8216;column1&#8217;, the name of the column will be &#8216;column1&#8217;.</li>
</ol>
<h2>How to convert SQL Server to CSV to change the decimal point to a decimal comma</h2>
<ol>
<li>Most of the countries in the world use the decimal point or the decimal comma. For decimals, some countries use the comma and others the period. In this new example, we will show how to convert decimal data into a comma.</li>
<li>In order to convert, we will convert and work with a text data type. We will use the following script to create a table with data:<br />
<pre class="crayon-plain-tag">create table decimalpoint
(
decimal nvarchar(50)
)

insert into decimalpoint values 
('3,45'),
('3,44'),
('6,56')</pre>
</li>
<li>Secondly, we will use the following T-SQL Sentence: select replace(decimal,&#8217;,&#8217;,&#8217;.&#8217;) as mydecimal from decimalpoint.<br />
<pre class="crayon-plain-tag">select replace(decimal,',','.') from decimalpoint</pre>
</li>
<li>In addition, we will create a path to export.</li>
<li>If everything is fine, the CSV file created will convert the period decimal to a coma decimal.</li>
</ol>
<h2>How to export data from a parameterized SQL Server stored procedure into a<br />
CSV file</h2>
<ol>
<li>In this new example, we will use a stored procedure with parameters and store the results into a CSV file.</li>
<li> First of all, we will use the following parameterized stored procedure:<br />
<pre class="crayon-plain-tag">create procedure [dbo].[Sales by Year]
@Beginning_Date DateTime, @Ending_Date DateTime AS
SELECT Orders.ShippedDate, Orders.OrderID, "Order Subtotals".Subtotal, 
DATENAME(yy,ShippedDate) AS Year
FROM Orders INNER JOIN "Order Subtotals" 
ON Orders.OrderID = "Order Subtotals".OrderID
WHERE Orders.ShippedDate Between @Beginning_Date And @Ending_Date
GO</pre>
</li>
<li>Secondly, we will invoke the stored procedure like this:
<div class="mceTemp"></div>
<div id="attachment_11505" style="width: 728px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2020/01/invoice-stored-procedure-and-export-to-csv.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11505" class="size-full wp-image-11505" src="https://zappysys.com/blog/wp-content/uploads/2020/01/invoice-stored-procedure-and-export-to-csv.png" alt="" width="718" height="595" srcset="https://zappysys.com/blog/wp-content/uploads/2020/01/invoice-stored-procedure-and-export-to-csv.png 718w, https://zappysys.com/blog/wp-content/uploads/2020/01/invoice-stored-procedure-and-export-to-csv-300x249.png 300w" sizes="(max-width: 718px) 100vw, 718px" /></a><p id="caption-attachment-11505" class="wp-caption-text">Invoice stored procedure and export to csv</p></div></li>
<li>Finally, if everything is fine, the data will be exported to the CSV file after running the package.</li>
</ol>
<h2>Conclusion</h2>
<p>In this article, we demonstrate how to export data to CSV from SQL Server using various date formats. We also learned how to change the types of decimals used. For more fun, please <a href="https://zappysys.com/products/ssis-powerpack/download/">download our components.</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/convert-sql-to-csv-ssis/">How to convert SQL to CSV in 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>How to Pivot CSV Data in SSIS</title>
		<link>https://zappysys.com/blog/pivot-csv-data-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 19 Oct 2019 08:22:53 +0000</pubDate>
				<category><![CDATA[SSIS CSV Source]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8207</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw How to write data into CSV file in SSIS (GZip / Split). Now in this blog, we will see How to Pivot CSV Data in SSIS using CSV Source. It also supports Pivot mode so you can convert single CSV string value into Rows. In this article we [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/pivot-csv-data-ssis/">How to Pivot CSV Data in 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/2018/02/ssis-csv-file-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3102 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-csv-file-source.png" alt="" width="100" height="100" /></a>In our previous blog we saw <a href="https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/" target="_blank" rel="noopener">How to write data into CSV file in SSIS (GZip / Split)</a>. Now in this blog, we will see <strong>How to Pivot CSV Data in SSIS using <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">CSV Source</a></strong>. It also supports Pivot mode so you can convert single CSV string value into Rows. In this article we also see how make some CSV columns as parent and not consider it in pivot and load it as it is using <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser Transform</a> Pivot Option.</p>
<p>In nutshell, this post will focus on how to Pivot CSV Data into multiple columns and rows.</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>How to Pivot CSV Data in SSIS using CSV File Source</h2>
<p>Let´s start with an example. In this SSIS CSV Parser Transform example, we will Parse database column string into multiple columns and rows.</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>Furthermore, drag and drop the CSV Source and Double click on it to configure it.
<div id="attachment_8212" style="width: 701px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8212" class="wp-image-8212 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" alt="Drag and Drop : CSV Source from SSIS Toolbox" width="691" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png 691w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source-300x155.png 300w" sizes="(max-width: 691px) 100vw, 691px" /></a><p id="caption-attachment-8212" class="wp-caption-text">Drag and Drop : CSV Source from SSIS Toolbox</p></div></li>
<li>Enter the CSV file path and select desire column delimiter most common in CSV is comma and check the First Row as headers and click on preview.
<div id="attachment_8213" style="width: 683px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8213" class="wp-image-8213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" alt="CSV Source Preview" width="673" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png 673w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview-275x300.png 275w" sizes="(max-width: 673px) 100vw, 673px" /></a><p id="caption-attachment-8213" class="wp-caption-text">CSV Source Preview</p></div></li>
<li>Now, go to Pivot Columns to Rows Tab and checked Enable Pivoting and click on Preview Data to view the data.
<div id="attachment_8214" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8214" class="wp-image-8214 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-768x643.png" alt="CSV Source Pivoted Data Preview" width="720" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-768x643.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview-300x251.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-pivot-preview.png 874w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-8214" class="wp-caption-text">CSV Source Pivoted Data Preview</p></div></li>
<li>That&#8217;s it we see how to read data from CSV File and also Pivot the CSV Data using CSV Source.</li>
<li>Now In the next section we will see how to how make some CSV columns as parent and not consider it in pivot and load it as it is.</li>
</ol>
<h2>How make some CSV columns as parent.</h2>
<p>Sometimes you just need to make child columns in to rows and want to leave parent level columns as it is.</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>Secondly, drag and drop the CSV Source and Double click on it to configure it.
<div id="attachment_8212" style="width: 701px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8212" class="wp-image-8212 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png" alt="Drag and Drop : CSV Source from SSIS Toolbox" width="691" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source.png 691w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-drag-drop-csv-source-300x155.png 300w" sizes="(max-width: 691px) 100vw, 691px" /></a><p id="caption-attachment-8212" class="wp-caption-text">Drag and Drop : CSV Source from SSIS Toolbox</p></div></li>
<li>Furthermore, enter the file path and click on preview.
<div id="attachment_8213" style="width: 683px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8213" class="wp-image-8213 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png" alt="CSV Source Preview" width="673" height="735" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview.png 673w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-source-preview-275x300.png 275w" sizes="(max-width: 673px) 100vw, 673px" /></a><p id="caption-attachment-8213" class="wp-caption-text">CSV Source Preview</p></div></li>
<li>For example if we want to pivot Email and Phone only in pivoting and wants to exclude parent level columns FirstName and LastName as it is.</li>
<li>For that drag and drop JSON Generator Transform and Select Output Mode as <strong>Output One JSON Per Parent Input Row</strong>  and Add Unbound Nested Element and named it as <strong>Persons and click on OK</strong>.
<div id="attachment_8277" style="width: 638px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8277" class="wp-image-8277 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png" alt="JSON Generator Add Unbound Nested Element" width="628" height="624" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element.png 628w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-300x298.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a><p id="caption-attachment-8277" class="wp-caption-text">JSON Generator Add Unbound Nested Element</p></div></li>
<li>Now add that two parent level fields FirstName and LastName in the Persons.
<div id="attachment_8278" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8278" class="wp-image-8278 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png" alt="JSON Generator Add Multiple Elements" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8278" class="wp-caption-text">JSON Generator Add Multiple Elements</p></div></li>
<li>Now select Person Element and right click and Add Unbound Nested Element and <strong>named it as Contacts and click on OK</strong>.
<div id="attachment_8279" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8279" class="wp-image-8279 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png" alt="JSON Generator Add Unbound Nested Element" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-unbound-nested-element-in-attribute-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8279" class="wp-caption-text">JSON Generator Add Unbound Nested Element</p></div></li>
<li>Now add that two child level fields Email and Phone in the Contacts.
<div id="attachment_8280" style="width: 746px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8280" class="wp-image-8280 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png" alt="JSON Generator Add Multiple Elements" width="736" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2.png 736w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-add-multiple-attributes-2-300x254.png 300w" sizes="(max-width: 736px) 100vw, 736px" /></a><p id="caption-attachment-8280" class="wp-caption-text">JSON Generator Add Multiple Elements</p></div></li>
<li>Therefore JSON Generator Transform looks like below screen. Now Copy that Sample Preview JSON String to use it in the JSON Parser Transom as sample string.
<div id="attachment_8276" style="width: 743px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8276" class="wp-image-8276 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png" alt="JSON Generator Transform - Sample Data" width="733" height="833" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data.png 733w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-generator-sample-data-264x300.png 264w" sizes="(max-width: 733px) 100vw, 733px" /></a><p id="caption-attachment-8276" class="wp-caption-text">JSON Generator Transform &#8211; Sample Data</p></div></li>
<li>Similarly, drag and drop JSON Parser Transform and select the Input JSON Column and Paste that copied Sample JSON String and select the Contacts filter to read the Child data and click on Include Parent.
<div id="attachment_8281" style="width: 853px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8281" class="wp-image-8281 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png" alt="JSON Parser Transform - Select Filter " width="843" height="650" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter.png 843w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter-300x231.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-select-filter-768x592.png 768w" sizes="(max-width: 843px) 100vw, 843px" /></a><p id="caption-attachment-8281" class="wp-caption-text">JSON Parser Transform &#8211; Select Filter</p></div></li>
<li>Now go to Pivot Columns to Rows Tab and checked the Enable Pivoting and click on the Preview.
<div id="attachment_8282" style="width: 608px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8282" class="wp-image-8282 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png" alt="JSON Parser Transform - Enable Pivoting" width="598" height="656" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting.png 598w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-json-parser-enable-pivoting-273x300.png 273w" sizes="(max-width: 598px) 100vw, 598px" /></a><p id="caption-attachment-8282" class="wp-caption-text">JSON Parser Transform &#8211; Enable Pivoting</p></div></li>
<li>Finally, we are ready to load this data.
<div id="attachment_8283" style="width: 887px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8283" class="wp-image-8283 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png" alt="CSV Pivoted Data" width="877" height="388" srcset="https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer.png 877w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer-300x133.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/10/ssis-csv-pivot-data-viewer-768x340.png 768w" sizes="(max-width: 877px) 100vw, 877px" /></a><p id="caption-attachment-8283" class="wp-caption-text">CSV Pivoted Data</p></div></li>
<li>Let&#8217;s load this data in the SQL Server.</li>
</ol>
<h2><span id="Load_Walmart_API_data_into_SQL_Server">Load Pivoted CSV File data into SQL Server</span></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>After all, we saw you how to read CSV file data, pivot the data and Similarly, using SSIS JSON Generator and Parser Transform Pivot the CSV Data excluding some columns from pivoting.  To explore many other scenarios not discussed in this article download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following URL for more information.</p>
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-csv-source.htm" target="_blank" rel="noopener">CSV Source</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/pivot-csv-data-ssis/">How to Pivot CSV Data in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Parse CSV string into multiple columns and rows using SSIS</title>
		<link>https://zappysys.com/blog/parse-csv-string-multiple-columns-rows-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 17 Aug 2019 06:49:12 +0000</pubDate>
				<category><![CDATA[SSIS CSV Parser Transform]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7775</guid>

					<description><![CDATA[<p>Introduction In our previous blog, we saw how to write data to a CSV file in SSIS (GZip/Split). In this blog, we will parse a CSV string into multiple columns and rows using the SSIS CSV Parser Transform (helpful for extracting data from a raw CSV string stored as a database column or from another source). It [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/parse-csv-string-multiple-columns-rows-using-ssis/">Parse CSV string into multiple columns and rows 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/2019/08/ssis-csv-parser-transform.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-7778 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-csv-parser-transform.png" alt="SSIS CSV Parser Transform" width="128" height="128" /></a><span style="box-sizing: border-box; margin: 0px; padding: 0px;">In our previous blog, we saw <a href="https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/" target="_blank" rel="noopener">how to write data to a CSV file in SSIS (GZip/Split)</a>.</span> <span style="box-sizing: border-box; margin: 0px; padding: 0px;">In this blog, we will parse a CSV string into multiple columns and rows using the SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-parser-transform/" target="_blank" rel="noopener">CSV Parser Transform</a> (helpful for extracting data from a raw CSV string stored as a database column or from another source).</span> It also supports Pivot mode, allowing you to convert a single CSV string value into Rows.</p>
<p>In a nutshell, this post will focus on parsing a CSV string into multiple columns and rows using the CSV Parser Transform.</p>
<p>&nbsp;</p>
<h2>Prerequisite</h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</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>How to Extract Data from SQL Server Table and Parse a string into multiple columns and rows.</h2>
<p>&nbsp;</p>
<p>Let&#8217;s start with an example. In this SSIS CSV Parser Transform example, we will parse a database column containing a CSV string into multiple columns and rows.</p>
<ol>
<li>First of all, drag and drop the Data Flow Task from the SSIS Toolbox and double-click it to edit.
<div id="attachment_11622" style="width: 472px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11622" class="wp-image-11622 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png" alt="" width="462" height="157" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png 462w, https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox-300x102.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></a><p id="caption-attachment-11622" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div>
<div class="mceTemp"></div>
</li>
<li>Furthermore, drag and drop the OLE DB Source.
<div id="attachment_11624" style="width: 517px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11624" class="wp-image-11624 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png" alt="" width="507" height="192" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png 507w, https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop-300x114.png 300w" sizes="(max-width: 507px) 100vw, 507px" /></a><p id="caption-attachment-11624" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div>
<div class="mceTemp"></div>
</li>
<li>Double-click the OLE DB Source to configure it, then click OK.
<div id="attachment_11632" style="width: 763px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Configure-OLE-DB-Source-Editor.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11632" class="wp-image-11632 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Configure-OLE-DB-Source-Editor.png" alt="" width="753" height="637" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Configure-OLE-DB-Source-Editor.png 753w, https://zappysys.com/blog/wp-content/uploads/2019/08/Configure-OLE-DB-Source-Editor-300x254.png 300w" sizes="(max-width: 753px) 100vw, 753px" /></a><p id="caption-attachment-11632" class="wp-caption-text">Configure OLE DB Source Editor</p></div></li>
<li>Now drag and drop the CSV Parser Transform, then connect it to the OLE DB source.</li>
<li>Double-click on CSV Parser Transform and select that column from the drop-down, enter sample data, and click on Preview.
<div id="attachment_11633" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-Preview.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11633" class="wp-image-11633 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-Preview.png" alt="" width="828" height="575" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-Preview.png 828w, https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-Preview-300x208.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-Preview-768x533.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11633" class="wp-caption-text">CSV Parser Transform Preview</p></div></li>
<li>That&#8217;s it, now you can use that data in your desired destination.
<div id="attachment_11634" style="width: 897px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-result.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11634" class="wp-image-11634 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-result.png" alt="" width="887" height="496" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-result.png 887w, https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-result-300x168.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/CSV-Parser-Transform-result-768x429.png 768w" sizes="(max-width: 887px) 100vw, 887px" /></a><p id="caption-attachment-11634" class="wp-caption-text">CSV Parser Transform result</p></div></li>
</ol>
<h2>SSIS CSV Parser Transform &#8211; Pivot Option (Normalize CSV string)</h2>
<p>If Pivot Option is enabled, you will see two extra columns in the output (Pivot_Name and Pivot_Value).</p>
<p>Property name will appear in the &#8220;Pivot_Name&#8221; column, and property value will appear in the ”Pivot_Value&#8217;’ column. This option is beneficial when your data has a dynamic number of attributes and you want to store them as rows rather than columns—parent level.</p>
<div id="attachment_11635" style="width: 838px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/SSIS-CSV-Parser-Transform-Pivot-Option-Normalize-CSV-string.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11635" class="wp-image-11635 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/SSIS-CSV-Parser-Transform-Pivot-Option-Normalize-CSV-string.png" alt="" width="828" height="575" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/SSIS-CSV-Parser-Transform-Pivot-Option-Normalize-CSV-string.png 828w, https://zappysys.com/blog/wp-content/uploads/2019/08/SSIS-CSV-Parser-Transform-Pivot-Option-Normalize-CSV-string-300x208.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/SSIS-CSV-Parser-Transform-Pivot-Option-Normalize-CSV-string-768x533.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11635" class="wp-caption-text">SSIS CSV Parser Transform &#8211; Pivot Option (Normalize CSV string)</p></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, we saw how to parse a string into multiple columns and rows using the SSIS CSV Parser Transform from a SQL Server Table using an OLE DB Connection.  To explore many other scenarios not discussed in this article, download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following URL for more information.</p>
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-csv-parser-transform.htm" target="_blank" rel="noopener">CSV Parser Transform</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/parse-csv-string-multiple-columns-rows-using-ssis/">Parse CSV string into multiple columns and rows using SSIS</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>Import Azure Blob files into SQL Server (CSV/JSON/XML Driver)</title>
		<link>https://zappysys.com/blog/import-azure-blob-files-sql-server-csv-json-xml-driver/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Aug 2019 15:52:30 +0000</pubDate>
				<category><![CDATA[Azure Blob CSV Driver]]></category>
		<category><![CDATA[Azure Blob JSON Driver]]></category>
		<category><![CDATA[Azure Blob XML Driver]]></category>
		<category><![CDATA[ODBC Drivers]]></category>
		<category><![CDATA[ODBC Gateway]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[blob]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[linked server]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7638</guid>

					<description><![CDATA[<p>Introduction There might be a case when you have many CSV, JSON or XML files in Azure Blob 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 Azure [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/import-azure-blob-files-sql-server-csv-json-xml-driver/">Import Azure Blob 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-7639 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/08/blob-to-sql-150x150.png" alt="" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/blob-to-sql-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/08/blob-to-sql-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/blob-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 Azure Blob 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 Azure Blob CSV, Azure Blob JSON and Azure Blob XML drivers that let you connect to an Azure Storage Explorer and read the contents from the files in the Container. Bringing in ZappySys Data Gateway allows doing that right from a SQL Server. Let&#8217;s begin and see how to Import Azure Blob files into SQL Server (CSV/JSON/XML Driver).</p>
<p>These drivers are related to this article:</p>
<div class="content_block" id="custom_post_widget-7641"><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/odbc-powerpack/odbc-azure-blob-csv-driver.png" alt="Azure Blob CSV Driver" 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/azure-blob-odbc-driver-csv-files/" target="_blank" rel="noopener">Azure Blob Driver (for CSV Files)</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-7643"><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://zappysys.com/images/odbc-powerpack/odbc-azure-blob-json-driver.png" alt="Azure Blob JSON Driver" 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/azure-blob-odbc-driver-json-files/" target="_blank" rel="noopener">Azure Blob Driver (for JSON Files)</a></div>
</div></div>
<div class="content_block" id="custom_post_widget-7645"><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/odbc-powerpack/odbc-azure-blob-xml-driver.png" alt="Azure Blob XML Driver" 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/azure-blob-odbc-driver-xml-files/" target="_blank" rel="noopener">Azure Blob Driver (for XML Files)</a></div>
</div></div>
<h2>Prerequisites</h2>
<ol>
<li>Firstly, Download and install <a href="https://go.microsoft.com/fwlink/?LinkId=717179&amp;clcid=0x4009" target="_blank" rel="noopener">Microsoft Azure Storage Emulator</a> and <a href="https://azure.microsoft.com/en-us/features/storage-explorer/" target="_blank" rel="noopener">Microsoft Azure Storage Explorer.</a></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>
<p><strong>NOTE:</strong> If you want to use Live account (Azure Storage) then you can skip Step #3</p>
<h2>Getting started</h2>
<p>In order to start, we will show several examples. ZappySys includes Data Gateway that will help you in reading data of Azure Blob files. Here we are showing you is, how to Import Azure Blob files into SQL Server (CSV/JSON/XML Driver).</p>
<p>You can connect to Azure Storage Service from SSIS, you will need Storage Account Name and Access Key. Ask your SysAdmin or responsible person to provide that information to you. <a href="https://zappysys.com/forums/topic/azure-blob-storage-how-to-create-new-storage-account-and-get-access-key/" target="_blank" rel="noopener">Click here</a> to read more about how to get your Storage Account Name and Access Key. Here are sample Credentials.</p><pre class="crayon-plain-tag">Account Name: mystorageaccount
Access Key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==</pre><p>
If you don&#8217;t have Azure Storage account then you can try offline mode on your local machine. You can just <a href="http://www.microsoft.com/en-us/download/details.aspx?id=42317" target="_blank" rel="noopener">download Azure Storage Emulator</a> and start testing.</p>
<h2><span id="Setup_Azure_Storage_client_tools_and_Create_Queue"><span id="Setup_Azure_Storage_client_tools">Setup Azure Storage Explorer</span></span></h2>
<p>Setup Azure Storage client tools we will start from a simple example of how to load Invoice Data from a CSV that is located in Azure Blob, then we will load JSON contacts data from them and finally, we will proceed by loading contacts from many XML files those are compressed in ZIP.</p>
<ol>
<li>Once you have <a href="https://go.microsoft.com/fwlink/?LinkId=717179&amp;clcid=0x4009" target="_blank" rel="noopener">downloaded and installed storage emulator</a> You can launch Microsoft Azure Storage Emulator from its Physical location or from the desktop or start menu shortcut.
<div id="attachment_3631" class="wp-caption aligncenter">
<p><a href="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3631 size-full" src="https://i1.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png?resize=720%2C79&amp;ssl=1" alt="Azure Storage Emulator Physical Location" width="643" height="70" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png 859w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location-300x33.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location-768x84.png 768w" sizes="(max-width: 643px) 100vw, 643px" /></a></p>
<p class="wp-caption-text">Azure Storage Emulator Physical Location</p>
</div>
</li>
<li>If you can see the below-attached Command Prompt screen after Emulator started. Then you can proceed to start Microsoft Azure Storage Explorer as the Azure Storage Emulator is started successfully.
<div id="attachment_3633" class="wp-caption aligncenter">
<p><a href="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-screen-after-started-e1552723801433.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3633 size-full" src="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-screen-after-started-e1552723801433.png?resize=700%2C237&amp;ssl=1" alt="Command Prompt Screen after Microsoft Azure Storage Emulator Started" width="643" height="218" /></a></p>
<p class="wp-caption-text">Command Prompt Screen after Microsoft Azure Storage Emulator Started</p>
</div>
</li>
<li>Now, you have to <a href="https://azure.microsoft.com/en-us/features/storage-explorer/" target="_blank" rel="noopener">download and install Microsoft Azure Storage Explorer</a> and then you can launch Microsoft Azure Storage Explorer from its Physical location or from the desktop or start menu shortcut.
<div id="attachment_3635" class="wp-caption aligncenter">
<p><a href="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png?ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-3635 size-full" src="https://i0.wp.com/zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png?resize=720%2C84&amp;ssl=1" alt="Microsoft Azure Storage Explorer Location" width="643" height="75" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png 827w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location-300x35.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location-768x90.png 768w" sizes="(max-width: 643px) 100vw, 643px" /></a></p>
<p class="wp-caption-text">Microsoft Azure Storage Explorer Location.</p>
</div>
</li>
<li>For Creating a Blob Container, First of all, you need to go to Microsoft Storage Explorer Window. Then you can go through like this way (Storage Accounts –&gt; (Development) –&gt; Blob Containers).
<div id="attachment_3637" style="width: 556px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-create-blob-container-e1552723740747.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3637" class="size-full wp-image-3637" src="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-create-blob-container-e1552723740747.png" alt="Microsoft Azure Storage Explorer : Create Blob Container" width="546" height="584" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-create-blob-container-e1552723740747.png 546w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-create-blob-container-e1552723740747-280x300.png 280w" sizes="(max-width: 546px) 100vw, 546px" /></a><p id="caption-attachment-3637" class="wp-caption-text">Microsoft Azure Storage Explorer: Create a Blob Container</p></div></li>
</ol>
<h2><span style="font-size: 14pt;">Open and Configure ZappySys Data Gateway</span></h2>
<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>
<h2>Import CSV file located at Azure Blob into SQL Server</h2>
<h3>Overview</h3>
<p>Let&#8217;s say you have CSV file that is located in Azure Blob Container, and you want them all data into your SQL Server. We will follow the same steps for that we will do for import JSON and XML file into SQL Server.</p>
<div id="attachment_7719" style="width: 612px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-file-list.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7719" class="wp-image-7719 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-file-list.png" alt="Azure Blob Container - CSV File Located" width="602" height="418" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-file-list.png 602w, https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-file-list-300x208.png 300w" sizes="(max-width: 602px) 100vw, 602px" /></a><p id="caption-attachment-7719" class="wp-caption-text">Azure Blob Container &#8211; CSV File Located</p></div>
<h3>Create an Azure Blob CSV 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. In the Data Source tab, Just click on <strong>Add</strong> button, give the data source a name, e.g. &#8220;<strong>MyInvoiceCSV</strong>&#8220;, and then select <strong>Native &#8211; ZappySys Azure Blob CSV Driver</strong><strong>.</strong>
<div id="attachment_7746" style="width: 572px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-data-source-e1565697707852.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7746" class="wp-image-7746 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-data-source-e1565697707852.png" alt="Create Data Source - Azure Blob CSV Driver" width="562" height="539" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-data-source-e1565697707852.png 562w, https://zappysys.com/blog/wp-content/uploads/2019/08/azure-blob-csv-data-source-e1565697707852-300x288.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-7746" class="wp-caption-text">Create Data Source &#8211; Azure Blob CSV Driver</p></div></li>
<li>Then click on <strong>Edit</strong> and add the Data Gateway user you created in the <strong>Users</strong> tab. We will use this user later when adding a Linked Server to the Data Gateway to authenticate:<img loading="lazy" decoding="async" class="size-full wp-image-7864 aligncenter" src="https://zappysys.com/blog/wp-content/uploads/2019/08/import-csv-from-azure-blob-storage-to-sql-server-add-user.png" alt="" width="681" height="629" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/import-csv-from-azure-blob-storage-to-sql-server-add-user.png 681w, https://zappysys.com/blog/wp-content/uploads/2019/08/import-csv-from-azure-blob-storage-to-sql-server-add-user-300x277.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></li>
<li>Now, click on the Edit button to configure &#8220;<strong>MyInvoiceCSV</strong>&#8221; Azure Blob CSV Data Source.
<div id="attachment_7722" style="width: 572px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/edit-azure-blob-csv-data-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7722" class="wp-image-7722 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/edit-azure-blob-csv-data-source.png" alt="Configure Data Gateway" width="562" height="539" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/edit-azure-blob-csv-data-source.png 562w, https://zappysys.com/blog/wp-content/uploads/2019/08/edit-azure-blob-csv-data-source-300x288.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-7722" class="wp-caption-text">Configure Data Gateway</p></div></li>
<li>When a window open, click on <strong>Click here to Configure the Connection</strong> and select Use the Microsoft Azure Storage Emulator. If you have Online <em>Storage Account</em> and <em><em>Account Key </em></em>then Select Enter Storage Account Credentials and enter it.<em><em><br />
</em></em></p>
<div style="width: 503px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/azure-blob-json-driver/azure-blob-json-driver-create-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/odbc-powerpack/scr/images/azure-blob-json-driver/azure-blob-json-driver-create-connection.png" alt="Create Azure Storage Connection" width="493" height="499" /></a><p class="wp-caption-text">Create Azure Storage Connection</p></div></li>
<li>Now, Select Azure Blob Container and file from it and In the Data Format / Compression (Zip / GZip) tab set suitable file Compression Format (Zip or GZip).
<div id="attachment_7721" style="width: 753px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/configure-azure-blob-csv-data-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7721" class="wp-image-7721 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/configure-azure-blob-csv-data-source.png" alt="ZappySys Azure Blob CSV - Configure Driver" width="743" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/configure-azure-blob-csv-data-source.png 743w, https://zappysys.com/blog/wp-content/uploads/2019/08/configure-azure-blob-csv-data-source-300x252.png 300w" sizes="(max-width: 743px) 100vw, 743px" /></a><p id="caption-attachment-7721" class="wp-caption-text">ZappySys Azure Blob CSV &#8211; Configure Driver</p></div></li>
<li>Go to the <strong>Preview</strong> tab and click on the <strong>Preview Data</strong> button to make sure everything is configured correctly and preview the results.
<div id="attachment_7726" style="width: 753px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/preview-azure-blob-csv-data-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7726" class="wp-image-7726 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/preview-azure-blob-csv-data-source.png" alt="ZappySys Azure Blob CSV - Preview Data" width="743" height="570" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/preview-azure-blob-csv-data-source.png 743w, https://zappysys.com/blog/wp-content/uploads/2019/08/preview-azure-blob-csv-data-source-300x230.png 300w" sizes="(max-width: 743px) 100vw, 743px" /></a><p id="caption-attachment-7726" class="wp-caption-text">ZappySys Azure Blob CSV &#8211; Preview Data</p></div></li>
<li>Now, Click on OK button also Save and Restart Service.
<div id="attachment_7724" style="width: 572px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/save-and-restart-service-data-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7724" class="wp-image-7724 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/save-and-restart-service-data-source.png" alt="ZappySys Data Gateway Service - Save and Restart" width="562" height="539" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/save-and-restart-service-data-source.png 562w, https://zappysys.com/blog/wp-content/uploads/2019/08/save-and-restart-service-data-source-300x288.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-7724" class="wp-caption-text">ZappySys Data Gateway Service &#8211; Save and Restart</p></div></li>
<li>That&#8217;s all, now we are ready to proceed and add a Linked Server to this data source.</li>
</ol>
<h3 id="Set-up-a-SQL-Server-Linked-Server">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>Once again, if you created the Linked Server with name &#8220;GATEWAY&#8221;, execute this SQL query in SSMS:</p>
<p><code>SELECT * INTO MyInvoices FROM OPENQUERY([GATEWAY], 'SELECT * FROM $')<br />
SELECT * FROM MyInvoices</code></p>
<h3>The results</h3>
<p>You should see a similar view, once you execute the query:</p>
<div id="attachment_7862" style="width: 713px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7862" class="wp-image-7862 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/80-import-csv-from-azure-blob-storage-into-sql-server-the-results-data-is-loaded-into-sql-server.png" alt="The results of loading many CSVs from Azure Blob into SQL Server" width="703" height="441" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/80-import-csv-from-azure-blob-storage-into-sql-server-the-results-data-is-loaded-into-sql-server.png 703w, https://zappysys.com/blog/wp-content/uploads/2019/08/80-import-csv-from-azure-blob-storage-into-sql-server-the-results-data-is-loaded-into-sql-server-300x188.png 300w" sizes="(max-width: 703px) 100vw, 703px" /><p id="caption-attachment-7862" class="wp-caption-text">The results of loading many CSVs from Azure Blob into SQL Server</p></div>
<h2>Import JSON file located at Azure Blob into SQL Server</h2>
<h3>Overview</h3>
<p>Let&#8217;s say you have JSON file that is located in Azure Blob Container, and you want them all data into your SQL Server. We will follow the same steps of the import CSV file into SQL Server and we will do for XML file into SQL Server.</p>
<h3>Create an Azure Blob JSON data source in ZappySys Data Gateway</h3>
<p>Follow the steps as in Create an Azure Blob CSV data source in ZappySys Data Gateway section when adding a new data source, except for these two steps:</p>
<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 Azure Blob JSON Driver.</strong>
<div id="attachment_7663" style="width: 637px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/10-create-new-data-source-in-data-gateway-to-load-json-files-from-azure-blob-into-sql-server-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7663" class="wp-image-7663 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/10-create-new-data-source-in-data-gateway-to-load-json-files-from-azure-blob-into-sql-server-1.png" alt="ZappySys Data Gateway - Create New Data Source" width="627" height="583" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/10-create-new-data-source-in-data-gateway-to-load-json-files-from-azure-blob-into-sql-server-1.png 627w, https://zappysys.com/blog/wp-content/uploads/2019/08/10-create-new-data-source-in-data-gateway-to-load-json-files-from-azure-blob-into-sql-server-1-300x279.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-7663" class="wp-caption-text">ZappySys Data Gateway &#8211; Create New Data Source</p></div>
<div class="mceTemp"></div>
<div class="mceTemp"></div>
</li>
<li>After that, select a JSON file from container 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_7670" style="width: 667px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/40-configure-azure-blob-json-data-source-to-load-data-into-sql-server-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7670" class="wp-image-7670 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/40-configure-azure-blob-json-data-source-to-load-data-into-sql-server-1.png" alt="Configuring the JSON data source to load a JSON from Azure Blob container into SQL Server" width="657" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/40-configure-azure-blob-json-data-source-to-load-data-into-sql-server-1.png 657w, https://zappysys.com/blog/wp-content/uploads/2019/08/40-configure-azure-blob-json-data-source-to-load-data-into-sql-server-1-281x300.png 281w" sizes="(max-width: 657px) 100vw, 657px" /></a><p id="caption-attachment-7670" class="wp-caption-text">Configuring the JSON data source to load a JSON from Azure Blob container into SQL Server</p></div></li>
</ol>
<p>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>Set up a SQL Server Linked Server</h3>
<p>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 CSV data source</a>, except that change <em>Catalog</em> property of the Linked Server to match the name of the Azure Blob JSON data source we created. Once you do that, you are ready to load JSON into your SQL Server.</p>
<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 the following 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 aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/600-the-results-of-importing-amazon-s3-data-into-sql-server-using-json-driver.png" target="_blank" rel="noopener"><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="The results of getting JSON data straight from Azure Blob JSON" 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" /></a><p id="caption-attachment-7536" class="wp-caption-text">The results of getting JSON data straight from Azure Blob JSON</p></div>
<p>Now we are ready to proceed to the next section and import many XML files at once.</p>
<h2>Import many XML files located at Azure Blob 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_7675" style="width: 616px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/65-load-many-compressed-xml-files-from-azure-blob-container-into-sql-server.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7675" class="wp-image-7675 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/65-load-many-compressed-xml-files-from-azure-blob-container-into-sql-server.png" alt="Zipped XML files located in Azure Blob container to be loaded into SQL Server" width="606" height="415" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/65-load-many-compressed-xml-files-from-azure-blob-container-into-sql-server.png 606w, https://zappysys.com/blog/wp-content/uploads/2019/08/65-load-many-compressed-xml-files-from-azure-blob-container-into-sql-server-300x205.png 300w" sizes="(max-width: 606px) 100vw, 606px" /></a><p id="caption-attachment-7675" class="wp-caption-text">Zipped XML files located in Azure Blob container 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 Azure Blob XML Driver. Let&#8217;s proceed and just do that.</p>
<h3>Create an Azure Blob XML data source in ZappySys Data Gateway</h3>
<p>Follow the same steps as in Create an Azure Blob JSON data source in ZappySys Data Gateway 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 Azure Blob XML Driver</strong> as <em>Connector Type.</em>
<div id="attachment_7674" style="width: 430px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/67-create-new-azure-blob-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7674" class="wp-image-7674 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/67-create-new-azure-blob-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver.png" alt="Choosing &quot;ZappySys Azure Blob XML Driver&quot; to load XMLs to SQL Server" width="420" height="296" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/67-create-new-azure-blob-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver.png 420w, https://zappysys.com/blog/wp-content/uploads/2019/08/67-create-new-azure-blob-xml-data-source-in-data-gateway-to-load-xml-files-into-sql-selver-300x211.png 300w" sizes="(max-width: 420px) 100vw, 420px" /></a><p id="caption-attachment-7674" class="wp-caption-text">Choosing &#8220;ZappySys Azure Blob XML Driver&#8221; to load XMLs to SQL Server</p></div>
<div class="mceTemp"></div>
</li>
<li>Then click on <strong>Edit</strong> and select Azure Blob Container and file from it and In the Data Format / Compression (Zip / GZip) tab set suitable file Compression Format (Zip or GZip).
<div id="attachment_7673" style="width: 667px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/70-configure-azure-blob-xml-data-source-to-load-into-sql-server.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7673" class="wp-image-7673 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/70-configure-azure-blob-xml-data-source-to-load-into-sql-server.png" alt="Configuring data source based on ZappySys Azure Blob XML Driver to load XMLs into SQL Server" width="657" height="515" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/70-configure-azure-blob-xml-data-source-to-load-into-sql-server.png 657w, https://zappysys.com/blog/wp-content/uploads/2019/08/70-configure-azure-blob-xml-data-source-to-load-into-sql-server-300x235.png 300w" sizes="(max-width: 657px) 100vw, 657px" /></a><p id="caption-attachment-7673" class="wp-caption-text">Configuring data source based on ZappySys Azure Blob XML Driver to load XMLs into SQL Server</p></div></li>
<li>Now we are ready to set up a Linked Server to this newly created data source.</li>
</ol>
<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 CSV data source</a>, except that change <em>Catalog</em> property of the Linked Server to match the name of the Azure Blob 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 the following 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 aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/750-the-result-of-importing-xml-data-from-amazon-s3-into-sql-server.png" target="_blank" rel="noopener"><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 Azure Blob Container 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" /></a><p id="caption-attachment-7550" class="wp-caption-text">The data of many XMLs loaded from Azure Blob Container 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>Conclusion</h2>
<p style="text-align: justify;">We had a goal to import Azure Blob files into SQL Server from SQL Server itself. We learned how to Import Azure Blob files into SQL Server (CSV/JSON/XML Driver), 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; Azure Blob JSON Driver, Azure Blob XML Driver, and Azure Blob 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 Azure Blob straight from SQL queries in SSMS.</p>
<h2>References</h2>
<p>Finally, you can use the following links for more information:</p>
<ul>
<li><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/azure-blob-csv-odbc-driver-intro.htm" target="_blank" rel="noopener">Azure Blob CSV Driver</a></li>
<li><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/azure-blob-json-odbc-driver-intro.htm" target="_blank" rel="noopener">Azure Blob JSON Driver</a></li>
<li><a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/azure-blob-xml-odbc-driver-intro.htm" target="_blank" rel="noopener">Azure Blob XML Driver</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/import-azure-blob-files-sql-server-csv-json-xml-driver/">Import Azure Blob 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>How to Read/Write Azure Table Storage data in SSIS</title>
		<link>https://zappysys.com/blog/read-write-azure-table-storage-data-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 13:03:21 +0000</pubDate>
				<category><![CDATA[SSIS Azure Table Storage Destination]]></category>
		<category><![CDATA[SSIS Azure Table Storage Source]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[Client]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Destination]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[read]]></category>
		<category><![CDATA[Setup]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[write]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7561</guid>

					<description><![CDATA[<p>Introduction In our previous blog, we saw how to read/write Azure Blob Storage Files in SSIS (CSV, JSON, XML Format files). Now in this blog, we will see how to Read/Write Azure Table Storage data in SSIS. To illustrate, we will use ZappySys SSIS PowerPack, which includes several tasks to import/export data from multiples sources to multiple destinations like [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-write-azure-table-storage-data-ssis/">How to Read/Write Azure Table Storage data in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="size-thumbnail wp-image-7562 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-source-150x150.png" alt="" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-source-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-source-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-source.png 448w" sizes="(max-width: 150px) 100vw, 150px" />In our previous blog, we saw how to read/write <a href="https://zappysys.com/blog/read-azure-blob-storage-files-ssis-csv-json-xml/" target="_blank" rel="noopener">Azure Blob Storage Files in SSIS (CSV, JSON, XML Format files).</a> Now in this blog, we will see how to Read/Write Azure Table Storage data in SSIS. To illustrate, we will use <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a>, which includes several tasks to import/export data from multiples sources to multiple destinations like flat files, Azure, AWS, databases, Office files and more. They are Coding free, drag and drop high-performance suite of <em>Custom SSIS Components</em> and <em>SSIS Tasks.</em> If you like to perform other operations on Azure Blob Storage Files (e.g. Download, Upload, Create, Delete) then <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-azure-blob-storage-task/" target="_blank" rel="noopener">check these articles</a>.</p>
<p>&nbsp;</p>
<h2>Component Mentioned in this article</h2>
<div class="su-table su-table-alternate">
<table style="height: 44px;width: 307px">
<tbody>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source.png" alt="" width="40" height="40" /></a></td>
<td style="height: 22px;width: 247px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-table-storage-source.htm" target="_blank" rel="noopener">Azure Table Storage Source</a></td>
</tr>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-adapter.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-adapter.png" alt="" width="40" height="40" /></a></td>
<td style="height: 22px;width: 247px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-table-storage-destination.htm" target="_blank" rel="noopener">Azure Table Storage Destination</a></td>
</tr>
</tbody>
</table>
</div>
<h2><span id="Prerequisite"><span id="Requirements">Prerequisite</span></span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>Download and install <a href="https://go.microsoft.com/fwlink/?LinkId=717179&amp;clcid=0x4009" target="_blank" rel="noopener">Microsoft Azure Storage Emulator</a></li>
<li>Download and install <a href="https://azure.microsoft.com/en-us/features/storage-explorer/" target="_blank" rel="noopener">Microsoft Azure Storage Explorer</a></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>
<p><strong>NOTE:</strong> If you want to use Live account (Azure Blob Storage) then you can skip Step #3</p>
<h2><span id="What_is_Azure_Blob_Storage">What is Azure Table Storage?</span></h2>
<p>Azure Table storage stores large amounts of structured data. The service is a NoSQL datastore which accepts authenticated calls from inside and outside the Azure cloud. Azure tables are ideal for storing structured, non-relational data. Common uses of Table storage include:</p>
<div id="attachment_7567" style="width: 310px" class="wp-caption alignright"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-intro.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7567" class="wp-image-7567 size-medium" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-intro-300x158.png" alt="Microsoft Azure Table Storage Introduction" width="300" height="158" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-intro-300x158.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-azure-table-storage-intro.png 468w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-7567" class="wp-caption-text">Microsoft Azure Table Storage Introduction</p></div>
<ul>
<li>Storing TBs of structured data capable of serving web-scale applications</li>
<li>Storing datasets that don&#8217;t require complex joins, foreign keys, or stored procedures and can be denormalized for fast access</li>
<li>Quickly querying data using a clustered index</li>
<li>Accessing data using the OData protocol and LINQ queries with WCF Data Service .NET Libraries</li>
</ul>
<p>&nbsp;</p>
<p>You can use Table storage to store and query huge sets of structured, non-relational data, and your tables will scale as demand increases.</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-azure-table-storage-source/" target="_blank" rel="noopener">SSIS Azure Table Storage Source.</a> Here we are showing you is, how to Read/Write Azure Table Storage data in SSIS.</p>
<p>You can connect to your Azure Storage Account by entering your storage account credentials. Here I am showing an example of the use of the local Azure Storage Emulator.</p>
<h2><span id="Setup_Azure_Storage_client_tools">Setup Azure Storage client tools and Create Table</span></h2>
<ol>
<li>Once you have <a href="https://go.microsoft.com/fwlink/?LinkId=717179&amp;clcid=0x4009" target="_blank" rel="noopener">downloaded and installed a storage emulator</a> You can launch Microsoft Azure Storage Emulator from its Physical location or from the desktop or start menu shortcut.
<div id="attachment_3631" style="width: 869px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3631" class="wp-image-3631 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png" alt="Azure Storage Emulator Physical Location" width="859" height="94" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location.png 859w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location-300x33.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-location-768x84.png 768w" sizes="(max-width: 859px) 100vw, 859px" /></a><p id="caption-attachment-3631" class="wp-caption-text">Azure Storage Emulator Physical Location</p></div></li>
<li>If you can see the below-attached Command Prompt screen after Emulator started. Then you can proceed to start Microsoft Azure Storage Explorer as the Azure Storage Emulator is started successfully.
<div id="attachment_3633" style="width: 710px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-screen-after-started-e1552723801433.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3633" class="wp-image-3633 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-emulator-screen-after-started-e1552723801433.png" alt="Command Prompt Screen after Microsoft Azure Storage Emulator Started" width="700" height="237" /></a><p id="caption-attachment-3633" class="wp-caption-text">Command Prompt Screen after Microsoft Azure Storage Emulator Started</p></div></li>
<li>Now, you have to <a href="https://azure.microsoft.com/en-us/features/storage-explorer/" target="_blank" rel="noopener">download and install Microsoft Azure Storage Explorer</a> and then you can launch Microsoft Azure Storage Explorer from its Physical location or from the desktop or start menu shortcut.
<div id="attachment_3635" style="width: 837px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3635" class="wp-image-3635 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png" alt="Microsoft Azure Storage Explorer Location" width="827" height="97" srcset="https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location.png 827w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location-300x35.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/04/microsoft-azure-storage-explorer-location-768x90.png 768w" sizes="(max-width: 827px) 100vw, 827px" /></a><p id="caption-attachment-3635" class="wp-caption-text">Microsoft Azure Storage Explorer Location.</p></div></li>
<li>If you don&#8217;t have Azure Storage account then it&#8217;s easy to <a href="http://azure.microsoft.com/en-us/pricing/free-trial/" target="_blank" rel="noopener">get FREE Trial Azure Storage account</a> or use your MSDN to get credit each month which will be more than enough for real testing. If you prefer to avoid all this hassle then Microsoft provides another great way to test Azure Storage functionality is totally offline mode on your local machine. You can just <a href="http://www.microsoft.com/en-us/download/details.aspx?id=42317" target="_blank" rel="noopener">download Azure Storage Emulator</a> and start testing.</li>
<li> <a href="http://msdn.microsoft.com/en-us/library/azure/hh403989.aspx" target="_blank" rel="noopener">Click here</a> to learn more about how to configure Azure Storage Emulator for Testing and Development purposes. In order to connect to Azure Storage Service from SSIS, you will need Storage AccountName and an AccessKey. Ask your SysAdmin or responsible person to provide that information to you. Here are sample Account Name and Access Key(<b>this is just example key which may differ in your case</b>)<br />
<pre class="crayon-plain-tag">Account Name: mystorageaccount 
Access Key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==</pre>
</li>
<li>For Creating a Tables, First of all, you need to go to Microsoft Storage Explorer Window. Then you can go through like this way (Storage Accounts –&gt; Emulator &#8211; Default Ports(Key) –&gt; Tables. Right-click on Tables and Select Create Table and put your table name you want.
<div style="width: 360px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-create-table.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-create-table.png" alt="Create Tables in Azure Table Storage Emulator" width="350" height="479" /></a><p class="wp-caption-text">Create Tables in Azure Table Storage Emulator</p></div></li>
</ol>
<h2>Write data using ZS Azure Table Storage Destination</h2>
<p>In this tutorial, you will learn how to write data into Azure Table Storage. You can use <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/dummydata-source.htm" target="_blank" rel="noopener">ZS DummyData Source</a> for practice it(In this case it&#8217;s from SQL Server Source). So, Let&#8217;s start with an example. In this SSIS we will write data into Azure Table Storage using ZS Azure Table Storage Destination.</p>
<ol>
<li>Once you have created Azure Storage Table and you got valid Account Name and AccessKey (for the local emulator you don&#8217;t need this) you may proceed to create a new SSIS package. In BIDS/SSDT create new SSIS package</li>
<li>From the SSIS toolbox drag and drop Data Flow Task on the control flow designer surface.
<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>Double click on the DataFlow task to see DataFlow designer surface.</li>
<li>Here, In Visual Studio, drag and drop the OLE DB Source and Azure Table Storage Destination in the design surface and join the components with the blue arrow.
<div style="width: 567px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-adapter-drag.png" alt="SSIS Azure Table Storage Destination - Drag and Drop" width="557" height="167" /></a><p class="wp-caption-text">SSIS Azure Table Storage Destination &#8211; Drag and Drop</p></div></li>
<li>Now, we need two connection, OLE DB Connection, and Azure Storage Connection. Click <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-storage-connection-manager.htm" target="_blank" rel="noopener">here</a> to create Azure Storage Connection.</li>
</ol>
<h3>How to create OLE DB Connection</h3>
<ol>
<li>Let&#8217;s, Right-click on Connection Managers Panel to Create OLE DB Connection, so you can use Source and Context Menu will appear, Select New OLE DB Connection from the Context Menu.
<div style="width: 485px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" alt="OLE DB Connection - Create New Connection" width="475" height="353" /></a><p class="wp-caption-text">OLE DB Connection &#8211; Create New Connection</p></div></li>
<li>Now, click on New Button to create Connection.
<div style="width: 665px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" alt="OLE DB Connection - Create New Connection" width="655" height="558" /></a><p class="wp-caption-text">OLE DB Connection &#8211; Create New Connection</p></div></li>
<li>Let&#8217;s Configure Connection Manager, just Follow steps one by one as we have created.
<div style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" alt="OLE DB Connection - Configure Connection" width="720" height="625" /></a><p class="wp-caption-text">OLE DB Connection &#8211; Configure Connection</p></div></li>
<li>Click on the OK button to save configure Setting UI.</li>
</ol>
<h3>Write data into Azure Storage Table in SSIS</h3>
<ol>
<li>Double click on OLE DB Source for configure it.</li>
<li>Let&#8217;s Configure in Connection Manager, just follow the below image steps.
<div style="width: 828px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" alt="OLE DB Source - Configure" width="818" height="560" /></a><p class="wp-caption-text">OLE DB Source &#8211; Configure</p></div></li>
<li>Click OK to Save OLE DB Source Editor UI Settings.</li>
<li>Now double click Azure Table Storage Destination to configure it.</li>
<li>On [Connection Manager] tab select Azure Storage Connection manager.
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-adapter-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-adapter-connection.png" alt="ZS Azure Table Storage Destination - Connection Manager" width="790" height="287" /></a><p class="wp-caption-text">ZS Azure Table Storage Destination &#8211; Connection Manager</p></div></li>
<li>Click on [Component Properties] tab and select AccessMode=Table and Pick destination Table from the Tables dropdown list.<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;">If you choose Reload option then target table is first truncated before inserting records so be careful with Reload option.</div></div>
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-table.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-table.png" alt="ZS Azure Table Storage Destination - Component Properties" width="790" height="509" /></a><p class="wp-caption-text">ZS Azure Table Storage Destination &#8211; Component Properties</p></div></li>
<li>Click on [Mappings] tab and verify mapping. Drop CustomerID and RecordID mappings and reconnect as shown below. This is just to make sure PrimaryKey columns are mapped.
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-mappings.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-storage-destination-select-mappings.png" alt="ZS Azure Table Storage Destination - Column Mappings" width="790" height="479" /></a><p class="wp-caption-text">ZS Azure Table Storage Destination &#8211; Column Mappings</p></div></li>
<li>Click OK to save settings.</li>
<li>Execute the package and verify the target data.
<div style="width: 359px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-write-data-sample.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-write-data-sample.png" alt="ZS Azure Table Storage Destination - Execute the Package" width="349" height="317" /></a><p class="wp-caption-text">ZS Azure Table Storage Destination &#8211; Execute the Package</p></div>
<div style="width: 892px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-console-verify-record-count.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-destination/ssis-azure-table-console-verify-record-count.png" alt="ZS Azure Table Storage Verify Customers Table Data" width="882" height="413" /></a><p class="wp-caption-text">ZS Azure Table Storage &#8211; Verify Customers Table Data</p></div></li>
</ol>
<h2>Read data using ZS Azure Table Storage Source</h2>
<p>In this tutorial, you will learn how to read data from Azure Table Storage in SSIS using the ZS Azure Table Storage Source adapter. In this SSIS we will read data with SQL Query and Table Mode. So Let&#8217;s begin it.</p>
<ol>
<li>You may proceed to create a new SSIS package. In BIDS/SSDT create a new SSIS package.</li>
<li>From the SSIS toolbox drag and drop Data Flow Task on the control flow designer surface.
<div style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" alt="SSIS Data Flow Task - Drag and Drop" width="460" height="155" /></a><p class="wp-caption-text">SSIS Data Flow Task &#8211; Drag and Drop</p></div></li>
<li>Double click on the DataFlow task to see DataFlow designer surface.</li>
<li>From the SSIS toolbox drag and drop Azure Table Storage Source on the data flow designer surface.
<div style="width: 538px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-drag.png" alt="ZS Azure Table Storage Source - Drag and Drop" width="528" height="99" /></a><p class="wp-caption-text">ZS Azure Table Storage Source &#8211; Drag and Drop</p></div></li>
<li>Now, we need an Azure Storage connection. Click <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-storage-connection-manager.htm" target="_blank" rel="noopener">here</a> to Create Connection.</li>
</ol>
<h3>Extract data with Query Mode</h3>
<ol>
<li>Here, we are getting data using Query Mode with Dynamic expression value.</li>
<li>Lets, create a Variable with correct DataType and Value, use the following image.
<div style="width: 442px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-create-variable.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-create-variable.png" alt="SSIS Variables - Create Variable and Store Value" width="432" height="133" /></a><p class="wp-caption-text">SSIS Variables &#8211; Create Variable and Store Value</p></div></li>
<li>Double click Azure Table Storage Source to configure it.</li>
<li>Select the connection we have created before, set AccessMode to Query. You can use the following SQL Query and select Variable. Click here for more <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=azure-table-storage-source.htm#A_QueryLanguage" target="_blank" rel="noopener">Azure Table Storage Query Examples.</a><br />
<pre class="crayon-plain-tag">SELECT * FROM Customers
WHERE Country = '{{User::varCountry}}'</pre>
<div style="width: 850px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-query-data-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-query-data-preview.png" alt="ZS Azure Table Storage Source - Configure Query Mode" width="840" height="673" /></a><p class="wp-caption-text">ZS Azure Table Storage Source &#8211; Configure Query Mode</p></div></li>
<li>Click on the Preview button to see Data Preview and OK button to save configure setting UI.</li>
<li>From the SSIS toolbox drag and drop Trash Destination on the data flow designer surface.
<div style="width: 529px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" alt="ZS Trash Destination - Drag and Drop" width="519" height="121" /></a><p class="wp-caption-text">ZS Trash Destination &#8211; Drag and Drop</p></div></li>
<li>Now single click on the Azure Table Storage Source, once you see the blue arrow from the source &#8230; connect it to Trash Destination.</li>
<li>Double click on ZS Trash Destination to Configure it.
<div style="width: 622px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" alt="ZS Trash Destination - Configure" width="612" height="523" /></a><p class="wp-caption-text">ZS Trash Destination &#8211; Configure</p></div></li>
<li>Click on the OK button to save Trash Destination configure setting UI.</li>
<li>Execute the package and verify source data in the data viewer.
<div style="width: 282px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-extract-data-query-mode.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-extract-data-query-mode.png" alt="SSIS ZS Azure Table Storage Source - Execute the Package" width="272" height="314" /></a><p class="wp-caption-text">SSIS ZS Azure Table Storage Source &#8211; Execute the Package</p></div></li>
</ol>
<h3>Extract data with Table Mode</h3>
<ol>
<li>So, Double click Azure Table Storage Source to configure it.</li>
<li>In the Azure Table Storage Source, Select the connection we have created, set AccessMode to Table and Select Table from the Tables dropdown.
<div style="width: 646px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-table-data-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-table-data-preview.png" alt="SSIS ZS Azure Table Source - Configure Table Mode" width="636" height="473" /></a><p class="wp-caption-text">SSIS ZS Azure Table Source &#8211; Configure Table Mode</p></div></li>
<li>Click on the Preview button to see Data Preview and OK button to save configure setting UI.</li>
<li>From the SSIS toolbox drag and drop Trash Destination on the data flow designer surface.
<div style="width: 529px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" alt="ZS Trash Destination - Drag and Drop" width="519" height="121" /></a><p class="wp-caption-text">ZS Trash Destination &#8211; Drag and Drop</p></div></li>
<li>Now single click on the Azure Table Storage Source, once you see the blue arrow from the source &#8230; connect it to Trash Destination.</li>
<li>Double click on ZS Trash Destination to Configure it.
<div style="width: 622px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" alt="ZS Trash Destination - Configure" width="612" height="523" /></a><p class="wp-caption-text">ZS Trash Destination &#8211; Configure</p></div></li>
<li>Click on the OK button to save Trash Destination configure setting UI.</li>
<li>In the last, Execute the package and verify source data in the data viewer.
<div style="width: 283px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-extract-data-sample.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/azure-table-storage-source/ssis-azure-table-storage-source-extract-data-sample.png" alt="ZS Azure Table Storage Source - Execute the Package" width="273" height="310" /></a><p class="wp-caption-text">ZS Azure Table Storage Source &#8211; Execute the Package</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>After all, In this blog, we learned how to write data in Azure Table Storage in SSIS. We used the Azure Table Storage Destination for write and Azure Table Storage Source to read data from Microsoft Azure Table Storage using Query and Table mode. 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>There are a few details you should use the following links for more information:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-table-storage-destination/" target="_blank" rel="noopener">Azure Table Storage Destination</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-table-storage-source/" target="_blank" rel="noopener">Azure Table Storage Source</a></li>
<li><a href="https://zappysys.com/blog/category/ssis/components/ssis-trash-destination/" target="_blank" rel="noopener">ZS Trash Destination</a></li>
<li><a href="https://docs.microsoft.com/en-us/azure/cosmos-db/table-storage-overview" target="_blank" rel="noopener">Microsoft Azure Table Storage</a></li>
<li><strong>Help File:</strong>
<ul>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-table-storage-destination.htm" target="_blank" rel="noopener">Azure Table Storage Destination</a></li>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/azure-table-storage-source.htm" target="_blank" rel="noopener">Azure Table Storage Source</a></li>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/trash-destination.htm" target="_blank" rel="noopener">ZS Trash Destination</a></li>
</ul>
</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-write-azure-table-storage-data-ssis/">How to Read/Write Azure Table Storage data in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to write data into CSV file in SSIS (GZip / Split)</title>
		<link>https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 29 Jul 2019 13:12:12 +0000</pubDate>
				<category><![CDATA[SSIS CSV File Destination]]></category>
		<category><![CDATA[Connection]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Destination]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[ole db]]></category>
		<category><![CDATA[SERVER]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ZappySys]]></category>
		<category><![CDATA[zs]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7519</guid>

					<description><![CDATA[<p>Introduction In this article, we will see how to read How to write data into CSV file in SSIS from SQL Server. We will also explain how to compress (gzip) and split  CSV files into multiple files. To illustrate, we will use ZappySys SSIS PowerPack, which includes several tasks to import/export data from multiples sources to [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/">How to write data into CSV file in SSIS (GZip / Split)</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><img loading="lazy" decoding="async" class="alignleft wp-image-7527" src="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-csv-file-destination.png" alt="ssis-csv-file-destination" width="100" height="100" />In this article, we will see how to read How to write data into CSV file in SSIS from SQL Server. We will also explain how to compress (gzip) and split  CSV files into multiple files. 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 Custom SSIS Components and SSIS Tasks. We will use the <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-csv-file-destination.htm" target="_blank" rel="noopener">ZS CSV File Destination</a> component for this article.</p>
<p>&nbsp;</p>
<h2>What is CSV File Destination?</h2>
<p><em>CSV File Destination</em> can be used to write data in CSV / TSV file format. You can also split large files by row count or size at runtime. It also supports writing files directly in a compressed format such as GZip (*.gz).</p>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:</p>
<ol>
<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 Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>).</li>
</ol>
<h2>Component Mentioned in this article</h2>
<div class="su-table su-table-alternate">
<table style="height: 44px;width: 307px">
<tbody>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination.png" alt="" width="40" height="40" /></a></td>
<td style="height: 22px;width: 247px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-csv-file-destination.htm" target="_blank" rel="noopener">CSV File Destination</a></td>
</tr>
</tbody>
</table>
</div>
<h2>How to Extract Data from SQL Server Table to CSV File Destination.</h2>
<p>In this tutorial, we are going to load data from SQL Server Table using OLE DB Source and ZS CSV File Destination. You can use ZS DummyData Source too for practice it.</p>
<ol>
<li>Firstly, you need to <b>Download and Install</b> SSIS <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys PowerPack.</a></li>
<li>Once you finished the first step, Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox.
<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>Double click on the Data Flow task to see the Data Flow designer surface.</li>
<li>Here, In Visual Studio, drag and drop the OLE DB Source and CSV File Destination in the design surface and join the tasks with the blue arrow.
<div style="width: 543px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-drag.png" alt="SSIS OLE DB Source and CSV File Destination - Drag and Drop" width="533" height="154" /></a><p class="wp-caption-text">SSIS OLE DB Source and CSV File Destination &#8211; Drag and Drop</p></div></li>
<li>Here, you can use our <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-source-adapters.htm" target="_blank" rel="noopener">ZS Data Source</a> too.</li>
<li>But, we are going through OLE DB Source so need OLE DB Connection and File Connection for CSV File Destination.</li>
</ol>
<h3>How to create OLE DB Connection.</h3>
<ol>
<li>Lets, create the first OLE DB Connection.</li>
<li>Let&#8217;s, Right-click on Connection Managers Panel to Create OLE DB Connection, so you can use Source and Context Menu will appear, Select New OLE DB Connection from the Context Menu.
<div style="width: 485px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" alt="Create OLE DB Connection" width="475" height="353" /></a><p class="wp-caption-text">Create OLE DB Connection</p></div></li>
<li>Now, click on New Button to create Connection.
<div style="width: 665px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" alt="Create New OLE DB Connection" width="655" height="558" /></a><p class="wp-caption-text">Create New OLE DB Connection</p></div></li>
<li>Let&#8217;s Configure Connection Manager, just Follow steps one by one as we have created.
<div style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" alt="Configure OLE DB Connection Manager" width="720" height="625" /></a><p class="wp-caption-text">Configure OLE DB Connection Manager</p></div></li>
<li>Click on Test Connection to see correct configure it.</li>
<li>Click on OK button to save connection configure setting UI.</li>
</ol>
<h3>How to Create a File Connection.</h3>
<ol>
<li>Let&#8217;s, Right-click on Connection Managers Panel to Create File Connection, so you can use Destination Path, and Context Menu will appear, Select New Connection from the Context Menu. In the File Connection Manager, select the Usage type and specify the path of the CSV file.<br />
CSV File: You can download good one CSV file from here for practice.<br />
<pre class="crayon-plain-tag">https://zappysys.com/downloads/files/test/invoices.csv
https://zappysys.com/downloads/files/test/invoices.csv.gz
https://zappysys.com/downloads/files/test/invoices.csv.zip</pre>
<div style="width: 644px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/ssis-new-file-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/ssis-new-file-connection.png" alt="Create a New File Connection" width="634" height="600" /></a><p class="wp-caption-text">Create a New File Connection</p></div></li>
<li>Click on OK button to save connection configure setting UI.</li>
</ol>
<h3>Let&#8217;s see how to write data from SQL Server Table to CSV File.</h3>
<ol>
<li>Double click on OLE DB Source for configure it.</li>
<li>Let&#8217;s Configure in Connection Manager, just follow below image steps.
<div style="width: 828px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" alt="Configure OLE DB Source Editor" width="818" height="560" /></a><p class="wp-caption-text">Configure OLE DB Source Editor</p></div></li>
<li>Click OK to Save OLE DB Source Editor UI Settings.</li>
<li>Let&#8217;s configure CSV File Destination, Double click on it, In the File Connection Manager, select the file connection created before.
<div style="width: 795px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-file-conecction-conf.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-file-conecction-conf.png" alt="SSIS ZS CSV File Destination - Configure Connection Manager Tab" width="785" height="398" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; Configure Connection Manager Tab</p></div></li>
<li>In the Component Properties, set the Append property to False, enter the File Path and set the Overwrite file if exists to True.
<div style="width: 795px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-config.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-config.png" alt="SSIS ZS CSV File Destination - Configure Component Properties Tab" width="785" height="714" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; Configure Component Properties Tab</p></div></li>
<li>In the Input Columns Tab, check the columns that you want as load data.
<div style="width: 795px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-columns.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-columns.png" alt="SSIS ZS CSV File Destination - Configure Input column Tab" width="785" height="519" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; Configure Input column Tab</p></div></li>
<li>Click on OK button to save configure setting UI.</li>
<li>Finally, run the package and the data will be exported from source to destination immediately.
<div style="width: 830px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-result.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-file-destination-result.png" alt="SSIS ZS CSV FIle Destination - Execute the Package" width="820" height="568" /></a><p class="wp-caption-text">SSIS ZS CSV FIle Destination &#8211; Execute the Package</p></div></li>
</ol>
<h2>How to do file split using CSV File Destination.</h2>
<ol>
<li>Double click on CSV File Destination to configure it.</li>
<li>In the Component Properties set Enable File Split to True and File Split Mode BySize.
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-file-split.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-file-split.png" alt="SSIS ZS CSV File Destination - File Split" width="790" height="748" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; File Split</p></div></li>
<li>Click OK button to save configure setting UI.</li>
<li>That&#8217;s all, Now you can run or execute the package and you will see numbers of CSV file in Destination Folder.</li>
</ol>
<h2>How to do file compression using CSV File Destination.</h2>
<ol>
<li>Double click on CSV File Destination to configure it.</li>
<li>In the Component Properties set Compression Type to GZip or Zip and File Split Mode BySize.
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-compression-gzip-zip.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-csv-destination-compression-gzip-zip.png" alt="SSIS ZS CSV File Destination - Compression Type" width="790" height="727" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; Compression Type</p></div></li>
<li>Click OK button to save configure setting UI. and You can Run or Execute.</li>
</ol>
<h2>How to do the maximum number of rows per file using CSV File Destination.</h2>
<ol>
<li>Double click on CSV File Destination to configure it.</li>
<li>In the Component Properties, you can set Max Rows Per File and Max Size Per File as per your need.
<div style="width: 800px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-max-rows-per-files-csv-destination.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-file-destination/ssis-max-rows-per-files-csv-destination.png" alt="SSIS ZS CSV File Destination - Max Rows Per File" width="790" height="725" /></a><p class="wp-caption-text">SSIS ZS CSV File Destination &#8211; Max Rows Per File</p></div></li>
<li>Click OK button to save configure setting UI. and You can Run or Execute.</li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, we saw you how to write data into CSV File from SQL Server Table using OLE DB Connection, File Connection, and load into CSV File. We also learned, how to do various things like split CSV File, Compression File and the maximum number of rows per file of data. To explore many other scenarios not discussed in this article download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following URL for more information.</p>
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-csv-file-destination.htm" target="_blank" rel="noopener">CSV File Destination</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/write-data-csv-file-ssis-gzip-split/">How to write data into CSV file in SSIS (GZip / Split)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load PostgreSQL Table Data to CSV File in SSIS</title>
		<link>https://zappysys.com/blog/ssis-load-postgresql-table-data-csv-file/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 13 Apr 2019 11:15:16 +0000</pubDate>
				<category><![CDATA[SSIS CSV File Destination]]></category>
		<category><![CDATA[SSIS PostgreSql Connection]]></category>
		<category><![CDATA[SSIS PostgreSQL Source]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6767</guid>

					<description><![CDATA[<p>Introduction ZappySys provides high performance drag and drop connectors for PostgreSQL Integration. In this post you will see how to Load PostgreSQL Table Data to CSV File using SSIS PostgreSQL Source. PostgreSQL Source supports SQL language to query PostgreSQL data. PostgreSQL is a powerful, open source relational database with strong reputation for reliability, feature robustness, and performance. In [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-load-postgresql-table-data-csv-file/">Load PostgreSQL Table Data to CSV File in 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/2019/04/ssis-PostgreSql-Source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignleft wp-image-6771 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-Source.png" alt="ssis-PostgreSql-Source" width="100" height="100" /></a>ZappySys provides high performance drag and drop connectors for PostgreSQL Integration. In this post you will see how to Load PostgreSQL Table Data to CSV File using <a href="https://zappysys.com/products/ssis-powerpack/ssis-postgresql-source/" target="_blank" rel="noopener">SSIS PostgreSQL Source</a>. PostgreSQL Source supports SQL language to query PostgreSQL data. PostgreSQL is a powerful, open source relational database with strong reputation for reliability, feature robustness, and performance.</p>
<p>In nutshell, this post will focus on how to Load PostgreSQL Table Data and write into CSV File using <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> in few clicks. You can also use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-destination/" target="_blank" rel="noopener">CSV Destination</a> instead of Trash destination if you wants more option like compressed file gzip (*.gz) or zip, wants to splitting the file by row count of file size and more.</p>
<h2><span id="Prerequisite">Prerequisite</span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>Thirdly, You have obtained PostgreSQL Credential.</li>
<li>Finally, do not forget to install <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></li>
</ol>
<p><strong>Components Mentioned in this article</strong><br />
<div class="su-table su-table-alternate">
<table style="width: 390px;height: 160px">
<tbody>
<tr style="height: 40px">
<td style="width: 33px;height: 40px"><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/postgresql-source/ssis-postgresql-source.png" alt="SSIS Amazon S3 CSV File Source" width="32" height="32" /></td>
<td style="width: 357px;height: 40px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-postgresql-source/" target="_blank" rel="noopener">SSIS PostgreSQL Source</a></td>
</tr>
<tr style="height: 40px">
<td style="width: 33px;height: 40px"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/csv-destination/ssis-csv-file-destination.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 CSV File Destination" width="32" height="32" /></td>
<td style="width: 357px;height: 40px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-destination/" target="_blank" rel="noopener">CSV Destination</a></td>
</tr>
<tr style="height: 40px">
<td style="width: 33px;height: 40px"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/images/ssis-powerpack/SSIS-Trash-Destination-Adapter.png?w=720&amp;ssl=1" alt="SSIS Amazon S3 XML File Source" width="32" height="32" /></td>
<td style="width: 357px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a></td>
</tr>
</tbody>
</table>
</div>
<h2>What is PostgreSQL?</h2>
<p>PostgreSQL is a powerful, open source object-relational database system that uses and extends the SQL language combined with many features that safely store and scale the most complicated data workloads. The origins of PostgreSQL date back to 1986 as part of the <a href="https://www.postgresql.org/docs/current/history.html" target="_blank" rel="noopener">POSTGRES</a> project at the University of California at Berkeley and has more than 30 years of active development on the core platform.</p>
<p>PostgreSQL has earned a strong reputation for its proven architecture, reliability, data integrity, robust feature set, extensibility, and the dedication of the open source community behind the software to consistently deliver performant and innovative solutions. PostgreSQL runs on <a href="https://www.postgresql.org/download/" target="_blank" rel="noopener">all major operating systems</a>, has been <a href="https://en.wikipedia.org/wiki/ACID" target="_blank" rel="noopener">ACID</a>-compliant since 2001, and has powerful add-ons such as the popular <a href="https://postgis.net/" target="_blank" rel="noopener">PostGIS</a> geospatial database extender. It is no surprise that PostgreSQL has become the open source relational database of choice for many people and organisations.</p>
<p><a href="https://www.postgresql.org/docs/current/tutorial.html" target="_blank" rel="noopener">Getting started</a> with using PostgreSQL has never been easier &#8211; pick a project you want to build, and let PostgreSQL safely and robustly store your data.</p>
<h2>Download and Install PostgreSQL</h2>
<p>Please go to below download link and download the Windows version Binary package and install it and follow the steps from the installer.</p>
<p><a href="https://www.postgresql.org/download/" target="_blank" rel="noopener">https://www.postgresql.org/download/</a></p>
<div id="attachment_6774" style="width: 530px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-download.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6774" class="wp-image-6774 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-download-e1555505700480.png" alt="ssis-PostgreSql-download" width="520" height="706" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-download-e1555505700480.png 520w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-download-e1555505700480-221x300.png 221w" sizes="(max-width: 520px) 100vw, 520px" /></a><p id="caption-attachment-6774" class="wp-caption-text">PostgreSQL Download</p></div>
<h2>Create PostgreSQL Database and Table</h2>
<ol>
<li>To do this, we will first open the pgAdmin Panel.
<div id="attachment_6776" style="width: 434px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-open-pgadmin.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6776" class="wp-image-6776 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-open-pgadmin.png" alt="Open pgAdmin" width="424" height="680" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-open-pgadmin.png 424w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-open-pgadmin-187x300.png 187w" sizes="(max-width: 424px) 100vw, 424px" /></a><p id="caption-attachment-6776" class="wp-caption-text">Open PostgreSQL pgAdmin Panel</p></div></li>
<li>It will open the pgAdmin Panel in the browser. Select Server and Right click on Databases to create database.
<div id="attachment_6777" style="width: 555px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-select-createdatabase.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6777" class="wp-image-6777 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-select-createdatabase.png" alt="PostgreSql Select Create Database" width="545" height="484" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-select-createdatabase.png 545w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-select-createdatabase-300x266.png 300w" sizes="(max-width: 545px) 100vw, 545px" /></a><p id="caption-attachment-6777" class="wp-caption-text">PostgreSQL Select Create Database</p></div></li>
<li>Enter the Database name and click on Save to create it.
<div id="attachment_6778" style="width: 727px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-create-database.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6778" class="wp-image-6778 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-create-database.png" alt="Create PostgreSQL Database" width="717" height="583" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-create-database.png 717w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSql-create-database-300x244.png 300w" sizes="(max-width: 717px) 100vw, 717px" /></a><p id="caption-attachment-6778" class="wp-caption-text">Create PostgreSQL Database</p></div></li>
<li>Now select the created database under it expand Schemas and right click on Tables and click on create Table.
<div id="attachment_6780" style="width: 575px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-create-table.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6780" class="wp-image-6780 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-create-table.png" alt="PostgreSQL Select Create Table" width="565" height="846" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-create-table.png 565w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-create-table-200x300.png 200w" sizes="(max-width: 565px) 100vw, 565px" /></a><p id="caption-attachment-6780" class="wp-caption-text">PostgreSQL Select Create Table</p></div></li>
<li>Now enter the table name and go to columns tab.
<div id="attachment_6782" style="width: 531px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-name.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6782" class="wp-image-6782 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-name.png" alt="PostgreSQL Enter Table Name" width="521" height="472" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-name.png 521w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-name-300x272.png 300w" sizes="(max-width: 521px) 100vw, 521px" /></a><p id="caption-attachment-6782" class="wp-caption-text">PostgreSQL Enter Table Name</p></div></li>
<li>Add the columns by clicking add button and give the desire column name and select the datatype for the same.
<div id="attachment_6783" style="width: 622px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-columns.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6783" class="wp-image-6783 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-columns.png" alt="PostgreSQL Add Table Columns" width="612" height="500" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-columns.png 612w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-add-table-columns-300x245.png 300w" sizes="(max-width: 612px) 100vw, 612px" /></a><p id="caption-attachment-6783" class="wp-caption-text">PostgreSQL Add Table Columns</p></div></li>
<li>Now, let&#8217;s insert some data using Query Editor.
<div id="attachment_6790" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-insert-data-in-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6790" class="size-medium_large wp-image-6790" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-insert-data-in-table-768x712.png" alt="PostgreSQL Insert Data in Table" width="720" height="668" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-insert-data-in-table-768x712.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-insert-data-in-table-300x278.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-insert-data-in-table.png 843w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-6790" class="wp-caption-text">PostgreSQL Insert Data in Table</p></div></li>
<li>That&#8217;s it, now let&#8217;s move forward to read the data from this table using <a href="https://zappysys.com/products/ssis-powerpack/ssis-postgresql-source/" target="_blank" rel="noopener">SSIS PostgreSQL Source</a> in the next the section.
<div id="attachment_6792" style="width: 351px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-query-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6792" class="size-full wp-image-6792" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-query-data.png" alt="PostgreSQL Select Query Data" width="341" height="426" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-query-data.png 341w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-select-query-data-240x300.png 240w" sizes="(max-width: 341px) 100vw, 341px" /></a><p id="caption-attachment-6792" class="wp-caption-text">PostgreSQL Select Query Data</p></div></li>
</ol>
<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-postgresql-source/" target="_blank" rel="noopener">SSIS PostgreSQL Source</a> that will help you extract large amount of data from a PostgreSQL Database. PostgreSQL Source supports Multiple modes (i.e. Table or Query) to read data from PostgreSQL Database and many more operations. Here we are showing you is, How to read data from PostgreSQL collection.</p>
<p>You can connect to your PostgreSQL database by entering your PostgreSQL credentials.</p>
<h2>Load PostgreSQL Table Data to CSV File</h2>
<p>Let´s start with an example. In this SSIS PostgreSQL Source Task example, we will load the PostgreSQL table data to CSV file.</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"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="size-full wp-image-7934" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : Data Flow Task from SSIS Toolbox</p></div></li>
<li>Drag and Drop PostgreSQL Source Task from the SSIS Toolbox and double click on it to edit it.
<div id="attachment_6795" style="width: 618px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-drag-drop-PostgreSQL-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6795" class="size-full wp-image-6795" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-drag-drop-PostgreSQL-source.png" alt="PostgreSQL Source" width="608" height="321" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-drag-drop-PostgreSQL-source.png 608w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-drag-drop-PostgreSQL-source-300x158.png 300w" sizes="(max-width: 608px) 100vw, 608px" /></a><p id="caption-attachment-6795" class="wp-caption-text">PostgreSQL Source</p></div></li>
<li>Let&#8217;s create a connection for PostgreSQL Database.
<div id="attachment_6796" style="width: 669px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-create-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6796" class="size-full wp-image-6796" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-create-connection.png" alt="Create PostgreSQL Database Connection" width="659" height="746" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-create-connection.png 659w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-create-connection-265x300.png 265w" sizes="(max-width: 659px) 100vw, 659px" /></a><p id="caption-attachment-6796" class="wp-caption-text">Create PostgreSQL Database Connection</p></div></li>
<li>Let&#8217;s select the Table mode and select the table and click on preview.
<div id="attachment_6798" style="width: 658px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6798" class="size-full wp-image-6798" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-table.png" alt="PostgreSQL Table Preview" width="648" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-table.png 648w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-table-300x288.png 300w" sizes="(max-width: 648px) 100vw, 648px" /></a><p id="caption-attachment-6798" class="wp-caption-text">PostgreSQL Table Preview</p></div></li>
<li>You can also use the query mode to filter the data and do more operation using query. You can find our several Examples also by clicking on &lt;&lt;View Examples&gt;&gt;.
<div id="attachment_6797" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-query.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6797" class="size-medium_large wp-image-6797" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-query-768x529.png" alt="PostgreSQL Query Preview" width="720" height="496" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-query-768x529.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-query-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-preview-query.png 857w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-6797" class="wp-caption-text">PostgreSQL Query Preview</p></div></li>
<li>Now let&#8217;s add Trash destination Task and edit it and enter the CSV File Path.
<div id="attachment_6799" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-to-trash-destination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6799" class="size-medium_large wp-image-6799" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-to-trash-destination-768x525.png" alt="Trash Destination : Setup CSV File Path" width="720" height="492" srcset="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-to-trash-destination-768x525.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-to-trash-destination-300x205.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-to-trash-destination.png 792w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-6799" class="wp-caption-text">Trash Destination : Setup CSV File Path</p></div></li>
<li>That&#8217;s it now execute the package and it will load data from PostgreSQL Table to CSV File.
<div id="attachment_6800" style="width: 234px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-csv-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6800" class="size-full wp-image-6800" src="https://zappysys.com/blog/wp-content/uploads/2019/04/ssis-PostgreSQL-csv-data.png" alt="PostgreSQL : CSV Data" width="224" height="282" /></a><p id="caption-attachment-6800" class="wp-caption-text">PostgreSQL : CSV Data</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>Above all, in this blog, we learned how to Read data from PostgreSQL in SSIS. We used <a href="https://zappysys.com/products/ssis-powerpack/ssis-postgresql-source/" target="_blank" rel="noopener">SSIS PostgreSQL Source</a> to read the data from PostgreSQL Table and load data into CSV File. 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://www.postgresql.org/about/" target="_blank" rel="noopener">About PostgreSQL</a></li>
<li><a href="https://www.postgresql.org/docs/" target="_blank" rel="noopener">PostgreSQL Documentation</a></li>
<li><a href="https://www.tutorialspoint.com/postgresql/postgresql_select_query.htm" target="_blank" rel="noopener">PostgreSQL – SELECT Query</a></li>
<li>Help File : <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-postgresql-source.htm" target="_blank" rel="noopener">PostgreSQL Source</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/ssis-load-postgresql-table-data-csv-file/">Load PostgreSQL Table Data to CSV File in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
