<?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>export Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/export/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/export/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 02 Oct 2025 21:17:36 +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>export Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/export/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 export REST API  to CSV using c# or Python</title>
		<link>https://zappysys.com/blog/how-to-export-rest-api-to-csv/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Sat, 30 Jun 2018 03:02:59 +0000</pubDate>
				<category><![CDATA[C# (CSharp)]]></category>
		<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rest api]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4250</guid>

					<description><![CDATA[<p>Introduction to export REST API to CSV Export REST API to CSV is in some cases necessary to process the data because many tools can handle CSV files. In this new article, we will show different ways to export the data. The first example will do it using C#. The second example with use Python. Let&#8217;s take a [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-export-rest-api-to-csv/">How to export REST API  to CSV using c# or Python</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction to export REST API to CSV</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-icon.jpg"><img loading="lazy" decoding="async" class=" wp-image-4254 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-icon-150x150.jpg" alt="Logo REST API" width="82" height="82" /></a>Export REST API to CSV is in some cases necessary to process the data because many tools can handle CSV files. In this new article, we will show different ways to export the data. The first example will do it using C#. The second example with use Python. Let&#8217;s take a look at these examples.</p>
<h2></h2>
<h2>Requirements to export REST API to CSV</h2>
<ol>
<li>First of all, you will need <a href="https://zappysys.com/products/odbc-powerpack/download/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> installed.</li>
<li>Secondly, you will require Visual Studio installed for the C# example.</li>
<li>Finally, it is necessary Python installed for the Python example.</li>
</ol>
<h3>Export REST API to CSV using C#</h3>
<p>C# is a pretty popular programing language. In the first example, we will show how to display the REST API information to a CSV file named. Let&#8217;s take a look at the code:</p>
<ol>
<li>First of all, we will connect to REST API using a connection to the following Data Path:<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json</pre>
<pre class="crayon-plain-tag">using (OdbcConnection conn = 
      new OdbcConnection("Driver={ZappySys JSON Driver};DataPath='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json';"))</pre>
</li>
<li>Secondly, we create a connection using a file stream. We will save the results to a file in the c:\sql\sample.csv:<br />
<pre class="crayon-plain-tag">FileStream fs = new FileStream("C:\\sql\\sample.txt", FileMode.Create);
StreamWriter writer = new StreamWriter(fs);
StringBuilder output = new StringBuilder();</pre>
</li>
<li>Also, we will add a query to REST API. Note that with the ZappySys ODBC PowerPack, you can do a simple SQL query to get REST API data. This is pretty simple and intuitive:<br />
<pre class="crayon-plain-tag">OdbcCommand cmd = new OdbcCommand(
     @"SELECT  CustomerID,CompanyName FROM value", conn);</pre>
</li>
<li>In addition, we will read the data and close the connections:<br />
<pre class="crayon-plain-tag">conn.Close();  
writer.Close(); 
fs.Close();</pre>
</li>
<li>The complete code will be the following:<br />
<pre class="crayon-plain-tag">using System;
using System.IO;
using System.Data.Odbc;

public class Program
{
    public static void Main()
    {
        var outpath = @"C:\temp\sample.txt";

        using (var conn = new OdbcConnection("Driver={ZappySys JSON Driver};DataPath='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json';"))
        {
            conn.Open();
            var cmd = new OdbcCommand(@"SELECT CustomerID,CompanyName FROM $ WITH(Filter='$.value[*]')", conn);
            
            //Increases the timeout duration from the default 30 seconds, which may be insufficient in certain scenarios.
            cmd.CommandTimeout=600; // 600-seconds
            
            var rdr = cmd.ExecuteReader();

            using (var fs = new FileStream(outpath, FileMode.Create))
            {
                using (var writer = new StreamWriter(fs))
                {
                    //write file header
                    writer.WriteLine("CustomerID,CompanyName");

                    while (rdr.Read())
                    {
                        //write file row
                        writer.WriteLine("{0},{1}", rdr["CustomerID"], rdr["CompanyName"]);
                    }
                    conn.Close(); //close connection
                    writer.Close();
                    fs.Close();
                }
            }
        }

        //Read from file and display the content
        Console.Write(File.ReadAllText(outpath));

        Console.WriteLine("\r\n===== Press any key to end the program =====\r\n");
        Console.Read();
    }
}</pre>
&nbsp;</li>
<li>Finally, you will be able to see the file created:
<div id="attachment_4258" style="width: 160px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-exported-to-CSV-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4258" class="size-thumbnail wp-image-4258" src="https://zappysys.com/blog/wp-content/uploads/2018/06/REST-API-exported-to-CSV-file-150x150.png" alt="Export REST API to CSV" width="150" height="150" /></a><p id="caption-attachment-4258" class="wp-caption-text">REST API into CSV</p></div></li>
</ol>
<h3>Export REST API to CSV using Python</h3>
<p>Python is another really popular programming language. The popularity is growing a lot. In this example, we will learn how to Export REST API to CSV using Python.</p>
<ol>
<li>First of all, you will need to install Pip if not included in Python. Pip is Package Installer.<br />
For instructions about the installation, refer to <a href="https://pip.pypa.io/en/stable/installing/" target="_blank" rel="noopener">this link.</a></li>
<li>Secondly, you will also need the pyodbc. The pyodbc allows connecting to ODBC using Python. To install it go to the scripts folder of Python where Python is installed and run this command:pip install pyodbc.</li>
<li>Once that pyodbc is installed, we will run the following code:<strong>Full Code</strong><br />
<pre class="crayon-plain-tag">import csv
import pyodbc

conn = pyodbc.connect(
    r'DRIVER={ZappySys JSON Driver};'
    )
cursor = conn.cursor()	
rows = cursor.execute("SELECT CustomerID,CompanyName FROM value WHERE COUNTRY='Germany' WITH (SRC='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json')") 
with open(r'C:\sql\cus2.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerow([x[0] for x in cursor.description])  
    for row in rows:
        writer.writerow(row)</pre>
</li>
<li>Now lets&#8217;s understand parts of above code. We have used the csv and pyodbc modules in the code:<br />
<pre class="crayon-plain-tag">import csv
import pyodbc</pre>
</li>
<li>Also, we connect to the <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC Driver</a>:<br />
<pre class="crayon-plain-tag">conn = pyodbc.connect(
r'DRIVER={ZappySys JSON Driver};'
)</pre>
</li>
<li>In addition, we have used a cursor to get the rows and send a SQL query to get data from the REST API:<br />
<pre class="crayon-plain-tag">cursor = conn.cursor() 
rows = cursor.execute("SELECT CustomerID,CompanyName FROM value 
WHERE Country='Germany' WITH 
(SRC='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json')")</pre>
</li>
<li>Following code is to open the CSV file stream:<br />
<pre class="crayon-plain-tag">with open(r'C:\sql\customer.csv', 'w', newline='') as csvfile:</pre>
</li>
<li>Finally, we will write the data from REST API into the CSV file:<br />
<pre class="crayon-plain-tag">writer = csv.writer(csvfile)
writer.writerow([x[0] for x in cursor.description]) 
for row in rows:
writer.writerow(row)</pre>
</li>
<li>To conclude, if everything is OK, you will be able to see the created CSV file:
<div id="attachment_4264" style="width: 160px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/CSV-file-created.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4264" class="size-thumbnail wp-image-4264" src="https://zappysys.com/blog/wp-content/uploads/2018/06/CSV-file-created-150x106.png" alt="REST API ODBC Python" width="150" height="106" /></a><p id="caption-attachment-4264" class="wp-caption-text">Python code REST API</p></div>
<div class="mceTemp"></div>
</li>
</ol>
<h2></h2>
<h2>Using ODBC DSN in Connection String</h2>
<p>So far we have seen DSN less connection string approach for ODBC Driver but now lets look at another way to use ODBC Driver in your C# or Python code. You can define many settings on DSN Datasource rather than setting in the ConnectionString.</p>
<h3>Configure DSN for REST API Connection</h3>
<ol>
<li>First of all, we will access the following URL:<br />
<pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Orders?$format=json</pre>
</li>
<li>Secondly, in the windows start menu, Search for “ODBC” open the ODBC Data Sources.</li>
<li>Also, in the ODBC Administrator, press Add and select the ZappySys JSON<br />
Driver:</p>
<div id="attachment_4421" style="width: 471px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/create-new-data-source-zappysys-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4421" class="wp-image-4421 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/create-new-data-source-zappysys-json-driver.png" alt="REST API ODBC " width="461" height="346" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/create-new-data-source-zappysys-json-driver.png 461w, https://zappysys.com/blog/wp-content/uploads/2018/07/create-new-data-source-zappysys-json-driver-300x225.png 300w" sizes="(max-width: 461px) 100vw, 461px" /></a><p id="caption-attachment-4421" class="wp-caption-text">Add ODBC JSON</p></div></li>
<li>Finally, specify the URL of step 1 and save the configuration:
<div id="attachment_4422" style="width: 812px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/Qlik-odata-url-odbc.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4422" class="size-full wp-image-4422" src="https://zappysys.com/blog/wp-content/uploads/2018/07/Qlik-odata-url-odbc.png" alt="REST API" width="802" height="702" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/Qlik-odata-url-odbc.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/07/Qlik-odata-url-odbc-300x263.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/Qlik-odata-url-odbc-768x672.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a><p id="caption-attachment-4422" class="wp-caption-text">URL ODBC</p></div></li>
</ol>
<h3>Using ODBC DSN in C# Code</h3>
<p>Now to use ODBC DSN you created simply change our previous C# Code as below (Just one line)</p><pre class="crayon-plain-tag">using (var conn = new OdbcConnection("DSN=Your-DSN-Name-Goes-Here"))
{
    conn.Open();
    ...........
    ...........
    ...........</pre><p>
<div id="attachment_4467" style="width: 883px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/call-rest-api-in-csharp-odbc-json-driver.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4467" class="size-full wp-image-4467" src="https://zappysys.com/blog/wp-content/uploads/2018/06/call-rest-api-in-csharp-odbc-json-driver.png" alt="Using ODBC DSN in C# code to call REST API" width="873" height="598" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/call-rest-api-in-csharp-odbc-json-driver.png 873w, https://zappysys.com/blog/wp-content/uploads/2018/06/call-rest-api-in-csharp-odbc-json-driver-300x205.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/call-rest-api-in-csharp-odbc-json-driver-768x526.png 768w" sizes="(max-width: 873px) 100vw, 873px" /></a><p id="caption-attachment-4467" class="wp-caption-text">Using ODBC DSN in C# code to call REST API</p></div>
<h3>Using ODBC DSN in Python Code</h3>
<p>Now to use ODBC DSN you created simply change our previous C# Code as below (Just one line)</p><pre class="crayon-plain-tag">conn = pyodbc.connect(
    r'DSN=Your-DSN-name-Goes-Here;'
    )
	
	...........
	...........
	...........</pre><p>
&nbsp;</p>
<h2><span id="ZappySys_JSON_REST_API_Driver_Query_Examples">ZappySys JSON /REST API Driver Query Examples</span></h2>
<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/json-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see json query examples</a>.</p>
<h2><span id="ZappySysXML_SOAP_Driver_Query_Examples">ZappySys XML / SOAP Driver Query Examples</span></h2>
<p>Reading from XML files or API can be done using the same way as previous sections except you have to use ZappySys XML Driver. Read help file here to <a href="https://zappysys.com/onlinehelp/odbc-powerpack/scr/xml-odbc-driver-sql-query-examples.htm" target="_blank" rel="noopener">see xml query examples</a>.</p>
<h2></h2>
<h2>Conclusion</h2>
<p>To conclude, in this article, we show how to access REST API using C# and Python. We used the ZappySys ODBC PowerPack that allows accessing to REST API data and JSON files using SQL queries. It is possible to create simple SQL queries and access the data. It is also possible to access to XML files and Web API with this tool. If you liked this tool you can test the <a href="https://zappysys.com/products/odbc-powerpack/download/" target="_blank" rel="noopener">ZappySys ODBC PowerPack here</a>.</p>
<h2>References</h2>
<p>Finally, if you want to read more about this topic, refer to these links:</p>
<ul>
<li><a href="https://zappysys.com/products/odbc-powerpack/download/" target="_blank" rel="noopener">Download ZappySys ODBC PowerPack Installer</a></li>
<li><a href="https://support.microsoft.com/en-us/help/310988/how-to-use-the-odbc-net-managed-provider-in-visual-c-net-and-connectio" target="_blank" rel="noopener">How To Use the ODBC .NET Managed Provider in Visual C# .NET and Connection Strings</a></li>
<li><a href="https://wiki.python.org/moin/ODBC" target="_blank" rel="noopener">Python ODBC Wiki</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/how-to-export-rest-api-to-csv/">How to export REST API  to CSV using c# or Python</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Calling SSRS Reports in SSIS (Export / Email)</title>
		<link>https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Sat, 16 Jun 2018 20:07:59 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS Report Generator (SSRS)]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssrs]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4008</guid>

					<description><![CDATA[<p>Introduction about calling SSRS Reports in SSIS Calling SSRS Reports in SSIS is straightforward using the ZappySys Reporting Services task. Also, we will show how to export files SSRS files using SSIS, how to send reports in emails and how to send parameters. In addition, we will be using this ZappySys SSIS PowerPack component to make things work: [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/">Calling SSRS Reports in SSIS (Export / Email)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction about calling SSRS Reports in SSIS</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png"><img loading="lazy" decoding="async" class=" wp-image-4022 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png" alt="Logo of Reporting Services" width="93" height="93" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo.png 260w, https://zappysys.com/blog/wp-content/uploads/2018/06/reporting-services-logo-150x150.png 150w" sizes="(max-width: 93px) 100vw, 93px" /></a>Calling SSRS Reports in SSIS is straightforward using the ZappySys Reporting Services task. Also, we will show how to export files SSRS files using SSIS, how to send reports in emails and how to send parameters.</p>
<p>In addition, we will be using this <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> component to make things work:<br />
<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-report-generator-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-SSRS-Reporting-Services-Task.png" alt="SSIS Report Generator Task (Export SSRS Reports) " width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-report-generator-task/" target="_blank" rel="noopener">SSIS Report Generator Task (Export SSRS Reports)<br />
</a></td>
</tr>
<tr style="line-height: 0px">
<td style="height: 58px" width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" 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-file-system-task-advanced.png" alt="Advanced SSIS File System Task" width="50" height="50" /></a></td>
<td style="vertical-align: middle;height: 58px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">Advanced SSIS File System Task</a></td>
</tr>
</tbody>
</table>
</div>
<p>In order to understand the functionality, the following video tutorial can be useful to understand the functionality of this useful Reporting Services task:<br />
[youtube https://www.youtube.com/watch?v=ajnSgbXls7I&amp;w=560&amp;h=315]
<h2>Requirements</h2>
<ol>
<li>First of all, we will need ZappySys SSIS PowerPack. This tool contains the Reporting Services Task.</li>
<li>Secondly, you will require SSDT for Business Intelligence to create SSIS projects.</li>
<li>Also, make sure to have an SSRS report deployed. For more information<br />
about creating reports and deploying, refer to these links:</li>
</ol>
<ul>
<li style="list-style-type: none;">
<ul>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/create-a-basic-table-report-ssrs-tutorial?view=sql-server-2017" target="_blank" rel="noopener">Create a Basic Table Report (SSRS Tutorial)</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/reports/publishing-reports-to-a-report-server?view=sql-server-2017" target="_blank" rel="noopener">Publishing Reports to a Report Server</a></li>
</ul>
</li>
</ul>
<h2>Getting started</h2>
<p>We will first show how to export an SSRS Report to Word format (docx). Also, the ZappySys SSIS PowerPack, allows converting your SSRS reports deployed into Word (docx and doc), Excel (xlsx and xls), PDF, TIFF, CSV and XML.</p>
<h3>Calling SSRS Reports in SSIS</h3>
<ol>
<li>First of all drag and drop the ZS Reporting Task that is included with our ZappySys SSIS PowerPack:
<div id="attachment_4025" style="width: 624px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4025" class="size-full wp-image-4025" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png" alt="Task to convert SSRS report into files" width="614" height="433" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task.png 614w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Reporting-Service-task-300x212.png 300w" sizes="(max-width: 614px) 100vw, 614px" /></a><p id="caption-attachment-4025" class="wp-caption-text">SSRS task in SSIS</p></div></li>
<li>Secondly, in general tab, make sure that the Export server report is enabled.</li>
<li>Additionally, specify the report service URL. If you are not sure what is your report service URL, check the step 3 in requirements.</li>
<li>In addition, in report path, select the report that you want to export to a file.</li>
<li>Also, check the output as a file option:
<div id="attachment_4026" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4026" class="size-full wp-image-4026" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png" alt="Configurations to export files" width="625" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-export-report-to-file-300x289.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4026" class="wp-caption-text">Export report to file</p></div></li>
<li>Additionally, in the export settings tab, go to Save as and specify the path and extension of the file to export. You can export to Excel, Word, PDF, Tiff, CSV and XML:
<div id="attachment_4042" style="width: 636px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4042" class="size-full wp-image-4042" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png" alt="Reporting Services to Excel Word PDF" width="626" height="615" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX.png 626w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-export-report-server-PDF-DOCX-XLSX-300x295.png 300w" sizes="(max-width: 626px) 100vw, 626px" /></a><p id="caption-attachment-4042" class="wp-caption-text">Export SSRS report using SSIS to Excel, Word, PDF</p></div></li>
<li>Finally, run the package and the file will be created:
<div id="attachment_4044" style="width: 373px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4044" class="size-full wp-image-4044" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png" alt="Calling SSRS Reports in SSIS to export to MS Word " width="363" height="225" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word.png 363w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-report-in-word-300x186.png 300w" sizes="(max-width: 363px) 100vw, 363px" /></a><p id="caption-attachment-4044" class="wp-caption-text">SSRS report exported to docx</p></div></li>
</ol>
<h3>Changing the names of the reports with the date format</h3>
<p>In order to explain how to add the prefix or suffix of a file with the current date. For example, I want my SSRS reports with this format:<br />
Filename20180323.xlsx where 20180323 means march 23, 2018. To understand how to do it, In this new example, we will show how to do it.</p>
<ol>
<li>First of all, we will use the ZappySys Advanced File System Task:</li>
<li>Secondly, we will use the option Rename files and rename using the fun_getdate function like this: <strong><strong><strong>Filename&lt;&lt;yyyy-MM-dd,FUN_GETDATE&gt;&gt;.xlsx</strong></strong></strong>
<div id="attachment_4051" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4051" class="size-full wp-image-4051" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png" alt="SSIS Rename files with date" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-rename-a-file-with-current-date-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4051" class="wp-caption-text">Rename the file with a date in SSIS</p></div></li>
<li>Also, you can watch all the available examples of functions by pressing the Expressions (x) button:
<div id="attachment_4057" style="width: 690px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4057" class="size-full wp-image-4057" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png" alt="Functions in SSIS " width="680" height="629" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates.png 680w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-functions-for-dates-300x278.png 300w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-4057" class="wp-caption-text">Special SSIS functions</p></div></li>
<li>Finally, press insert variable and function examples and you will be able to see all the examples of special functions to simplify your life:
<div id="attachment_4058" style="width: 916px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4058" class="size-full wp-image-4058" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png" alt="Special functions" width="906" height="732" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates.png 906w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates-300x242.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-function-examples-for-dates-768x621.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></a><p id="caption-attachment-4058" class="wp-caption-text">Samples of functions</p></div></li>
</ol>
<h3>Moving your report files to a UNC path</h3>
<p>Once that you have your files exported from reporting services to a file, you can move, copy them to another path. In this example, we will show how to move files to a Shared folder using a UNC path.</p>
<ol>
<li> First of all, specify your file name to move. You can use *.xml for example to move all the files.</li>
<li>Secondly, specify the UNC path in destination:
<div id="attachment_4059" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4059" class="size-full wp-image-4059" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png" alt="Move SSRS reports exported to UNC path" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-move-files-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4059" class="wp-caption-text">SSIS move files to UNC path</p></div></li>
<li>Also, It is possible to sort files by name, size, modified date or other properties:
<div id="attachment_4061" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4061" class="size-full wp-image-4061" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png" alt="SSIS Sorting files by properties" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date.png 683w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-move-files-sorted-by-name-modified-date-300x278.png 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-4061" class="wp-caption-text">Sort file in SSIS by name, size, modified date</p></div></li>
<li>Finally, press the Examples link, you can see some custom queries that you can create:
<div id="attachment_4062" style="width: 572px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4062" class="size-full wp-image-4062" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png" alt="SSIS queries to get file information" width="562" height="397" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties.png 562w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-filter-file-properties-300x212.png 300w" sizes="(max-width: 562px) 100vw, 562px" /></a><p id="caption-attachment-4062" class="wp-caption-text">Sample SSIS queries to files</p></div></li>
</ol>
<h3>Sending SSRS Report as an attachment in an email</h3>
<p>The task also allows calling SSRS reports in SSIS and send the reports to an email. To do it, it is necessary to have an SMTP Server. Let&#8217;s take a look at the steps:</p>
<ol>
<li>First of all, in the general tab, check the email report file and uncheck the Output as file option:
<div id="attachment_4064" style="width: 637px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4064" class="size-full wp-image-4064" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png" alt="Send SSRS report as attachment in SSIS" width="627" height="616" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-email-SSRS-Reporting-Service-300x295.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a><p id="caption-attachment-4064" class="wp-caption-text">Output SSRS report in SSIS as attachment</p></div></li>
<li>Also, in Email setting tab, press New in SMTP connections to create a new connection. You will need to provide an SMTP server name, an email and a password. It is also necessary to enter the port. You can find the list of some SMTP servers and ports <a href="https://www.arclab.com/en/kb/email/list-of-smtp-and-pop3-servers-mailserver-list.html" target="_blank" rel="noopener">here</a>.</li>
<li>In addition, you have an option to specify the sender, receiver, subject, and body. It is possible to write the body in HTML format. You can also specify SSIS variables. The following HTML code shows how to write in bold,<br />
italic, with bullets and more:<br />
<pre class="crayon-plain-tag">&lt;h1&gt;This is an example using headers&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;This is an example to write using bold&lt;/strong&gt; &lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;em&gt;This is an example to write using italic &lt;br /&gt;&lt;/em&gt;
This is an example using underline&lt;br /&gt;&lt;br /&gt;
&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;This is an example with lists&lt;/li&gt;
  &lt;li&gt;Sedond of the list&lt;/li&gt;
  &lt;li&gt;Third of the list&lt;/li&gt;
&lt;/ol&gt;
&lt;ul style="list-style-type:circle"&gt;
  &lt;li&gt;This is an example with bullets&lt;/li&gt;
  &lt;li&gt;Bullet sample &lt;/li&gt;
  &lt;li&gt;Working with bullets&lt;/li&gt;
&lt;/ul&gt;</pre>
&nbsp;</p>
<div id="attachment_4075" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4075" class="size-full wp-image-4075" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png" alt="SSIS HTML mail message" width="625" height="665" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-send-report-as-email-attachment-282x300.png 282w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4075" class="wp-caption-text">Dynamic HTML in SSIS</p></div></li>
<li>Additionally, in Visual Studio go to the menu and SSIS, Variables and create two variables that will be used in the report named Title and ReportName of type string and specify values for them:
<div id="attachment_4066" style="width: 727px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4066" class="size-full wp-image-4066" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png" alt="SSIS dynamic emails" width="717" height="142" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables.png 717w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-variables-300x59.png 300w" sizes="(max-width: 717px) 100vw, 717px" /></a><p id="caption-attachment-4066" class="wp-caption-text">Using SSIS variables in emails</p></div></li>
<li>Finally, run the script and check your email received:
<div id="attachment_4077" style="width: 610px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4077" class="size-full wp-image-4077" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png" alt="The email with the SSRS Report" width="600" height="358" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent.png 600w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-SSIS-email-sent-300x179.png 300w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-4077" class="wp-caption-text">Email received SSIS Html format</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS with parameters</h3>
<p>Another key point is the use of parameters. Sometimes your SSRS includes parameters. With our Reporting Service Task, it is possible to call an SSRS report and pass SSIS parameters. You will require a Report with a parameter to test it. If you do not know how to create a parameter in SSRS, click <a href="https://docs.microsoft.com/en-us/sql/reporting-services/report-design/report-parameters-report-builder-and-report-designer?view=sql-server-2017" target="_blank" rel="noopener">here</a>.</p>
<ol>
<li>First of all, you will need an SSRS Report with a parameter:
<div id="attachment_4081" style="width: 811px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4081" class="size-full wp-image-4081" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png" alt="SSRS reporting with parameters" width="801" height="392" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter.png 801w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter-300x147.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-parameter-768x376.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><p id="caption-attachment-4081" class="wp-caption-text">Reporting Service Parameter</p></div></li>
<li>Secondly, in SSDT or Visual Studio, in the menu, go to SSIS and variables. Create an SSIS variable:
<div id="attachment_4082" style="width: 605px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4082" class="size-full wp-image-4082" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png" alt="Creating variables in SSIS" width="595" height="109" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters.png 595w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-parameters-300x55.png 300w" sizes="(max-width: 595px) 100vw, 595px" /></a><p id="caption-attachment-4082" class="wp-caption-text">Variables in SSIS</p></div></li>
<li> Finally, in Report Services Task in Visual Studio, go to Report Parameters and map the SSRS parameter with the SSIS variable:
<div id="attachment_4083" style="width: 726px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4083" class="size-full wp-image-4083" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png" alt="SSIS mapping of SSRS paremeters and SSIS variables" width="716" height="497" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters.png 716w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-SSRS-map-reporting-service-parameters-with-integration-services-parameters-300x208.png 300w" sizes="(max-width: 716px) 100vw, 716px" /></a><p id="caption-attachment-4083" class="wp-caption-text">Map SSIS variable with SSRS parameters</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS using data-driven configuration</h3>
<p>Data-driven configuration allows configuring different reports with different configurations. In addition, the option allows handling multiple reports using a table with all the configurations for each report. Also, this task creates a table in SQL Server with the configurations for each report. Let&#8217;s take a look to see how this works.</p>
<ol>
<li>First of all, select the data-driving report export using config table.</li>
<li> Also, you will need to specify the connection to the SQL Server<br />
database.</li>
<li>In addition, go to config table, press new to create a new table:
<div id="attachment_4099" style="width: 632px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4099" class="size-full wp-image-4099" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png" alt="Data-driven configuration for SSRS in SSIS" width="622" height="618" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1.png 622w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-data-driven-SSRS-1-300x298.png 300w" sizes="(max-width: 622px) 100vw, 622px" /></a><p id="caption-attachment-4099" class="wp-caption-text">SSRS Data-driven in SSIS</p></div></li>
<li>Additionally, ZappySys allows creating a sample table that can help you to understand how to configure local reports, Calling SSRS Reports in SSIS and save to files, specify paths, ports, email options and more:<br />
<pre class="crayon-plain-tag">CREATE TABLE [{{SchemaName}}].[{{TableName}}](
	Id int identity(1,1) NOT NULL  PRIMARY KEY, 
	GroupName varchar(100) NULL,  /* Used to filter reports */
	ReportType varchar(10) NOT NULL, /*Local or Server*/
	ReportServiceUrl  varchar(500) null, 
	ReportPath varchar(500) NOT NULL, 
	IsEnabled bit NOT NULL default(1),
	ExportAsFile bit NOT NULL default(1),
	ExportAsEmail bit NOT NULL default(0),
	Parameters varchar(max) NULL, /* ParameterName1;IsMultiValue;Value1|....ParameterNameN;IsMultiValue;ValueN */
	ExportPath varchar(500) NULL,
	AddFileSuffix bit NULL,
	ExportFileSuffix varchar(500) NULL, /* e.g. _ddMMyyyy, _ddMMyyyyhhmmss, _ddMMyyyyhhmmss.fff (see this URL http://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx) */
	Description varchar(500) NULL,
	EmailFrom varchar(255) NULL,
	EmailTo varchar(1000) NULL,
	EmailCc varchar(1000) NULL,
	EmailBcc varchar(1000) NULL,
	EmailSubject varchar(500) NULL,	
	EmailIsHtml bit NULL default(1),	
	EmailBodyText varchar(max) NULL,
	EmailAttachmentFile varchar(500) NULL, /*Unused: For future use only*/
	LastExportStartDate datetime NULL,
	LastExportEndDate datetime NULL,
	LastStatus varchar(20) NULL,
	LastMessage varchar(max) NULL,
	Datasets varchar(max) NULL, /*if ReportType=local and report file is using dataset(s) then supply data in this column (multiple values must be pipe delimited). e.g. Dataset1|Dataset2)*/
	DatasetConnectionStrings varchar(max) NULL, /*if ReportType=local and report file is using dataset(s) then supply data in this column (connection string must be same order as datasets (multiple values must be pipe delimited) enter just one connectionstring if all datasets using same connection. ConnectionString must be ADO.NET for SQLServer, ODBC or OLEDB connection string and correct driver must be installed on the system)*/
	DatasetQueries varchar(max) NULL /*if ReportType=local and report file is using dataset(s) then supply data in this column (queries must be in the same order as dataset(s) listed in Datasets column. enter multiple queries in this format &lt;xml&gt;&lt;query&gt;{query for 1st dataset}&lt;/query&gt;&lt;query&gt;{query for 2nd dataset}&lt;/query&gt;&lt;/xml&gt;)*/
);</pre>
&nbsp;</p>
<div id="attachment_4100" style="width: 499px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4100" class="size-full wp-image-4100" src="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png" alt="Data-driven table in SSRS" width="489" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code.png 489w, https://zappysys.com/blog/wp-content/uploads/2018/06/ssis-data-driven-table-t-sql-code-300x204.png 300w" sizes="(max-width: 489px) 100vw, 489px" /></a><p id="caption-attachment-4100" class="wp-caption-text">Sample Database in SSIS for SSRS</p></div></li>
<li>Finally, you can check the table with the configuration:
<div id="attachment_4102" style="width: 849px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4102" class="size-full wp-image-4102" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png" alt="SSIS data-driven table in SSRS" width="839" height="137" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS.png 839w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS-300x49.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSRS-data-driven-config-in-SSIS-768x125.png 768w" sizes="(max-width: 839px) 100vw, 839px" /></a><p id="caption-attachment-4102" class="wp-caption-text">Data-driven table created in SSIS</p></div></li>
</ol>
<h3>Calling SSRS Reports in SSIS to Export local report option</h3>
<p>With local reports, you can work with rdl files. The rdl (Report Definition Language) files are part of the SSRS. They are physical files that contain the report format and other components. Using the export local report you can customize queries and see the results as reports. Here we will explain how to do it.</p>
<ol>
<li>First of all, in the Reporting Services task in Visual Studio, make sure to select the option Export local report.</li>
<li>Secondly, in report path, you need to specify your rdl file path.</li>
<li>In addition, check the dataset. The dataset is usually detected by default. It is included in the SSRS.</li>
<li>Also, in Dataset Constr, you will need to specify the connection information. You need to specify the SQL Server name, Database name, Authentication type. For more information about connection string, click <a href="https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax" target="_blank" rel="noopener">here</a>.</li>
<li>Finally, in dataset queries, you need to specify your query using the XML and query tags:
<div id="attachment_4103" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4103" class="size-full wp-image-4103" src="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png" alt="SSRS report in SSIS" width="625" height="665" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string.png 625w, https://zappysys.com/blog/wp-content/uploads/2018/06/SSIS-Export-local-report-query-dataset-connection-string-282x300.png 282w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-4103" class="wp-caption-text">SSIS local SSRS report</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>In summary, calling SSRS Reports in SSIS is a straightforward task using the ZappySys Reporting Service task. In this article, we learned how to export a Reporting services Report to a file. Also, we learned how to send emails using SSIS with the report attached and we also learned how to rename, copy files and finally how to use Data-Driven configuration and create queries to local reports. If you liked the tool, you can download it <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">here.</a></p>
<h2>References</h2>
<p>Finally, refer to these links for more information:</p>
<ul>
<li><a href="https://docs.microsoft.com/en-us/sql/reporting-services/reporting-services-tutorials-ssrs?view=sql-server-2017" target="_blank" rel="noopener"> Reporting Services Tutorial<br />
</a></li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-report-generator-task/" target="_blank" rel="noopener">SSRS Task in SSIS</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/calling-ssrs-reports-in-ssis-export-emai/">Calling SSRS Reports in SSIS (Export / Email)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to import REST API in Power BI (Load JSON / SOAP XML)</title>
		<link>https://zappysys.com/blog/howto-import-json-rest-api-power-bi/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Mar 2018 03:38:27 +0000</pubDate>
				<category><![CDATA[JSON File / REST API Driver]]></category>
		<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[Reporting - Microsoft Power BI]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[power bi]]></category>
		<category><![CDATA[rest api]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2822</guid>

					<description><![CDATA[<p>Introduction In this article, we will learn how to import REST API in Power BI. Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">How to import REST API in Power BI (Load JSON / SOAP XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-power-biimport-export.png"><img loading="lazy" decoding="async" class="alignleft wp-image-2900 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/03/json-to-power-biimport-export-150x150.png" alt="Introduction icon json to power bi" width="150" height="150" /></a></p>
<p>In this article, we will learn how to <strong>import REST API in Power BI</strong>.</p>
<p>Power BI is a very popular Business Analytic tool used to get business information. It is very popular because it is easy to install, simple to learn and very intuitive. Also, REST API is very popular these days and we wanted to show you a way to integrate them in Power BI with the help of the <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC PowerPack</a>. This software includes powerful drivers to <strong>query REST API</strong> URL, Local <strong>XML / JSON files</strong> and <strong>XML SOAP Web Service</strong> with simple SQL queries.</p>
<p>The following video will show how to import REST API in Power BI (JSON or XML Data):<br />
[youtube https://www.youtube.com/watch?v=-3OPfhMY1aI&amp;w=720&amp;h=405]
<h2 style="text-align: left;">Requirements</h2>
<ol>
<li>First, you will need to have <a href="https://powerbi.microsoft.com/en-us/desktop/" target="_blank" rel="noopener">Power BI Desktop (FREE)</a> installed</li>
<li>In the second place, you will need to have internet access</li>
<li>On third place, our <a href="https://zappysys.com/products/odbc-powerpack/">ZappySys ODBC Power Pack</a></li>
</ol>
<h2>Step-by-Step: Import REST API into Power BI</h2>
<p>We&#8217;ll walk through the steps to import a REST API into Power BI. The steps outlined below focus on working with JSON APIs, but the same principles can be applied when importing SOAP XML Web Services or local JSON/XML files.</p>
<p>For demonstration purposes, we will utilize a REST API to retrieve data in JSON format. The example URL we&#8217;ll use is:</p><pre class="crayon-plain-tag">https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json</pre><p>
This URL leverages OData and presents information in JSON format. Our objective is to use the ZappySys ODBC Power Pack to establish a connection to this URL and retrieve the information seamlessly into Power BI.</p>
<h3>Create ODBC DSN &#8211; JSON Driver</h3>
<div class="content_block" id="custom_post_widget-3331">Once <a href="https://zappysys.com/products/odbc-powerpack/" target="_blank" rel="noopener">ZappySys ODBC PowerPack</a> is installed our next step is to Create and configure ODBC DSN. For example purpose, we will use ZappySys JSON Driver but steps are identical for most of ZappySys ODBC Drivers (e.g. XML Driver or CSV Driver)
<ol>
 	<li>Search for "odbc" in your start menu and click on ODBC (64 bits).
* If you cant find this then you can also go to <span class="lang:default highlight:0 decode:true crayon-inline">Start Menu &gt; ZappySys &gt; ODBC PowerPack &gt; Click on ODBC Data Sources (64-Bit)</span>. If you don't see ODBC 64 bit then most likely you are running 32-bit OS (So just click first ODBC Data Source)
<div class="wp-caption alignnone">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/odbc-data-source-64-bits.png"><img loading="lazy" decoding="async" class="alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/03/odbc-data-source-64-bits.png" alt="Open ODBC Data Source" width="340" height="434" /></a>
<p class="wp-caption-text">Open ODBC Data Source</p>

</div></li>
 	<li>Go to <strong>User DSN Tab</strong> and press <strong>Add</strong>. If your DSN needs to be accessed by all users or some service account (like SQL Task Scheduler) then click on <a href="https://zappysys.com/blog/wp-content/uploads/2018/03/odb-data-source-administrator-add.png" target="_blank" rel="noopener">System Tab</a> rather than User Tab.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-new-data-source-odbc-administrator.png" alt="Create new ODBC DSN (User DSN Tab)" />
</a>
<p class="wp-caption-text">Create new ODBC DSN (User DSN Tab)</p>

</div></li>
 	<li>Add the ZappySys JSON Driver. It is installed with the ZappySys ODBC PowerPack.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-zappysys-json-driver.png" alt="Add ZappySys JSON / REST Driver Connection" />
</a>
<p class="wp-caption-text">Add ZappySys JSON / REST Driver Connection</p>

</div></li>
 	<li>Enter a name for the Data source and configure other necessary properties (e.g. URL / Credentials). You can configure properties in two different modes (<strong>Simple Mode (Default)</strong> or <strong>Advanced Mode</strong>). For Our JSON Driver Example enter URL and Set Data Format as <strong>OData</strong> (For Simple Mode Check Input / Output Format Tab, For Advanced Mode Check. HTTP Advanced Settings). <strong> If your API is not OData compliant or you are not sure then keep it DEFAULT</strong>.
<pre class="lang:default highlight:0 decode:true">https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json</pre>
&nbsp;
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/configure-odbc-dsn-rest-api-connection-simple-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi1.png" alt="Configure API Connection - Simple Mode (User Interface Mode)" />
</a>
<p class="wp-caption-text">Configure API Connection - Simple Mode (User Interface Mode)</p>

</div>
&nbsp;</li>
 	<li>Here is the Advanced view with all properties in Grid mode.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/configure-odbc-dsn-rest-api-connection-advanced-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi2.png" alt="Configure API Connection - Advanced Mode (Property Grid Mode)" />
</a>
<p class="wp-caption-text">Configure API Connection - Advanced Mode (Property Grid Mode)</p>

</div></li>
 	<li>Finally, you can go to preview tab. Click on the select table to generate your default SQL Query for API service and press <strong>Preview data</strong> to see the magic :).When you click Preview data it parses your SQL Query and sends HTTP Request to fetch Data from JSON service. Once the response is returned it parse nested JSON structure and turns into rows/columns.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/zappysys-select-table-preview.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi4.png" alt="Select Table for preview" />
</a>
<p class="wp-caption-text">Select Table for preview</p>

</div>
&nbsp;</li>
 	<li>
<div style="display: block; margin-bottom: 1em;">Once you select Table name from drop down, UI generates default query for you with all possible column names for selected table like below.</div>
<div style="margin-bottom: 1em;"><strong>Sample Query</strong></div>
<pre class="lang:tsql decode:true">select 
	"CustomerID",
	"CompanyName",
	"ContactName",
	"ContactTitle",
	"Address",
	"City",
	"Region",
	"PostalCode",
	"Country",
	"Phone",
	"Fax"
 from [value]</pre>
&nbsp;</li>
 	<li>To review more examples, make sure to <strong>click on View Examples</strong> button to see many more ways to call API services and extract/transform data
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/examples-call-rest-api-json-sql-server-zappysys-odbc-driver.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi3.png" alt="ZappySys ODBC Driver Examples - Call JSON / REST API" />
</a>
<p class="wp-caption-text">ZappySys ODBC Driver Examples - Call JSON / REST API</p>

</div></li>
 	<li>Now last thing you can try is use Query Builder. Query Builder is an easy way to Build Queries by Overriding certain setting defined on DSN. ZappySys API SQL Query language support WITH Clause which can override settings defined on DSN UI. Usually you can Define Connection related settings on DSN and override Dynamic Settings in your SQL Query so you dont have to create many DSN for each API URL.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/zappysys-api-sql-query-builder.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/05/powerbi5.png" alt="Using API SQL Query Builder" />
</a>
<p class="wp-caption-text">Using API SQL Query Builder</p>

</div></li>
</ol>
<strong>Transfer DSN settings</strong>

There will be a time when you like to create similar ODBC DSN on a totally different machine. If you wish to copy settings of one DSN to different DSN then you can use Load Connection String Feature.

First copy Connection string produced by UI settings on DSN configuration by clicking <strong>Copy Connection String Button</strong> (Found at the bottom of UI). Then you can go to new DSN and click Load connection string to new DSN by clicking <strong>Load Connection String Button</strong>.

<strong>Understanding ODBC Connection String Format</strong>

ZappySys ODBC Drivers can be called in two different ways from your Application (e.g. <a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a>, <a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a>, <a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a> )
<ol>
 	<li>Using <strong>Driver Name</strong> in the Connection String (You can use Copy Connection String option)</li>
 	<li>Using <strong>DSN Name</strong> in the Connection String</li>
</ol>
<strong>Using Driver Name in the Connection String</strong>

<strong>Syntax:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={DRIVER-NAME-GOES-HERE}[;Prop1=xxxxxx][;Prop2=xxxxxx] .... [;PropN=xxxxxx]</pre>
<strong>Examples:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={ZappySys JSON Driver}
DRIVER={ZappySys JSON Driver};DataPath='c:\mydata.json'
DRIVER={ZappySys XML Driver};DataPath='http://myserver/api/xml/getOrders'
DRIVER={ZappySys XML Driver};DataPath='c:\mydata.xml'</pre>
<strong>Using DSN Name in the Connection String</strong>

<strong>Syntax:</strong>
<pre class="lang:default highlight:0 decode:true">DRIVER={DRIVER-NAME-GOES-HERE}[;Prop1=xxxxxx][;Prop2=xxxxxx] .... [;PropN=xxxxxx]</pre>
<strong>Examples:</strong>
<pre class="lang:default highlight:0 decode:true">DSN=MyJsonAPI_DSN
DSN=MyJsonAPI_DSN;DataPath='http://myserver/api/json/getOrders'</pre></div>
<h3>Connect to REST API data source in Power BI (Connect JSON / XML data)</h3>
<div class="content_block" id="custom_post_widget-6247">In the previous section, we configured and added the ZappySys drivers in the ODBC Driver Administrator with information to connect to REST API. We queried the REST API data in JSON / XML format. Now let's look at how to import REST API data in Power BI using from ODBC connection.
<ol>
 	<li>Open Power BI Desktop and select the <strong>Get data </strong>option.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2018/03/Get-data-Power-bi-desktop.png" alt="Get data using power bi" />
</a>
<p class="wp-caption-text">Get data using Power BI</p>

</div></li>
</ol>
<ol>
 	<li>Once Get data is clicked, Go to <strong>Other</strong> and select <strong>ODBC.</strong>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-odbc-other-data-source.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-2-1.png" alt="Import ODBC data source in power bi" />
</a>
<p class="wp-caption-text">Import ODBC data source in Power BI</p>

</div></li>
 	<li>After that select ODBC DSN name from the DSN dropdown</li>
 	<li>Now it's time to import data. Basically, there are two modes to import data. <strong>Table Mode</strong> and <strong>Query Mode</strong>. Query mode is the most common but we will show you both ways.</li>
 	<li><strong>Import using Power BI Query Mode:  </strong>Select your DSN and click Advanced Option to enter custom SQL Query to Import your REST API data. You can use ODBC DSN Data sources Preview tool to generate SQL Query. For example you can enter query like below. If you are not sure use Query builder (Found on Driver Preview Window)
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(SRC='https://my-api-url')</pre>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-from-rest-api-url-odbc-json-driver.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-1-1.png" alt="Import JSON / REST API data in Power BI using SQL Query Mode" />
</a>
<p class="wp-caption-text">Import JSON / REST API data in Power BI using SQL Query Mode</p>

</div>
&nbsp;</li>
 	<li><strong>Import using Power BI Table Mode:  </strong>If you don't specify SQL query under advanced options then you may get a chance to select Table name to import and Credentials. If Power BI asks for credentials then select <strong>Windows</strong> and connect.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/select-credentials-zappysys.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-3.png" alt="Select credentials for ODBC Source" />
</a>
<p class="wp-caption-text">Select credentials for ODBC Source</p>

</div></li>
 	<li>Once you enter select table, you can choose Select data to import and click OK (Below screeenshot is for the Table mode import when no SQL specified. You can pick desired table to import)
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Navigator-odbc-json-get-values.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-4.png" alt="Select Table to import in Power BI" />
</a>
<p class="wp-caption-text">Select Table to import in Power BI</p>

</div></li>
 	<li>You can also display data in map using Map visualization like below. Press the map and check Address this option will display the addresses in a map.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-power-view.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-5.png" alt="see address in power bi map" />
</a>
<p class="wp-caption-text">See Address data in power bi map</p>

</div>
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/maps-address-power-bi.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-6.png" alt="Map visualization in Power BI" />
</a>
<p class="wp-caption-text">Map visualization in Power BI</p>

</div></li>
 	<li>Now, let's display data in Table Format. Select in values more columns and select the data grid to visualize the data.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/visualization-power-bi-select-columns.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-7.png" alt="Select columns in Power BI" />
</a>
<p class="wp-caption-text">Select columns in Power BI</p>

</div></li>
 	<li>Once data is displayed, Right click on the data and select <strong>Show Data</strong>.
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-show-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-8.png" alt="show data in power bi" />
</a>
<p class="wp-caption-text">Show data in Power BI</p>

</div></li>
 	<li>The data will be displayed
<div class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-read-data.png">
<img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/01/odbc-power-bi-import-rest-api-9.png" alt="View Power BI Table data" />
</a>
<p class="wp-caption-text">read json information data</p>

</div></li>
</ol></div>
<h3>Publish Power BI dashboard</h3>
<ol>
<li>In order to publish the report, press <strong>Publish</strong></li>
<li>Press <strong>Save</strong>
<div id="attachment_2839" style="width: 467px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/save-power-bi-report.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2839" class="size-full wp-image-2839" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-1.png" alt="Save changes in power bi" width="457" height="159" /></a><p id="caption-attachment-2839" class="wp-caption-text">Save changes in Power BI<span style="font-size: 16px;">:</span></p></div>
<p>&nbsp;</li>
<li><span style="font-size: 16px;">Select a workspace for the report</span>
<div id="attachment_2838" style="width: 604px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/publish-Power-bi-select-workplace.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2838" class="size-full wp-image-2838" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-2.png" alt="choose power bi workplace" width="594" height="340" /></a><p id="caption-attachment-2838" class="wp-caption-text">Select Power BI workplace<span style="font-size: 16px;">.</span></p></div></li>
<li>And that is all. You have now your report ready.</li>
</ol>
<h2></h2>
<h2>Import data using ODBC ConnectionString (DSN-less)</h2>
<p>Let&#8217;s explore the process of importing data using the ODBC Driver without the need for configuring an ODBC DSN.</p>
<p>When importing data, you have the option to either use an ODBC DSN or a Direct ConnectionString. This section will guide you through the steps of utilizing the ODBC ConnectionString.</p>
<p>After opting for the ODBC option to retrieve data, you will encounter the &#8220;Select ODBC Data Source&#8221; screen. To proceed without a DSN, follow these steps:</p>
<ol>
<li>Change the DSN dropdown to &#8220;(none).&#8221;</li>
<li>Enter the full ODBC ConnectionString, adhering to the syntax below. You can construct your own connection string using the ODBC Driver UI and utilize the &#8220;Copy ConnectionString&#8221; option.<br />
<strong>Syntax:</strong>  <pre class="crayon-plain-tag">Driver={Your Driver Name}[;Property1=value][;Property2=value]......</pre></li>
<li>Here is a screenshot with ConnectionString Setting
<div id="attachment_9388" style="width: 824px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-dsnless-import-odbc-connectionstring.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9388" class="size-full wp-image-9388" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-3-1.png" alt="Import Data from ODBC Driver - DSN less mode (Use Connection String)" width="814" height="716" /></a><p id="caption-attachment-9388" class="wp-caption-text">Import Data from ODBC Driver &#8211; DSN less mode (Use Connection String)</p></div></li>
<li>Click &#8220;Next&#8221; to select the authentication method. Choose &#8220;Windows&#8221; and input the password value if necessary. If your connection string already includes the Password attribute, there&#8217;s no need to worry.
<div id="attachment_9389" style="width: 718px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-connectionstring-enter-password.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9389" class="size-full wp-image-9389" src="https://zappysys.com/blog/wp-content/uploads/2018/03/howto-import-json-rest-api-power-bi-4.png" alt="Import Data from ODBC Driver - using Connection String - With Password Attribute" width="708" height="383" /></a><p id="caption-attachment-9389" class="wp-caption-text">Import Data from ODBC Driver &#8211; using Connection String &#8211; With Password Attribute</p></div></li>
</ol>
<h2>POST data to REST API URL</h2>
<p>Up until now, we&#8217;ve explored the process of fetching data from URLs and importing it into Power BI. However, in certain scenarios, APIs may necessitate the use of the PUT or POST method. These methods involve submitting parameters in the body and receiving a response.</p>
<p>For a more in-depth understanding of how to seamlessly POST data to a URL in Power BI, watch the informative video below.</p>
<a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FK7qV_PJup1g%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Calling XML SOAP Web Service in Power BI</h2>
<p>So far, we have looked at examples to consume data using JSON driver. Now let&#8217;s look at an example, to call XML SOAP Web Service in Power BI.</p>
<div class="content_block" id="custom_post_widget-3870">To call SOAP API you need to know Request XML Body Structure. If you are not sure how to create SOAP Request body then no worries. <a href="https://zappysys.com/blog/calling-soap-web-service-in-ssis-xml-source/" target="_blank" rel="noopener">Check this article</a> to learn how to generate SOAP Request body using the Free tool <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI</a>. Basically, you have to use SoapUI to generate Request XML and after that, you can replace parameters as needed in the generated body.
<h3>What is SOAP Web Service?</h3>
If you are new to SOAP Web Service sometimes referred as XML Web Service then please read some concept about SOAP Web service standard <a href="https://msdn.microsoft.com/en-us/library/ms996507.aspx?f=255&amp;MSPPError=-2147217396" target="_blank" rel="noopener">from this link</a>

There are two important aspects in SOAP Web service.
<ol>
 	<li>Getting WSDL file or URL</li>
 	<li>Knowing exact Web Service URL</li>
</ol>
<h3>What is WSDL</h3>
In very simple term WSDL (often pronounced as whiz-dull) is nothing but a document which describes Service metadata (e.g. Functions you can call, Request parameters, response structure etc). Some service simply give you WSDL as xml file you can download on local machine and then analyze or sometimes you may get direct URL (e.g. http://api.mycompany.com/hr-soap-service/?wsdl )
<h3>Example SQL Query for SOAP API call using ZappySys XML Driver</h3>
Here is an example SQL query you can write to call SOAP API. If you not sure about many details then check next few sections on how to use XML Driver User Interface to build desired SQL query to POST data to XML SOAP Web Service without any coding.
<pre class="lang:tsql decode:true">SELECT * FROM $
WITH(
	 Src='http://www.holidaywebservice.com/HolidayService_v2/HolidayService2.asmx'
	,DataConnectionType='HTTP'
	,CredentialType='Basic' --OR SoapWss
	,SoapWssPasswordType='PasswordText'
	,UserName='myuser'
	,Password='pass$$w123'
	,Filter='$.soap:Envelope.soap:Body.GetHolidaysAvailableResponse.GetHolidaysAvailableResult.HolidayCode[*]'
	,ElementsToTreatAsArray='HolidayCode'	
	,RequestMethod='POST'	
	,Header='Content-Type: text/xml;charset=UTF-8 || SOAPAction: "http://www.holidaywebservice.com/HolidayService_v2/GetHolidaysAvailable"'
	,RequestData='
&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:hol="http://www.holidaywebservice.com/HolidayService_v2/"&gt;
   &lt;soapenv:Header/&gt;
   &lt;soapenv:Body&gt;
      &lt;hol:GetHolidaysAvailable&gt;
         &lt;!--type: Country - enumeration: [Canada,GreatBritain,IrelandNorthern,IrelandRepublicOf,Scotland,UnitedStates]--&gt;
         &lt;hol:countryCode&gt;UnitedStates&lt;/hol:countryCode&gt;
      &lt;/hol:GetHolidaysAvailable&gt;
   &lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;'
)</pre>
Now let's look at steps to create SQL query to call SOAP API. Later we will see how to generate code for your desired programming language (e.g. C# or SQL Server)
<h3>Video Tutorial - Introduction to SOAP Web Service and SoapUI tool</h3>
Before we dive into details about calling SOAP API using ZappySys XML Driver, lets first understand what is SOAP API and how to create SOAP requests using SoapUI tool. You will learn more about this process in the later section. The video contains some fragment about using SOAP API in SSIS but just ignore that part because we will be calling Soap API using ZappySys ODBC Driver rather than SSIS Components.

&nbsp;

<iframe loading="lazy" width="560" height="315" src="https://www.youtube.com/embed/d_x5bgGjg0Y?rel=0&amp;showinfo=0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen="allowfullscreen" data-mce-fragment="1"></iframe>
<h3>Using SoapUI to test SOAP API call / Create Request Body XML</h3>
Assuming you have downloaded and installed <a href="https://www.soapui.org/downloads/latest-release.html" target="_blank" rel="noopener">SoapUI from here</a>, now we are ready to use WSDL for your SOAP Web Service Calls. If you do not have WSDL file or URL handy then contact your API provider (sometimes you just have to add <strong>?wsdl </strong>at the end of your Service URL to get WSDL so try that. Example: http://mycompany/myservice?wsdl ).

If you don't know what is WSDL then in short, WSDL is <strong>Web service Description Language</strong> (i.e. XML file which describes your SOAP Service). WSDL helps to craft SOAP API request Body for ZappySys XML Driver. So Let's get started.
<ol>
 	<li>Open SoapUI and click SOAP button to create new SOAP Project</li>
 	<li>Enter WSDL URL or File Path of WSDLFor example WSDL for our sample service can be accessed via this URL
<pre class="lang:default highlight:0 decode:true">http://www.dneonline.com/calculator.asmx?wsdl</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-import-wsdl-new-soapui-project.png"><img loading="lazy" decoding="async" class="size-full wp-image-3871" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-14.png" alt="Create new SOAP API Project in SoapUI tool for SOAP API Testing" width="486" height="349" /></a>
<div style="margin-bottom: 1em;">Create new SOAP API Project in SoapUI tool for SOAP API Testing</div></li>
 	<li>Once WSDL is loaded you will see possible operations you can call for your SOAP Web Service.</li>
 	<li>If your web service requires credentials then you have to configure it. There are two common credential types for public services (<strong>SOAP WSS</strong> or <strong>BASIC</strong> )
<ol>
 	<li>
<div style="margin-bottom: 1em;">To use <strong>SOAP WSS Credentials</strong> select request node and enter UserId, Password, and <strong>WSS-PasswordType</strong> (PasswordText or PasswordHash)</div>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-soap-wss-credentials-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3872 alignnone" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)" width="294" height="544" /></a>
<div style="display: block;">Configure SOAP WSS Credentials for SoapUI (SOAP API Testing Tool)</div></li>
 	<li>To use <strong>BASIC Auth</strong> Credentials select request node and double-click it. At the bottom click on Auth (Basic) and From Authorization dropdown click Add New and Select Basic.<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-api-pass-basic-authentication-userid-password.png"><img loading="lazy" decoding="async" class="size-full wp-image-3873" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-2.png" alt="Configure Basic Authorization for SoapUI (SOAP API Testing Tool)" width="616" height="653" /></a>
<div style="margin-bottom: 1em;">Configure Basic Authorization for SoapUI (SOAP API Testing Tool)</div></li>
</ol>
</li>
 	<li>Now you can test your request first Double-click on the request node to open request editor.</li>
 	<li>Change necessary parameters, remove optional or unwanted parameters. If you want to regenerate request you can click on <strong>Recreate default request toolbar icon</strong>.
<a href="https://zappysys.com/blog/wp-content/uploads/2016/06/create-soap-request-with-optional-parameters-soapui.png"><img loading="lazy" decoding="async" class="size-full wp-image-2812" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-4.png" alt="Create SOAP Request XML (With Optional Parameters)" width="807" height="315" /></a>
<div style="margin-bottom: 1em;">Create SOAP Request XML (With Optional Parameters)</div></li>
 	<li>Once your SOAP Request XML is ready, <strong>Click the Play button</strong> in the toolbar to execute SOAP API Request and Response will appear in Right side panel.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soapui-test-soap-api-request-response-edit-xml-body.png"><img loading="lazy" decoding="async" class="size-full wp-image-3874" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-5.png" alt="Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)" width="1216" height="511" /></a>
Test SOAP API using SoapUI Tool (Change Default XML Body / Parameters, Execute and See Response)</li>
</ol>
<h3>Create DSN using ZappySys XML Driver to call SOAP API</h3>
Once you have tested your SOAP API in SoapUI tool, we are ready to use ZappySys XML driver to call SOAP API in your preferred BI tool or Programming language.
<ol>
 	<li>First open <strong>ODBC Data Sources</strong> (search ODBC in your start menu or go under ZappySys &gt; ODBC PowerPack &gt; <strong>ODBC 64 bit</strong>)</li>
 	<li>Goto <strong>System DSN</strong> Tab (or User DSN which is not used by Service account)</li>
 	<li>Click <strong>Add</strong> and Select ZappySys XML Driver
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-odbc-xml-soap-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3875" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-6.png" alt="ZappySys ODBC Driver for XML / SOAP API" width="593" height="459" /></a>
ZappySys ODBC Driver for XML / SOAP API</li>
 	<li>Configure API URL, Request Method and Request Body as below
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3876" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-7.png" alt="ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body" width="916" height="874" /></a>
ZappySys XML Driver - Calling SOAP API - Configure URL, Method, Body</li>
 	<li><strong>(This step is Optional)</strong> If your SOAP API requires credentials then Select Connection Type to HTTP and configure as below.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-call-credential-basic-soap-wss-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3877" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-8.png" alt="ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)" width="564" height="483" /></a>
<div style="display: block;">ZappySys XML Driver - Configure SOAP WSS Credentials or Basic Authorization (Userid, Password)</div></li>
 	<li>Configure-Request Headers as below (You can get it from Request &gt; Raw tab from SoapUI after you test the request by clicking the Play button)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/set-soap-api-request-headers-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3881" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-9.png" alt="Configure SOAP API Request Headers - ZappySys XML Driver" width="1009" height="747" /></a>
Configure SOAP API Request Headers - ZappySys XML Driver</li>
 	<li>Once credentials entered you can select Filter to extract data from the desired node. Make sure to select array node (see special icon) or select the node which contains all necessary columns if you don't have array node.
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/soap-api-query-select-filter-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3882" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-10.png" alt="Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)" width="809" height="594" /></a>
Select Filter - Extract data from nested XML / SOAP API Response (Denormalize Hierarchy)</li>
 	<li>If prompted select yes to treat selected node as Array (This is helpful when you expect one or more record for selected node)
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/xml-api-array-handling-zappysys-xml-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3883" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-11.png" alt="Treat selected node as XML Array Option for SOAP API Response XML" width="655" height="572" /></a>
Treat selected node as XML Array Option for SOAP API Response XML</li>
</ol>
<h3>Preview SOAP API Response / Generate SQL Code for SOAP API Call</h3>
Once you configure settings for XML Driver now you can preview data or generate example code for desired language (e.g. C#, Python, Java, SQL Server).

Go to Preview tab and you will see default query generated based on settings you entered in previous sections. Attributes listed in WITH clause are optional. If you omit attribute in WITH clause it will use it from Properties tab.
<h3>Preview Data</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/calling-soap-web-service-zappysys-xml-api-driver.png"><img loading="lazy" decoding="async" class="size-full wp-image-3884" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-12.png" alt="Preview SOAP API Response in ZappySys XML Driver" width="808" height="780" /></a>
Preview SOAP API Response in ZappySys XML Driver
<h3>Generate Code Option</h3>
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/zappysys-driver-code-generator.png"><img loading="lazy" decoding="async" class="size-full wp-image-3885" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-call-soap-api-13.png" alt="Generate Example Code for ZappySys Driver" width="572" height="618" /></a>
<div style="display: block;">Generate Example Code for ZappySys Driver</div></div>
<h2>SOAP / REST API pagination in Power BI</h2>
<div class="content_block" id="custom_post_widget-3892"><div style="margin-bottom: 1em;">Even we set up ODBC Data Source to get the data, it may not be enough. Usually, if you are getting a huge data set from API provider, it won't give it to you in one HTTP response. Instead, it gives back only a subset of data and provides a mechanism for data pagination. The good news is that <em>ZappySys ODBC Driver</em> includes many options to cover virtually any pagination method.</div>
<div><span style="font-size: 16px;">Below you will find a few examples of API pagination. If you need something more sophisticated check the below link (the article was written for SSIS PowerPack but UI options and concepts apply to ODBC Driver too):</span></div>
<div style="margin-bottom: 1em;"><a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/</a></div>
<h3>Paginate by Response Attribute</h3>
This example shows how to paginate API calls where you need to paginate until the last page detected. In this example, next page is indicated by some attribute called nextlink (found in response). If this attribute is missing or null then it stops fetching the next page.
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH(
SRC=@'https://zappysys.com/downloads/files/test/pagination_nextlink_inarray_1.json'
,NextUrlAttributeOrExpr = '$.nextlink'  --keep reading until this attribute is missing. If attribute name contains dot then use brackets like this $.['my.attr.name']
)</pre>
<h3>Paginate by URL Parameter (Loop until certain StatusCode)</h3>
This example shows how to paginate API calls where you need to pass page number via URL. The driver keeps incrementing page number and calls next URL until the last page detected (401 error). There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/page-xml.aspx?page=1&amp;mode=DetectBasedOnResponseStatusCode'
,PagingMode='ByUrlParameter'
,PagingByUrlAttributeName='page'
,PagingByUrlEndStrategy='DetectBasedOnResponseStatusCode'
,PagingByUrlCheckResponseStatusCode=401
,IncrementBy=1
)</pre>
<h3>Paginate by URL Path (Loop until no record)</h3>
This example shows how to paginate API calls where you need to pass page number via URL Path. The driver keeps incrementing page number and calls next URL until the last page is detected. There are few ways to indicate the last page (e.g. By status code, By row count, By response size). If you don't specify end detection then it will use the default (i.e. No records found).
<pre class="lang:tsql decode:true codeblock">SELECT * FROM $
WITH (
SRC=@'https://zappysys.com/downloads/files/test/cust-&lt;%page%&gt;.xml'
,PagingMode='ByUrlPath'
,PagingByUrlAttributeName='&lt;%page%&gt;'
,PagingByUrlEndStrategy='DetectBasedOnRecordCount'
,IncrementBy=1
)</pre>
<h3>Paginate by Header Link (RFC 5988)</h3>
API like GitHub / Wordpress use Next link in Headers (<a href="https://tools.ietf.org/html/rfc5988" target="_blank" rel="noopener">RFC 5988</a>)
<pre class="lang:default decode:true ">SELECT * FROM $
LIMIT 25
WITH(
	 Src='https://wordpress.org/news/wp-json/wp/v2/categories?per_page=10'
	,PagingMode='ByResponseHeaderRfc5988'
	,WaitTimeMs='200' --//wait 200 ms after each request
)</pre>
&nbsp;</div>
<h2>SOAP / REST API Error Handling in Power BI</h2>
<div class="content_block" id="custom_post_widget-3894">Sometimes errors occur... they just do and there is nothing you can do! Or can you? Actually, in ODBC PowerPack you can handle them in two ways.
<h3>METHOD 1 - Using Error Handling Options</h3>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-3949" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-1.png" alt="" width="668" height="702" />
<h4>When to use?</h4>
You may want to use them when your source is a resource located on the Internet; e.g. a file on a website, a file on an FTP server or just a plain API HTTP response. By default, when a remote server returns an error, data retrieval is stopped, an error is raised and no data is given back to you. This might not be always desirable.
<h4>Scenario 1</h4>
Imagine a scenario, that there is a web server which each day at 12 AM releases a new JSON file with that day's date as filename, e.g. <span style="text-decoration: underline;"><em>http://www.some-server.com/data/2018-06-20.json</em></span>. And, of course, you want to download it and use it daily in your Power BI report. But you have a problem: Power BI report data sources are refreshed each hour and you may get <a href="https://en.wikipedia.org/wiki/HTTP_404" target="_blank" rel="noopener">HTTP 404 status code</a> (no file was found) when a file is not released yet. Which consequentially means other data sources won't be updated as well and you will see old and cached data on the report. That's where you could use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue when Url is invalid or missing (404 Errors)</span></strong> to avoid an error being raised and let other data sources to be updated.
<h4>Scenario 2</h4>
Another scenario is when you expect a web server to raise some kind of HTTP error when accessing a URL. You don't want ODBC Data Source to raise an error but instead, you want to get response data. That's where you can use <strong><span class="lang:default highlight:0 decode:true crayon-inline">Continue on any error</span></strong> or alike together with  <strong><span class="lang:default highlight:0 decode:true crayon-inline">Get response data on error</span></strong> to continue on an error and get the data:

<img loading="lazy" decoding="async" class="alignnone wp-image-3961 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png" alt="" width="547" height="235" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error.png 547w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-get-response-data-on-error-300x129.png 300w" sizes="(max-width: 547px) 100vw, 547px" />
<h3>METHOD 2 - Using Connection [Retry Settings]</h3>
Another scenario you may run into is a buggy web server. You ask it to give you some file or data and it, like a snotty kid, just doesn't give it to you! You have to ask twice or thrice before it does its job. If that's the case, you have to retry HTTP requests using <em>Connection</em>:

<img loading="lazy" decoding="async" class="alignnone wp-image-3963 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-error-handling-3.png" alt="" width="671" height="572" /></div>
<h2>Security / Connection Types (Options for HTTP, OAuth, SOAP) in Power BI</h2>
<div class="content_block" id="custom_post_widget-3896"><div style="margin-bottom: 1em;">If you need to authenticate or authorize your user to access a web resource, you will need to use one of the <em>Connections:</em></div>
<ul>
 	<li>HTTP</li>
 	<li>OAuth</li>
</ul>
<img loading="lazy" decoding="async" class="wp-image-4078 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png" alt="ZappySys XML Driver - HTTP and OAuth Connection Types" width="577" height="302" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252.png 577w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-powerpack-authentication-authorization-e1529337108252-300x157.png 300w" sizes="(max-width: 577px) 100vw, 577px" />
<h3>HTTP Connection</h3>
<div style="margin-bottom: 1em;">Use <em>HTTP Connection</em> for simple Windows, Basic, NTLM or Kerberos authentication. Just fill in a username and a password and you are good to go!</div>
<div style="margin-bottom: 1em;">You can also use <em>HTTP Connection</em> for more sophisticated authentication like:</div>
<ul>
 	<li><strong>SOAP WSS</strong> (when accessing a SOAP WebService)</li>
 	<li><strong>Static Token / API Key</strong> (when need to pass an API key in HTTP header)</li>
 	<li><strong>Dynamic Token</strong> (same as Static Token method except that each time you need to log in and retrieve a fresh API key)</li>
 	<li><strong>JWT Token</strong> (As per RFC 7519)</li>
</ul>
<img loading="lazy" decoding="async" class="alignnone wp-image-4091 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-1.png" alt="" width="622" height="570" />
<h3>OAuth</h3>
If you are trying to access REST API resource, it is a huge chance, you will need to use <em>OAuth Connection</em>. <a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">Read this article</a> to understand how OAuth authentication and authorization works and how to use it (article originally was written for <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>, but the concepts and UI stay the same): <br/>
<a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/" target="_blank" rel="noopener">https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/</a>
<img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-api-connection-type-2.png" width="721" height="708" /></div>
<div class="content_block" id="custom_post_widget-3901">There are few settings you can coder while calling Web API
<h3><strong>API Limit / Throttling</strong></h3>
While calling public API or other external web services one important aspect you have to check,  how many requests are allowed by your API. Especially when you use API pagination options to pull many records you have to slow down based on API limits. For example, your API may allow you only 5 requests per second. Use Throttling Tab on Driver UI to set delay after each request.
<h3><strong>2D Array Transformation</strong></h3>
If you are using JSON or XML API Driver then possible you may have to transform your data using 2D array transformation feature. <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Check this link</a> for more information.

&nbsp;</div>
<h2>Import data into Power BI from SQL Query</h2>
<p>If you prefer to import data from an SQL query instead of selecting a table name, you can leverage advanced options during the import steps. Here&#8217;s a step-by-step guide:</p>
<ol>
<li>After selecting the DSN, proceed to the import steps.</li>
<li>Click on the &#8220;Advanced Options&#8221; to access the SQL Query editor.</li>
</ol>
<p>By utilizing these advanced options, you gain the flexibility to tailor your import process by specifying custom SQL queries to retrieve the exact data you need.</p>
<div id="attachment_3120" style="width: 395px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3120" class="size-full wp-image-3120" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png" alt="Import data into Power BI using SQL Query (ODBC Data source)" width="385" height="316" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source.png 385w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-rest-api-sql-query-odbc-data-source-300x246.png 300w" sizes="(max-width: 385px) 100vw, 385px" /></a><p id="caption-attachment-3120" class="wp-caption-text">Import data into Power BI using SQL Query (ODBC Data source)</p></div>
<h2>Edit Query / Using Parameters in Power BI (Dynamic Query)</h2>
<div class="content_block" id="custom_post_widget-3954">In the real world, many values of your REST / SOAP API call may be coming from Parameters. If that's the case for you can try to edit script manually as below. In below example its calling SQL Query with POST method and passing some parameters. Notice below where paraAPIKey is Power BI Parameter (string type). You can use parameters anywhere in your script just like the normal variable.
<p />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png"><img loading="lazy" decoding="async" class="wp-image-3121 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png" alt="Import REST API in Power BI - Using parameters in SQL Query (Edit code - Advanced Mode)" width="629" height="467" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-import-odbc-sql-query-pass-parameters-dynamically-300x223.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p />
&nbsp;
<pre class="lang:default highlight:0 decode:true">let
    vKey=paraAPIKey,
    Source = Odbc.Query(
"dsn=ZS - OData Customers", 
"SELECT * FROM $ WITH (SRC='http://httpbin.org/post'," 
&amp; "METHOD='POST'," 
&amp; "HEADER='Content-Type:application/json'," 
&amp; "BODY=@'{""CallerId"":1111, ""ApiKey"":""" &amp; vKey &amp; """}')")
in
    Source</pre>
&nbsp;
</div>
<h2>Edit Query Settings after Import</h2>
<p>There will be a time you need to change initial Query after dataset import in Power BI. Not to worry, just follow these steps to edit your SQL.</p>
<div id="attachment_3947" style="width: 829px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3947" class="size-full wp-image-3947" src="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png" alt="Edit Power BI Data Source SQL after SOAP Web Service Import" width="819" height="502" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import.png 819w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/power-bi-edit-data-source-query-after-import-768x471.png 768w" sizes="(max-width: 819px) 100vw, 819px" /></a><p id="caption-attachment-3947" class="wp-caption-text">Edit Power BI Data Source SQL after REST / SOAP Web Service Import</p></div>
<div class="content_block" id="custom_post_widget-7081"><h2>Using DirectQuery Option rather than Import</h2>
So far we have seen how to Import REST API data into Power BI but what if you have too much data and you dont want to import but link it. Power BI Offers very useful feature for this scenario. Its  called <a href="https://docs.microsoft.com/en-us/power-bi/desktop-use-directquery" target="_blank" rel="noopener">DirectQuery</a> Option. In this section we will explore how to use DirectQuery along with ZappySys Drivers.

Out of the box ZappySys Drivers wont work in ODBC Connection Mode so you have to use SQL Server Connection rather than ODBC if you wish to use Live data using DirectQuery option. See below step by step instructions to enable DirectQuery mode in Power BI for REST API data.

Basically we will use <a href="https://zappysys.com/products/odbc-powerpack/data-gateway/">ZappySys Data Gateway</a> its part of ODBC PowerPack. We will then use Linked Server in SQL Server to Link API Service and then we will issue OPENROWSET queries from Power BI to SQL Server and it will then call REST API via ZappySys Data Gateway.
<h3>Step-By-Step</h3>
<ol>
 	<li>First <a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">read this article carefully</a> how to query REST API in SQL Server.</li>
 	<li>Once linked server is configured we are ready to issue API query in Power BI.</li>
 	<li>Click <strong>Get Data</strong> in Power BI, select <strong>SQL Server Database</strong></li>
 	<li>Enter your server name and any database name</li>
 	<li>Select Mode as <strong>DirectQuery</strong></li>
 	<li>Click on <strong>Advanced</strong> and enter query like below (we are assuming you have created JSON Data Source in Data Gateway and defined linked server (Change name below).
<pre>select * from OPENQUERY(YOUR_LINKED_SERVER_NAME,
'SELECT * FROM value WITH( SRC=''https://services.odata.org/V3/Northwind/Northwind.svc/Orders?$format=json''  )'
)</pre>

<div class="wp-caption alignnone">
 <a   href="https://zappysys.com/blog/wp-content/uploads/2019/05/power-bi-directquery-option-import-rest-api.png">
  <img decoding="async" src="https://zappysys.com/blog/wp-content/uploads/2019/05/power-bi-directquery-option-import-rest-api.png"
         alt="DirectQuery option for Power BI (Read REST API Data Example using SQL Server Linked Server and ZappySys Data Gateway)" >
 </a> 
<p class="wp-caption-text">DirectQuery option for Power BI (Read REST API Data Example using SQL Server Linked Server and ZappySys Data Gateway)</p>
</div>

</li>
 	<li>Click OK and Load data ... That's it. Now your REST API data is linked rather than imported.</li>
</ol></div>
<h2>Performance Tips for REST API / XML SOAP Calls</h2>
<div class="content_block" id="custom_post_widget-4455">While calling APIs you may face some performance issues. There are a few tips you can consider to speed up things.
<h4><span style="font-size: 14pt;"><strong>Use Server-side filtering if possible in URL or Body Parameters</strong></span></h4>
Many API supports filtering your data by URL parameters or via Body. Whenever possible try to use such features.  Here is an example of <a href="http://www.odata.org/getting-started/basic-tutorial/" target="_blank" rel="noopener">odata API</a>, In the below query the first query is faster than the second query because in the first query we filter at the server.
<pre class="lang:tsql decode:true">SELECT * FROM value
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json&amp;$filter=Country eq ''USA'''
	,DataFormat='Odata'
)

-- Slow query - Client-side filtering
SELECT * FROM value
WHERE Country ='USA'
WITH(
	 Src='https://services.odata.org/V3/Northwind/Northwind.svc/Customers?$format=json'
	,DataFormat='Odata'
)</pre>
<h4><span style="font-size: 14pt;"><strong>Avoid Special features in SQL Query (e.g. WHERE, Group By, Order By)</strong></span></h4>
ZappySys API engine triggers client-side processing if special features are used in Query. Following SQL Features will trigger Client-Side processing which is several times slower than server-side processing. So always try to use simple query (Select col1, col2 .... from mytable )
<ul>
 	<li>WHERE Clause</li>
 	<li>GROUP BY Clause</li>
 	<li>HAVING Clause</li>
 	<li>ORDER BY</li>
 	<li>FUNCTIONS (e.g. Math, String, DateTime, Regex... )</li>
</ul>
LIMIT clause does not trigger client-side processing.
<h4><span style="font-size: 14pt;"><strong>Consider using pre-generated Metadata / Cache File</strong></span></h4>
Use META option in WITH Clause to use static metadata (Pre-Generated)There are two more options to speedup query processing time. Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details.
<ol>
 	<li>
<pre class="lang:default decode:true">select * from value WITH( meta='c:\temp\meta.txt' )
--OR--
select * from value WITH( meta='my-meta-name' )
--OR--
select * from value WITH( meta='[ {"Name": "col1",&amp;nbsp;"Type": "String", Length: 100},&amp;nbsp;{"Name": "col2",&amp;nbsp;"Type": "Int32"} ...... ]' )</pre>
</li>
 	<li>Enable Data Caching Options (Found on <strong>Property Grid</strong> &gt; <strong>Advanced</strong> Mode Only )</li>
</ol>
<h4><span style="font-size: 14pt;"><strong>Consider using Metadata / Data Caching Option</strong></span></h4>
ZappySys API drivers support Caching Metadata and Data rows to speed up query processing. If your data doesn't change often then you can enable this option to speed up processing significantly.

Check <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/" target="_blank" rel="noopener">this article</a> for details how to enable Data cache / metadata cache feature for datasource level or query level.

To define cache option at query level you can use like below.
<pre class="">SELECT * FROM $
WITH 
(  SRC='https://myhost.com/some-api'
  ,CachingMode='All'  --cache metadata and data rows both
  ,CacheStorage='File' --or Memory
  ,CacheFileLocation='c:\temp\myquery.cache'
  ,CacheEntryTtl=300 --cache for 300 seconds
)
</pre>
&nbsp;

&nbsp;
<h4><strong><span style="font-size: 14pt;">Use --FAST Option to enable Stream Mode</span></strong></h4>
ZappySys JSON / XML drivers support <strong>--FAST</strong> suffix for Filter. By using this suffix after Filter driver enables Stream Mode, <a href="https://zappysys.com/blog/caching-metadata-odbc-drivers-performance/#Reading_Large_Files_Streaming_Mode_for_XML_JSON" target="_blank" rel="noopener">Read this article</a> to understand how this works.
<pre class="lang:default decode:true">SELECT * FROM $ 
LIMIT 10 --//add this just to test how fast you can get 10 rows
WITH(
  Filter='$.LargeArray[*]--FAST' --//Adding --FAST option turn on STREAM mode (large files)
 ,SRC='https://zappysys.com/downloads/files/test/large_file_100k_largearray_prop.json.gz'
 --,SRC='c:\data\large_file.json.gz'
 ,IncludeParentColumns='False'  --//This Must be OFF for STREAM mode (read very large files)
 ,FileCompressionType='GZip' --Zip or None (Zip format only available for Local files)
)</pre>
&nbsp;</div>
<div class="content_block" id="custom_post_widget-5891"><h2>Working with Gateways in Power BI (Schedule Import)</h2>
If the data needs to be updated, it is necessary to create a gateway on-premises. In this new section, we will install a Power BI Gateway and in the next section schedule it to update the REST API information.
<ol>
 	<li>In the last section, we Published the report. Power BI may ask you to <strong>SIGN IN.</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png"><img loading="lazy" decoding="async" class="size-full wp-image-2879" src="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png" alt="Sign in Power BI" width="762" height="361" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi.png 762w, https://zappysys.com/blog/wp-content/uploads/2018/03/sign-in-power-bi-300x142.png 300w" sizes="(max-width: 762px) 100vw, 762px" /></a>
<p class="wp-caption-text">Sign in in Power BI</p>

</div></li>
 	<li>Select the Workspace and select Datasets
<div class="wp-caption">

[caption id="attachment_10110" align="alignnone" width="702"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png"><img loading="lazy" decoding="async" class="wp-image-10110 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png" alt="power-bi-my-workspace-dataset" width="702" height="372" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset.png 702w, https://zappysys.com/blog/wp-content/uploads/2019/01/power-bi-my-workspace-dataset-300x159.png 300w" sizes="(max-width: 702px) 100vw, 702px" /></a> Go to workspace and dataset[/caption]
<p class="wp-caption-text">Go to workspace and dataset</p>

</div></li>
 	<li>Right-click the report and select <strong>Settings</strong>.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png"><img loading="lazy" decoding="async" class="size-full wp-image-2877" src="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png" alt="Define settings for Power BI report" width="535" height="325" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings.png 535w, https://zappysys.com/blog/wp-content/uploads/2018/03/report-power-bi-settings-300x182.png 300w" sizes="(max-width: 535px) 100vw, 535px" /></a>
<p class="wp-caption-text">Specify settings for the report</p>

</div></li>
 	<li>The system will ask for a Gateway. Stay here.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2862" src="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png" alt="add power bi gateway" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/add-power-bi-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Add Power BI Gateway</p>

</div></li>
 	<li>Use the following link to install a Data Gateway:
<pre class="lang:php highlight:0 decode:true">https://docs.microsoft.com/en-us/power-bi/service-gateway-onprem</pre>
</li>
 	<li>Run the installer and press <strong>Next</strong>
<div class="wp-caption">

<img loading="lazy" decoding="async" class="size-full wp-image-2888" src="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png" alt="Initial gateway window for installation" width="634" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB.png 634w, https://zappysys.com/blog/wp-content/uploads/2018/03/on-premises-gateway-installer-PB-300x238.png 300w" sizes="(max-width: 634px) 100vw, 634px" />
<p class="wp-caption-text">Gateway installer</p>

</div></li>
 	<li>Select the option On-premises data gateway (recommended). This option allows access to multiple users and can be used by more applications than Power BI.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png"><img loading="lazy" decoding="async" class="size-full wp-image-2889" src="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png" alt="Choose Power BI gateway" width="631" height="501" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb.png 631w, https://zappysys.com/blog/wp-content/uploads/2018/03/choose-power-bi-on-premises-data-pb-300x238.png 300w" sizes="(max-width: 631px) 100vw, 631px" /></a>
<p class="wp-caption-text">Choose Power BI option</p>

</div></li>
 	<li>The installer will show a warning message.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png"><img loading="lazy" decoding="async" class="size-full wp-image-2891" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png" alt="Warning message gateway installation" width="628" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg.png 628w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-warning-PB-msg-300x214.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a>
<p class="wp-caption-text">Warning message during installation</p>

</div></li>
 	<li>Select the path to install and check the I accept the terms.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png"><img loading="lazy" decoding="async" class="size-full wp-image-2916" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png" alt="accept terms" width="636" height="441" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept.png 636w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-accept-300x208.png 300w" sizes="(max-width: 636px) 100vw, 636px" /></a>
<p class="wp-caption-text">Accept terms</p>

</div></li>
 	<li>Specify the email address to use the gateway.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png"><img loading="lazy" decoding="async" class="size-full wp-image-2895" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png" alt="Register email in gateway installation" width="627" height="578" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-installation-email-address-300x277.png 300w" sizes="(max-width: 627px) 100vw, 627px" /></a>
<p class="wp-caption-text">Register email address</p>

</div></li>
 	<li>After entering the email, write the gateway name and a recovery key. Make sure to confirm the recovery key.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png"><img loading="lazy" decoding="async" class="size-full wp-image-2896" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png" alt="Specify name and recovery key" width="629" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm.png 629w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-gateway-name-recovery-key-confirm-300x232.png 300w" sizes="(max-width: 629px) 100vw, 629px" /></a>
<p class="wp-caption-text">Enter recovery key</p>

</div></li>
</ol>
&nbsp;</div>
<div class="content_block" id="custom_post_widget-5892"><h2>Manage gateways and configure the schedule</h2>
Once that the gateway is installed we will configure it and add the connection strings.
<ol>
 	<li>The next step is to go to manage gateway
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png"><img loading="lazy" decoding="async" class="size-full wp-image-2912" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png" alt="Power BI - Manage Gateway Setting" width="1068" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway.png 1068w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-768x273.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-go-to-manage-gateway-1024x364.png 1024w" sizes="(max-width: 1068px) 100vw, 1068px" /></a>
<p class="wp-caption-text">Power BI - Manage Gateway Setting</p>

</div></li>
 	<li>In order to get the connection string, we will need the connection string of the ZappySys JSON Driver. In the first section of this post, we explained how to configure it. Press<strong> Copy Connection String</strong>
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png"><img loading="lazy" decoding="async" class="size-full wp-image-2866" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png" alt="ZappySys connection properties" width="607" height="599" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string.png 607w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-data-source-copy-connection-string-300x296.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></a>
<p class="wp-caption-text">Connection properties</p>

</div></li>
 	<li>Once that the data is copied, add a New data Source. In <strong>Data Source Name</strong>, enter the Data Source Name of the ZappySys JSON driver in step 13 and in Data Source Type, select ODBC. In connection string copy and paste from the clipboard of the step 13 and press <strong>Add</strong>.
<div class="wp-caption">

[caption id="attachment_10113" align="alignnone" width="720"]<a href="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png"><img loading="lazy" decoding="async" class="wp-image-10113 size-large" src="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png" alt="gateway-data-source-name-connection-string" width="720" height="377" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-1024x536.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-300x157.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string-768x402.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/01/gateway-data-source-name-connection-string.png 1043w" sizes="(max-width: 720px) 100vw, 720px" /></a> ZappySys connection properties in Power BI[/caption]
<p class="wp-caption-text">ZappySys connection properties in Power BI</p>

</div></li>
 	<li>Once added the gateway. You can see the schedule refresh to <strong>On </strong>and Add another time to add the time where you want to refresh the data.
<div class="wp-caption">

<a href="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png"><img loading="lazy" decoding="async" class="size-full wp-image-2875" src="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png" alt="Schedule gateway" width="451" height="401" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule.png 451w, https://zappysys.com/blog/wp-content/uploads/2018/03/power-bi-schedule-300x267.png 300w" sizes="(max-width: 451px) 100vw, 451px" /></a>
<p class="wp-caption-text">Schedule gateway</p>

</div></li>
</ol>
&nbsp;</div>
<h2>Conclusion</h2>
<p>In this article, we guide you through the process of configuring the ZappySys Power Pack, focusing on the ZappySys driver for JSON. This driver is instrumental in extracting data from REST APIs or JSON files. Follow these steps to seamlessly add the extracted data to Power BI and generate insightful reports.</p>
<p>Additionally, we&#8217;ll walk you through the configuration of the Power BI gateway, ensuring that the data is refreshed on a specified schedule for up-to-date and accurate reporting. To try this configuration yourself, <a href="//zappysys.com/products/odbc-powerpack/download/">download ODBC PowerPack</a> and embark on a journey of efficient data extraction and reporting.</p>
<h2>References</h2>
<ul>
<li><a href="https://powerbi.microsoft.com/en-us/">What is Power BI?</a></li>
<li><a href="https://powerbi.microsoft.com/en-us/gateway/">Keep your dashboards and reports up-to-date with your on-premises data sources</a></li>
<li><a href="https://www.youtube.com/watch?v=PL7wffKeOrc">Power BI &#8211; Read REST API / JSON File / XML File / SOAP (Pagination, OAuth, OData)</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/">How to import REST API in Power BI (Load JSON / SOAP XML)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to convert JSON to CSV File using SSIS</title>
		<link>https://zappysys.com/blog/convert-json-to-csv-file-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 14 Feb 2018 16:52:37 +0000</pubDate>
				<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[json source]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2626</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn how to convert JSON to CSV File using SSIS. Sometimes you need to convert JSON file to a CSV, which resides in your local disk or somewhere on the Internet, be it a simple download link or a more sophisticated API call. Using ZappySys SSIS PowerPack together with [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/convert-json-to-csv-file-using-ssis/">How to convert JSON to CSV File using SSIS</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 convert JSON to CSV File using <a href="https://docs.microsoft.com/en-us/sql/integration-services/sql-server-integration-services" target="_blank" rel="noopener">SSIS</a>. Sometimes you need to convert JSON file to a CSV, which resides in your local disk or somewhere on the Internet, be it a simple download link or a more sophisticated API call. Using <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> together with SSIS will make it easy to happen.</p>
<p>We will be using this <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> component to make things work:</p>
<div class="su-table su-table-alternate">
<table width="300">
<tbody>
<tr style="line-height: 0px">
<td width="50px"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3074" src="https://zappysys.com/blog/wp-content/uploads/2016/01/SSIS-Json-Source-Adapter.png" alt="" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source (REST API or File)</a></td>
</tr>
</tbody>
</table>
</div>
<h2>Prerequisites</h2>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li><a href="https://zappysys.com/Links/?id=ssis_powerpack_getfile64&amp;src=email" target="_blank" rel="noopener"><em>ZappySys SSIS PowerPack</em> installed</a>.</li>
</ol>
<h2><span id="Step-by-Step_Bulk_loading_data_from_SQL_Serverto_Elasticsearch_with_SSIS">Step-by-Step – Export JSON to CSV File with SSIS</span></h2>
<ol>
<li>From SSIS Toolbox drag and drop <em>Data Flow</em> into the <em>Control Flow</em>.</li>
<li>Then drag and drop <em>JSON Source (REST API or File)</em> into the <em>Data Flow</em>.</li>
<li>Open <em>JSON Source</em> component for modifications.</li>
<li>Load JSON directly, from variable or URL:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-using-ssis.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3069 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-using-ssis-e1521124289364.png" alt="Convert JSON to CSV File using SSIS" width="615" height="679" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-using-ssis-e1521124289364.png 615w, https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-using-ssis-e1521124289364-272x300.png 272w" sizes="(max-width: 615px) 100vw, 615px" /></a></li>
<li>Use JSONPath Expression in <em>Filter</em> section to select the data you need. We will use <pre class="crayon-plain-tag">$.store.book[*]</pre> to extract all books from JSON array. Check <a href="https://zappysys.com/blog/jsonpath-examples-expression-cheetsheet/" target="_blank" rel="noopener">Understanding JSONPath Expression with Examples</a> article to see more examples how this filter works.</li>
<li>Close the window.</li>
<li>Drag and drop <em>Flat File Destination</em> into <em>Data Flow</em> and connect it to <em>JSON Source</em>:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-with-json-source-powerpack-component.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2792" src="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-with-json-source-powerpack-component.png" alt="" width="368" height="180" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-with-json-source-powerpack-component.png 368w, https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-with-json-source-powerpack-component-300x147.png 300w" sizes="(max-width: 368px) 100vw, 368px" /></a></li>
<li>Open <em>Flat File Destination</em> for configuration, configure it and map <em>JSON Source</em> columns with <em>Flat File Destination</em> columns.</li>
<li>You are done! JSON will be exported to a CSV (<a href="#Download_a_sample_package">download a sample package</a>).</li>
</ol>
<h2>Using API as JSON source</h2>
<p>If your JSON happens to reside in a response of an API call which uses OAuth authentication, read this article how to configure <em>JSON Source</em> OAuth connection:</p>
<blockquote class="wp-embedded-content" data-secret="ctlfkm5qd2"><p><a href="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/">How to authenticate to an API with OAuth 2.0 using SSIS</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/rest-api-authentication-with-oauth-2-0-using-ssis/embed/#?secret=ctlfkm5qd2" data-secret="ctlfkm5qd2" width="600" height="338" title="&#8220;How to authenticate to an API with OAuth 2.0 using SSIS&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<h2>Exporting multiple JSON arrays to a CSV</h2>
<p>There may be a need to export two or more JSON arrays to several CSVs. In that case, you might be interested in this article:</p>
<div class="crayon-toolbar" data-settings=" mouseover overlay hide delay">
<div class="crayon-tools">
<div class="crayon-button crayon-plain-button" title="Toggle Plain Code">
<blockquote class="wp-embedded-content" data-secret="Gvu8PBCSK9"><p><a href="https://zappysys.com/blog/extract-read-multiple-arrays-from-json-data-file-rest-api-response/">Reading JSON Arrays from file / REST API</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/extract-read-multiple-arrays-from-json-data-file-rest-api-response/embed/#?secret=Gvu8PBCSK9" data-secret="Gvu8PBCSK9" width="600" height="338" title="&#8220;Reading JSON Arrays from file / REST API&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<h2 class="crayon-button-icon">Transforming JSON array</h2>
<p>Another use case you may encounter is when row values are placed in a JSON array. And then you desperately want to transform that array so that you could see those values in separate columns:</p>
<div id="attachment_3063" style="width: 745px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-ssis-export-json-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3063" class="wp-image-3063 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-ssis-export-json-source-e1521123257233.png" alt="Convert JSON to CSV File using SSIS: JSON array appears as one column" width="735" height="733" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-ssis-export-json-source-e1521123257233.png 735w, https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-ssis-export-json-source-e1521123257233-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/02/convert-json-to-csv-ssis-export-json-source-e1521123257233-300x300.png 300w" sizes="(max-width: 735px) 100vw, 735px" /></a><p id="caption-attachment-3063" class="wp-caption-text">Convert JSON to CSV File: JSON array appears as one column</p></div>
<p><span id="Pattern_1_8211_JSON_Array_using_Simple_Transformation_Column_names_found_in_JSON">This would require to make a <em>Simple Transformation</em> on source JSON:</span></p>
</div>
<div class="crayon-button crayon-wrap-button" title="Toggle Line Wrap">
<div class="crayon-button-icon">
<div id="crayon-5a9d54c5ce278640066629-1" class="crayon-line">
<div id="attachment_3068" style="width: 705px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-ssis-transform-json-array.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3068" class="wp-image-3068 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-ssis-transform-json-array-e1521123377163.png" alt="Convert JSON to CSV File using SSIS: Transforming JSON array values into columns" width="695" height="530" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-ssis-transform-json-array-e1521123377163.png 695w, https://zappysys.com/blog/wp-content/uploads/2018/02/export-json-to-csv-ssis-transform-json-array-e1521123377163-300x229.png 300w" sizes="(max-width: 695px) 100vw, 695px" /></a><p id="caption-attachment-3068" class="wp-caption-text">Convert JSON to CSV File : Transforming JSON array values into columns</p></div>
<p>We also support transforming other formats of JSON arrays. Check how to transform them all in the article <a href="https://zappysys.com/blog/parse-multi-dimensional-json-array-ssis/" target="_blank" rel="noopener">Parse multi-dimensional JSON array in SSIS</a>.</p>
<h2>Common Errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime, it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2>Deployment to Production</h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
</div>
</div>
</div>
</div>
</div>
<h2 class="crayon-button-icon">Download a sample package</h2>
<p>Be sure to download a <a href="https://zappysys.com/blog/wp-content/uploads/2018/02/Convert-JSON-to-CSV-using-SSIS.zip">sample SQL Server 2012 SSIS package</a> in case you want to try it right away.</p>
<h2 class="crayon-button-icon">Conclusion</h2>
<p>In this article we learned how to convert JSON to a CSV using <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS PowerPack JSON Source</a> in a very simple way. We also touched topics that delve into more complicated scenarios such as grabbing JSON from an API, exporting multiple JSON arrays and transforming them into columns. Check our <a href="https://zappysys.com/blog/category/ssis/components/ssis-json-source/">Blog articles on JSON Source</a> to find out what <em>JSON Source</em> is capable of more.</p>
<p>The post <a href="https://zappysys.com/blog/convert-json-to-csv-file-using-ssis/">How to convert JSON to CSV File using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Loading data from SQL Server to Amazon S3 in SSIS (Split Files, GZip)</title>
		<link>https://zappysys.com/blog/load-data-sql-server-to-amazon-s3/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 27 Jul 2016 22:07:34 +0000</pubDate>
				<category><![CDATA[SSIS Amazon S3 CSV Dest]]></category>
		<category><![CDATA[SSIS Amazon Storage Task]]></category>
		<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Amazon S3 Task]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[export]]></category>
		<category><![CDATA[Export CSV Task]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=704</guid>

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

					<description><![CDATA[<p>Limitations of the SSIS Excel Source/Destination SSIS comes with out-of-the-box support for reading and writing to Excel. However, it&#8217;s very restrictive if you want to make things dynamic, as any metadata inside DataFlow cannot be changed at runtime. Here are a few problems with using the native Excel Source or Destination. Metadata cannot be changed [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-export-to-excel-dynamically/">SSIS export to excel dynamically (supports multiple tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Limitations of the SSIS Excel Source/Destination</h2>
<p>SSIS comes with out-of-the-box support for reading and writing to Excel. However, it&#8217;s very restrictive if you want to make things dynamic, as any metadata inside DataFlow cannot be changed at runtime. Here are a few problems with using the native Excel Source or Destination.</p>
<ul>
<li>Metadata cannot be changed at runtime.</li>
<li>Datatype guessing nightmare &#8211; only the first few rows are scanned, and the wrong datatype is selected.</li>
<li>Cannot export multiple tables to Excel.</li>
<li>Cannot split data into multiple tabs based on specific grouping criteria</li>
<li>Cannot specify the location where data has to be written</li>
</ul>
<h2>SSIS export to Excel dynamically using Excel Export Task</h2>
<p>If you want to generate Excel dynamically without any of the above hassle, then you can check the <a target="_blank" rel="noopener">SSIS Excel Export Task</a>. It comes with many advantages not found in the native <a href="https://docs.microsoft.com/en-us/sql/integration-services/data-flow/excel-destination" target="_blank" rel="noopener">Microsoft SSIS Excel Destination</a></p>
<p>Here is the list of a few features for the <a href="//zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/">SSIS Excel Export Task</a></p>
<ul>
<li>Export multiple tables/views to Excel files (e.g., Sales% or do SalesJan|SalesFeb).</li>
<li>Support for all major office versions (e.g, Office 2003, 2007, 2013+).</li>
<li>Export SQL query output to an Excel file.</li>
<li>A completely dynamic approach without limitations on DataFlow Strict Metadata.</li>
<li>Option to export data to a specific starting location in an Excel Sheet (e.g, A5 will start writing to the  5th row, 1st column).</li>
<li>Support for a password-protected Excel file.</li>
<li>Option to clear a range of cells before writing data to an existing Excel workbook (e.g., A1:D5000 will clear A to D columns from 1st to 5000 rows).</li>
<li>Automatically Split exported Excel data into multiple files by Size or Number of records.</li>
<li>Automatically Split exported Excel data into multiple files or tabs when Split By Column (e.g., SplitBy=Country will create a new file for each country). If the SplitOnTab option is specified, then data is written to a new Excel tab rather than a file for each new group.</li>
<li>Support for Compression and Append.</li>
<li>Fully managed means it works out of the box on both 32-bit and 64-bit systems without any changes (Note that Native SSIS Excel functionality is 32-bit only).</li>
<li>Support for SQL Server 2005, 2008, 2012, 2014 (32-bit and 64-bit).</li>
</ul>
<h3><span id="Step-By-Step">Step-By-Step</span></h3>
<div id="attachment_11544" style="width: 733px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Task-Generate-Excel-files-for-selected-tables-views.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11544" class="size-full wp-image-11544" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Task-Generate-Excel-files-for-selected-tables-views.png" alt="" width="723" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Task-Generate-Excel-files-for-selected-tables-views.png 723w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Task-Generate-Excel-files-for-selected-tables-views-300x263.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11544" class="wp-caption-text">SSIS Export to Excel File – Generate Excel files for selected tables/views</p></div>
<div class="mceTemp"></div>
<div id="attachment_11543" style="width: 733px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Select-Target-Path-and-other-options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11543" class="size-full wp-image-11543" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Select-Target-Path-and-other-options.png" alt="" width="723" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Select-Target-Path-and-other-options.png 723w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Select-Target-Path-and-other-options-300x263.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11543" class="wp-caption-text">SSIS Export to Excel File &#8211; Generate Excel files for selected tables/views</p></div>
<div id="attachment_11545" style="width: 733px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Split-Excel-Data-into-Multiple-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11545" class="size-full wp-image-11545" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Split-Excel-Data-into-Multiple-files.png" alt="" width="723" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Split-Excel-Data-into-Multiple-files.png 723w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-to-Excel-File-Split-Excel-Data-into-Multiple-files-300x263.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11545" class="wp-caption-text">SSIS Export to Excel File &#8211; Split Excel Data into Multiple Files</p></div>
<div class="mceTemp"></div>
<div id="attachment_11542" style="width: 733px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Split-Excel-Data-into-Multiple-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11542" class="size-full wp-image-11542" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Split-Excel-Data-into-Multiple-files.png" alt="" width="723" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Split-Excel-Data-into-Multiple-files.png 723w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Split-Excel-Data-into-Multiple-files-300x263.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11542" class="wp-caption-text">SSIS Export to Excel File &#8211; Split Excel Data into Multiple sheets</p></div>
<div class="mceTemp"></div>
<div class="mceTemp"></div>
<div id="attachment_11540" style="width: 733px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Excel-Date-Formatting-Encoding-Options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11540" class="size-full wp-image-11540" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Excel-Date-Formatting-Encoding-Options.png" alt="" width="723" height="635" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Excel-Date-Formatting-Encoding-Options.png 723w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Excel-Date-Formatting-Encoding-Options-300x263.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11540" class="wp-caption-text">SSIS Export to Excel File &#8211; Date Formatting, Encoding Options</p></div>
<div class="mceTemp"></div>
<div id="attachment_11541" style="width: 1040px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11541" class="size-full wp-image-11541" src="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log.png" alt="" width="1030" height="449" srcset="https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log.png 1030w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log-300x131.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log-1024x446.png 1024w, https://zappysys.com/blog/wp-content/uploads/2015/10/SSIS-Export-Excel-File-Task-Execution-Log-768x335.png 768w" sizes="(max-width: 1030px) 100vw, 1030px" /></a><p id="caption-attachment-11541" class="wp-caption-text">SSIS Export to Excel File &#8211; Execution Log</p></div>
<h2>Conclusion</h2>
<p>In this post, we have seen how Excel generation can be a headache when you have dynamic metadata. You can use the <a href="//zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/">SSIS Excel Export Task</a> to solve many of these challenges.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-export-to-excel-dynamically/">SSIS export to excel dynamically (supports multiple tables)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
