<?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>SSIS Logging Task Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/tasks/ssis-logging-task/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/tasks/ssis-logging-task/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Tue, 05 Sep 2023 06:48:29 +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>SSIS Logging Task Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/tasks/ssis-logging-task/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</title>
		<link>https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 26 May 2020 20:11:33 +0000</pubDate>
				<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Regex Parser Task]]></category>
		<category><![CDATA[audit]]></category>
		<category><![CDATA[EventHandler]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8928</guid>

					<description><![CDATA[<p>Introduction In our last post (Regex Cheat Sheet) we explained use cases of SSIS Regular Expression Parser Task . Now lets look at some real world usecase. Basically in this article we are going to Extract data from audit log using SSIS. For demo purpose we will use log generated by SSIS Export CSV File Task output. When [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/">Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/" target="_blank" rel="noopener">last post</a> (Regex Cheat Sheet) we explained use cases of <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regular Expression Parser Task</a> . Now lets look at some real world usecase. Basically in this article we are going to Extract data from audit log using SSIS. For demo purpose we will use log generated by <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">SSIS Export CSV File Task output</a>. When you export many tables dynamically using this task you want to know how many Row count exported for each Table. This information is logged in SSIS Output Log but no easy way to capture in SSIS variable. So what we will do we will use few tricks to capture that data using Regular Expression usecase.</p>
<p>So let&#8217;s get started.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Setup Export CSV Task (Output Multiple Tables to CSV Files Dynamically)</h2>
<p>For example purpose we will use Export CSV File Task but you can use this technique for any other Tasks.</p>
<ol>
<li>Drag and Drop ZS Export CSV Task from SSIS Toolbox and configure as below.<br />
<img decoding="async" class="figureimage" title="SSIS Export to CSV File Task - Drag and Drop" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-csv-file-task/ssis-export-csv-file-task-drag.png" alt="SSIS Export to CSV File Task - Drag and Drop" /></li>
<li>  Configure Export CSV Task to output multiple tables <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/export-csv-file-task.htm" target="_blank" rel="noopener">as explained here</a></li>
<li>Now create 2 SSIS User Variables
<ol>
<li><strong>FilePath</strong> (String Type)</li>
<li><strong>RowCount</strong> (String Type)</li>
</ol>
</li>
</ol>
<p>That&#8217;s it&#8230; now in the next section we will setup event handler to capture output from Log.</p>
<h2>Setup EventHandle / Extract Audit Data using Regex</h2>
<ol>
<li>Now select task and click <strong>Event Handler tab</strong></li>
<li>Select <strong>Executable Name</strong> from the dropdown, Select Event Name <strong>OnInformation</strong> from Handler Dropdown</li>
<li>Click Create Hyper Link to Create Event Handler like below
<div id="attachment_8929" style="width: 665px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png"><img decoding="async" aria-describedby="caption-attachment-8929" class="size-full wp-image-8929" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png" alt="Create Task Level Event Handler in SSIS" width="655" height="260" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler.png 655w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-create-eventhandler-300x119.png 300w" sizes="(max-width: 655px) 100vw, 655px" /></a><p id="caption-attachment-8929" class="wp-caption-text">Create Task Level Event Handler in SSIS</p></div></li>
<li>Now Drag below 3 tasks and connect like this
<ol>
<li>Script Task (We will use as dummy start (No configuration needed)</li>
<li>ZS Regular Expression Parser Task</li>
<li>ZS Logging Task (Optional) but we will use to Output Extracted Values<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-8930" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png" alt="" width="828" height="490" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information-300x178.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-eventhandler-extract-audit-information-768x454.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a></li>
</ol>
</li>
<li>Connect Dummy Script Task to ZS Regular Expression Parser Task and Right click on Green connected Arrow and Use Expression as below. Click OK to save</li>
<li>Configure ZS Regular Expression Parser Task as below
<ol>
<li>Enter <pre class="crayon-plain-tag">{{System::ErrorDescription}}</pre>  as Direct Value</li>
<li>Enter Below two mappings
<ol>
<li>For RowCount set<br />
<pre class="crayon-plain-tag">Total (\d+) records written to : (.*){{1,1}}</pre>
</li>
<li>For FilePath set<br />
<pre class="crayon-plain-tag">Total (\d+) records written to : (.*){{1,2}}</pre>
</li>
</ol>
</li>
</ol>
</li>
<li>Here is how it will look like
<div id="attachment_8932" style="width: 912px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8932" class="wp-image-8932 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png" alt="Extract data from audit log using SSIS Regular Expression Parser Task" width="902" height="838" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data.png 902w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data-300x279.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-regular-expression-extract-audit-log-data-768x714.png 768w" sizes="(max-width: 902px) 100vw, 902px" /></a><p id="caption-attachment-8932" class="wp-caption-text">Extract data from audit log using SSIS Regular Expression Parser Task</p></div></li>
<li>Thats it&#8230; Now connect 2nd step to last Logging Task&#8230;. in that Task you can set Text like below just to log extracted data. You can also use Execute SQL Task to log into Database Table<br />
<pre class="crayon-plain-tag">{{User::FilePath}} ===&gt; {{User::RowCount}}</pre>
</li>
<li>Now run Package and you will see audit data we extracted for each file. Once File is exported we capture OnInformation event&#8230; and if Message contains substring like &#8220;records written to&#8221; then we extract data into variable for Row Count and Path then you can save to desired place for auditing purpose<a href="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-8931" src="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png" alt="" width="656" height="163" srcset="https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information.png 656w, https://zappysys.com/blog/wp-content/uploads/2020/05/ssis-log-extracted-audit-information-300x75.png 300w" sizes="(max-width: 656px) 100vw, 656px" /></a></li>
</ol>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/extract-audit-data-ssis-execution-log-eventhandler-regular-expression/">Extract audit data from SSIS Execution Log (EventHandler and Regular Expression)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read PayPal API data in SSIS</title>
		<link>https://zappysys.com/blog/read-paypal-api-data-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 24 Aug 2019 08:36:05 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[oauth2]]></category>
		<category><![CDATA[paypal]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7822</guid>

					<description><![CDATA[<p>Introduction In this article, we will see how to read PayPal API data in SSIS and load into SQL Server. This blog mainly focuses on SSIS approach but steps mentioned to call PayPal APIs can be useful for any developer regardless of which programming language or tool set you use. We will also see How to send [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-paypal-api-data-ssis/">How to read PayPal API data in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-logo-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignleft wp-image-7825 size-thumbnail" title="PayPal" src="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-logo-preview-150x150.png" alt="PayPal" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-logo-preview-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-logo-preview-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-logo-preview.png 512w" sizes="(max-width: 150px) 100vw, 150px" /></a>In this article, we will see how to read PayPal API data in SSIS and load into SQL Server. This blog mainly focuses on SSIS approach but steps mentioned to call PayPal APIs can be useful for any developer regardless of which programming language or tool set you use. We will also see How to send basic Authorization header along with body in OAuth2.</p>
<p>We will go through the steps to read data from PayPal Transactions and Load into MS SQL Server.</p>
<p>In nutshell, this post will focus on how to make PayPal API Call using SSIS.</p>
<p>&nbsp;</p>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:</p>
<ol>
<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>).</li>
<li>Credentials of PayPal API. Click <a href="https://developer.paypal.com/developer/applications/" target="_blank" rel="noopener">here</a> to create API.</li>
</ol>
<h2><span id="What_is_Walmart"><span id="What_is_WordPress">What is PayPal?</span></span></h2>
<p><a href="https://www.paypal.com" target="_blank" rel="noopener">PayPal</a> is an American company operating a worldwide online payments system that supports online money transfers and serves as an electronic alternative to traditional paper methods like checks and money orders. The company operates as a payment processor for online vendors, auction sites, and many other commercial users, for which it charges a fee in exchange for benefits such as one-click transactions and password memory. PayPal&#8217;s payment system, also called PayPal, is considered a type of payment rail.</p>
<h2 class="dx-content-title">Get Started with PayPal API</h2>
<p>If you have need to automate PayPal operations (e.g. read / write / update / delete ) then you can use PayPal REST API. Before you can integrate a PayPal product or solution, you must set up your development environment to get OAuth 2.0 client ID and secret credentials for the sandbox and live environments. You exchange these credentials for an access token that authorizes your REST API calls. To test your web and mobile apps, you create sandbox accounts.</p>
<h3 id="get-credentials" class="dx-anchor">Get PayPal credentials</h3>
<p>To generate OAuth 2.0 credentials for the sandbox and live environments:</p>
<ol>
<li><a href="https://www.paypal.com/signin?returnUri=https%3A%2F%2Fdeveloper.paypal.com%2Fdeveloper%2Fapplications" target="_blank" rel="noopener"><strong>Log into Dashboard</strong></a> and type your PayPal personal or business account email and password.</li>
<li>In the <strong>REST API apps</strong> section, click <strong>Create App</strong>. The purpose of this app is to generate your credentials.</li>
<li>Type a name for your app and click <strong>Create App</strong>. The page shows your sandbox app information, which includes your credentials.<br />
<blockquote class="dx-blockquote-note"><p><strong>Note:</strong> To show your live app information, toggle to <strong>Live</strong>.</p></blockquote>
</li>
<li>Copy and save the client ID and secret for your sandbox app.
<div id="attachment_7837" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-client-ID-and-secret.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7837" class="wp-image-7837 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-client-ID-and-secret-768x443.png" alt="PayPal Client ID and Secret" width="720" height="415" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-client-ID-and-secret-768x443.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-client-ID-and-secret-300x173.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/paypal-client-ID-and-secret.png 940w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7837" class="wp-caption-text">PayPal Client ID and Secret</p></div></li>
<li>Review your app details and save your app.</li>
</ol>
<h2><span id="Read_Walmart_API_Data_using_SSIS_JSON_Source"><span id="Read_data_fromWordPressusing_SSIS_JSON_Source">Read PayPal API Data using SSIS JSON Source</span></span></h2>
<p>Let’s start with an example. We use SSIS JSON Source component to make the call to PayPal API, we will read PayPal data and load into SQL Server. First of All, Open Visual Studio and Create New SSIS Package Project.</p>
<p>In REST API calls, include the URL to the API service for the environment:</p>
<ul class="compact">
<li>Sandbox: <code>https://api.sandbox.paypal.com</code></li>
<li>Live: <code>https://api.paypal.com</code></li>
</ul>
<h3><span id="GetDynamic_Token_Configure_ZS-HTTP_Connection"><span id="Step-1_GetDynamic_Token_Configure_ZS-HTTP_Connection">Create Basic OAuth Client Credentials Grant (Configure ZS-OAuth Connection)</span></span></h3>
<p>To get API response data using SOAP / REST API call, you need to get an API Token from your token request URL. Follow the steps mentioned below to get API Token:</p>
<ol>
<li>Now, Right Click on Connection Managers Window, and one Context menu appears for creating a new connection manager.
<div id="attachment_4382" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-create-new-connection-e1531164541889.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4382" class="wp-image-4382 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-create-new-connection-768x462.png" alt="Connection Manager Window: Create New Connection" width="720" height="433" /></a><p id="caption-attachment-4382" class="wp-caption-text">Connection Manager Window: Create New Connection</p></div></li>
<li>Select ZS-OAuth Connection Manager from the list of Connection Managers and, double-click on it or click on Add button to add a new Connection Manager. By Default, The created connection manager is of Package-Level. You can set Project Level Connection manager too If you want.
<div id="attachment_4724" style="width: 681px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4724" class="wp-image-4724 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png" alt="SSIS Connection Maangers List: Select O-AUTH Connection Manager" width="671" height="549" srcset="https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager.png 671w, https://zappysys.com/blog/wp-content/uploads/2018/08/ssis-connection-managers-list-select-zs-oauth-connection-manager-300x245.png 300w" sizes="(max-width: 671px) 100vw, 671px" /></a><p id="caption-attachment-4724" class="wp-caption-text">SSIS Connection Mangers List: Select O-AUTH Connection Manager</p></div></li>
<li>In the SSIS ZS OAuth Connection Manager, Select Provider as Custom, select version as OAuth2 and select Grant Type as  Client Credentials Grant. Enter the credentials and access token url and test the connection.<br />
<pre class="crayon-plain-tag">https://api.sandbox.paypal.com/v1/oauth2/token</pre>
&nbsp;</p>
<div id="attachment_7841" style="width: 671px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oauth-basic-client-credential-grant.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7841" class="wp-image-7841 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oauth-basic-client-credential-grant.png" alt="ZS OAuth Connection – Client Credentials Grant " width="661" height="694" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oauth-basic-client-credential-grant.png 661w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oauth-basic-client-credential-grant-286x300.png 286w" sizes="(max-width: 661px) 100vw, 661px" /></a><p id="caption-attachment-7841" class="wp-caption-text">ZS OAuth Connection – Client Credentials Grant</p></div></li>
<li>Click on OK button to save OAuth Connection configure settings.</li>
</ol>
<p>That’s it we have successfully configured Connection for PayPal API in SSIS. In the next section, we will see how to use this connection and read various data from PayPal API.</p>
<h3>Read <span id="Read_Walmart_API_Data_in_SSIS"><span id="Read_YouTube_Playlists_in_SSIS">PayPal </span></span><span id="Read_Walmart_API_Data_in_SSIS"><span id="Read_YouTube_Playlists_in_SSIS">API Data in SSIS</span></span></h3>
<p>Once we have done creating HTTP Connection Manager we can move forward to read PayPal API data inside Data Flow. So lets Configure SSIS JSON / REST API Source.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="size-full wp-image-7934" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>From the SSIS toolbox drag and drop JSON Source on the dataflow designer surface.
<div id="attachment_3766" style="width: 604px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3766" class="wp-image-3766 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png" alt="Drag and Drop JSON Source Component" width="594" height="268" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin.png 594w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-json-source-for-getting-basic-profile-from-linkedin-300x135.png 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-3766" class="wp-caption-text">Drag and Drop JSON Source Component</p></div></li>
<li>Double click JSON Source and enter the following URL as below to get invoices and select that created OAuth Connection.<br />
<pre class="crayon-plain-tag">https://api.sandbox.paypal.com/v1/invoicing/invoices?page=0&amp;page_size=100&amp;total_count_required=true</pre>
<div id="attachment_7842" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-json-source-set-url-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7842" class="wp-image-7842 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-json-source-set-url-connection-768x682.png" alt="SSIS JSON Source" width="720" height="639" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-json-source-set-url-connection-768x682.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-json-source-set-url-connection-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-json-source-set-url-connection.png 826w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7842" class="wp-caption-text">SSIS JSON Source</p></div></li>
<li>Now Go to Pagination tab select mode as Url Parameter and add indicator as <pre class="crayon-plain-tag">page</pre>  and Add the increment value same as <pre class="crayon-plain-tag">page_size</pre>  value we set in url, there for in our case we set 100. For pagination call please click here for reference to this link.
<div id="attachment_7843" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-pagination.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7843" class="size-medium_large wp-image-7843" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-pagination-768x682.png" alt="PayPal Pagination" width="720" height="639" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-pagination-768x682.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-pagination-300x266.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-pagination.png 826w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7843" class="wp-caption-text">PayPal Pagination</p></div></li>
<li>Select the desire Array Filter and click on preview.
<div id="attachment_7844" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7844" class="size-medium_large wp-image-7844" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview-768x528.png" alt="PayPal Preview" width="720" height="495" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview-768x528.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview-300x206.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview-1024x705.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-paypal-preview.png 1071w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7844" class="wp-caption-text">PayPal Preview</p></div></li>
<li>That’s it, you are ready to load PayPal API Data into SQL Server.</li>
</ol>
<h3><span id="Load_Walmart_API_data_into_SQL_Server">Load PayPal API data into SQL Server</span></h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, we saw you how to extract information from REST API such as PayPal REST API using HTTP Connection and load into SQL Server. We also learned techniques like How to get Dynamic Token using HTTP Connection. To explore many other scenarios not discussed in this article download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information:</p>
<ul>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/json-source.htm" target="_blank" rel="noopener">JSON Source(REST API or File)</a>, <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-logging-task.htm" target="_blank" rel="noopener">ZS Logging Task</a></li>
<li><a href="https://developer.paypal.com/docs/api/overview/" target="_blank" rel="noopener">PayPal API</a></li>
<li><a href="https://zappysys.com/blog/call-soap-rest-api-using-dynamic-token-ssis/" target="_blank" rel="noopener">Dynamic token generation</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-paypal-api-data-ssis/">How to read PayPal API data in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read Walmart API data in SSIS / ODBC</title>
		<link>https://zappysys.com/blog/read-walmart-api-data-ssis-odbc/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 10 Jul 2019 12:45:13 +0000</pubDate>
				<category><![CDATA[ODBC PowerPack]]></category>
		<category><![CDATA[REST API]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[XML File / SOAP API Driver]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[Task]]></category>
		<category><![CDATA[Token]]></category>
		<category><![CDATA[Walmart]]></category>
		<category><![CDATA[ZappySys]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7380</guid>

					<description><![CDATA[<p>Introduction In this article, we will see how to read Walmart API data in SSIS and load into SQL Server. This blog mainly focuses on SSIS approach but steps mentioned to call Walmart APIs can be useful for any developer regardless of which programming language or toolset you use. Are you a Walmart.com Supplier or Marketplace [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-walmart-api-data-ssis-odbc/">How to read Walmart API data in SSIS / ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-7381 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/07/Walmart-150x150.jpg" alt="" width="128" height="128" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/Walmart-150x150.jpg 150w, https://zappysys.com/blog/wp-content/uploads/2019/07/Walmart.jpg 200w" sizes="(max-width: 128px) 100vw, 128px" />In this article, we will see how to read Walmart API data in SSIS and load into SQL Server. This blog mainly focuses on SSIS approach but steps mentioned to call Walmart APIs can be useful for any developer regardless of which programming language or toolset you use.</p>
<p>Are you a Walmart.com Supplier or Marketplace Seller? Then you may need to <a href="https://developer.walmart.com/">click here</a> to visit the site that is focused on these profiles.</p>
<p>&nbsp;</p>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<p>Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:</p>
<ol>
<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>).</li>
<li>Credentials of Walmart API. Click <a href="https://developer.walmartlabs.com/" target="_blank" rel="noopener">here</a> to create API.</li>
</ol>
<h2>Components Mentioned in this article</h2>
<div class="su-table su-table-alternate">
<table style="height: 44px;width: 307px">
<tbody>
<tr style="height: 22px">
<td style="width: 1px;height: 22px"><img loading="lazy" decoding="async" class="alignnone size-medium_large" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/logging-task/ssis-logging-task.png" width="40" height="40" /></td>
<td style="width: 247px;height: 22px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-logging-task.htm" target="_blank" rel="noopener">ZS Logging Task</a></td>
</tr>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/blog/wp-content/uploads/2016/01/SSIS-Json-Source-Adapter.png"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/blog/wp-content/uploads/2016/01/SSIS-Json-Source-Adapter.png" alt="" width="40" height="40" /></a></td>
<td style="height: 22px;width: 247px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/json-source.htm" target="_blank" rel="noopener">JSON Source(REST API or File)</a></td>
</tr>
</tbody>
</table>
</div>
<h2><span id="What_is_WordPress">What is Walmart?</span></h2>
<p>Walmart is the world&#8217;s largest retailer, and the Walmart Open API provides access to our extensive product catalog, thus enabling digital distribution partners to earn substantial affiliate revenues from customer referrals.</p>
<h2><span id="Read_data_fromWordPressusing_SSIS_JSON_Source">Read Walmart API Data using SSIS JSON Source</span></h2>
<p>Let’s start with an example. We use SSIS JSON Source component to make the call to Walmart API, we will read Walmart data and load into SQL Server. First of All, Open Visual Studio and Create New SSIS Package Project.</p>
<h3><span id="Step-1_GetDynamic_Token_Configure_ZS-HTTP_Connection">Get Dynamic Token (Configure ZS-HTTP Connection)</span></h3>
<p>To get API response data using SOAP / REST API call, you need to get an API Token from your login request URL. Follow the steps mentioned below to get API Token:</p>
<ol>
<li>Now, Right Click on Connection Managers Window, and one Context menu appears for creating a new connection manager.
<div style="width: 740px" class="wp-caption aligncenter"><a href="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-create-new-connection-e1531164541889.png?w=730&amp;ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-create-new-connection-e1531164541889.png?w=730&amp;ssl=1" alt="Create a New HTTP Connection." width="730" height="444" /></a><p class="wp-caption-text">Create a New HTTP Connection.</p></div></li>
<li>Select ZS HTTP Connection Manager from the list of Connection Managers and, double-click on it or click on Add button to add a new Connection Manager. By Default, The created connection manager is of Package-Level. You can set Project Level Connection manager too If you want.
<div style="width: 597px" class="wp-caption aligncenter"><a href="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-select-http-connection-manager-to-add.png?w=587&amp;ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://i2.wp.com/zappysys.com/blog/wp-content/uploads/2018/07/ssis-connection-manager-select-http-connection-manager-to-add.png?w=587&amp;ssl=1" alt="Select ZS-HTTP Connection from SSIS Connection Manager." width="587" height="634" /></a><p class="wp-caption-text">Select ZS-HTTP Connection from SSIS Connection Manager.</p></div></li>
<li>In the SSIS ZS HTTP Connection Manager, Go to General Tab and Configure HTTP Connection Manager. Enter API URL, Set Credentials Type to Dynamic Token &#8211; Two-Step Auth, and configure some basic settings for the same. We used Login URL as just example but you can enter any valid API URL endpoint here. Actual Login URL goes on Dynamic Token Tab (see next step).<br />
<pre class="crayon-plain-tag">https://marketplace.walmartapis.com/v3/items?nextCursor=*&amp;offset=2000&amp;limit=20</pre>
<pre class="crayon-plain-tag">WM_SEC.ACCESS_TOKEN</pre>
<div id="attachment_7418" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7418" class="wp-image-7418 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-768x521.png" alt="ZS HTTP Connection - Configure General Tab" width="720" height="488" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-768x521.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-300x203.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token.png 814w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7418" class="wp-caption-text">ZS HTTP Connection &#8211; Configure General Tab</p></div></li>
<li>Now, In the Dynamic Token Tab do configure like below image. Please click <a href="https://developer.walmart.com/#/apicenter/marketPlace/latest#getToken" target="_blank" rel="noopener">here</a> to refer about Walmart API Token.<br />
<pre class="crayon-plain-tag">https://marketplace.walmartapis.com/v3/token</pre>
<pre class="crayon-plain-tag">grant_type=client_credentials</pre>
<pre class="crayon-plain-tag">Accept: application/json
Cache-Control: no-cache
WM_SVC.NAME: Walmart Marketplace
WM_QOS.CORRELATION_ID: TokenId_&lt;&lt;yyyy-MM-ddTHH:mm:ss.fffZ,FUN_GETDATE_UTC&gt;&gt;
Authorization: Basic &lt;&lt;[$userid$]:[$password$],FUN_BASE64ENC&gt;&gt;</pre>
<div id="attachment_7454" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-configure.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7454" class="wp-image-7454 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-configure-768x668.png" alt="ZS HTTP Connection - Dynamic Token Tab" width="720" height="626" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-configure-768x668.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-configure-300x261.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-http-connection-dynamic-token-configure.png 854w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7454" class="wp-caption-text">ZS HTTP Connection &#8211; Dynamic Token Tab</p></div></li>
<li>On the <strong>Response Settings</strong> tab configure as below
<div id="attachment_7706" style="width: 598px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/wallmart-api-extract-token-from-response.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7706" class="size-full wp-image-7706" src="https://zappysys.com/blog/wp-content/uploads/2019/07/wallmart-api-extract-token-from-response.png" alt="Walmart API - Extract Token - Response Settings" width="588" height="383" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/wallmart-api-extract-token-from-response.png 588w, https://zappysys.com/blog/wp-content/uploads/2019/07/wallmart-api-extract-token-from-response-300x195.png 300w" sizes="(max-width: 588px) 100vw, 588px" /></a><p id="caption-attachment-7706" class="wp-caption-text">Walmart API &#8211; Extract Token &#8211; Response Settings</p></div>
<ol>
<li>Extract Mode = <strong>Extract from Body </strong></li>
<li>Expression Type = <strong>Json</strong></li>
<li>Response Content Filter = <pre class="crayon-plain-tag">$.access_token</pre></li>
</ol>
</li>
<li>Click on OK button to save HTTP Connection configure settings.</li>
</ol>
<p>That’s it we have successfully configured Connection for Walmart API in SSIS. In the next section, we will see how to use this connection and read various data from Walmart API.</p>
<h3><span id="Read_YouTube_Playlists_in_SSIS">Read Walmart API Data in SSIS</span></h3>
<p>Once we have done creating HTTP Connection Manager we can move forward to read Walmart API data inside Data Flow. So lets Configure SSIS JSON / REST API Source.</p>
<ol>
<li>Now, Drag and drop Data Flow Task from SSIS Toolbox in the currently open project and double click it to edit.<br />
<img class="yoast-text-mark" /></p>
<div style="width: 470px" class="wp-caption aligncenter"><a href="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png?resize=460%2C155&amp;ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://i0.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png?resize=460%2C155&amp;ssl=1" alt="Drag and Drop Data Flow Task." width="460" height="155" /></a><p class="wp-caption-text">Drag and Drop Data Flow Task.</p></div></li>
<li>Double click on the Data Flow task to see the Data Flow designer surface.</li>
<li>From the SSIS toolbox drag and drop JSON Source on the dataflow designer surface.
<div style="width: 551px" class="wp-caption aligncenter"><a href="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png?w=720&amp;ssl=1" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-source/ssis-json-source-adapter-drag.png?w=720&amp;ssl=1" alt="Drag and Drop JSON Source(REST API or File)." width="541" height="144" /></a><p class="wp-caption-text">Drag and Drop JSON Source(REST API or File).</p></div></li>
<li>Double click JSON Source and enter the following URL as below.<br />
<pre class="crayon-plain-tag">https://marketplace.walmartapis.com/v3/items?nextCursor=*&amp;offset=2000&amp;limit=20</pre>
</li>
<li>Check Use Credentials and select existing HTTP connection we have created already it.</li>
<li>Enter Following HTTP Headers. If you prefer Raw edit .. Just click on Raw Edit (#6 in screenshot) and paste below headers. Make sure to replace <strong>YourClientIdGoesHere</strong> and <strong>YourSecretGoesHere</strong><br />
<pre class="crayon-plain-tag">Content-Type: application/xml
Accept: application/xml
Authorization: Basic &lt;&lt;YourClientIdGoesHere:YourSecretGoesHere,FUN_BASE64ENC&gt;&gt;
WM_SVC.NAME: Walmart Marketplace
WM_QOS.CORRELATION_ID: TokenId_&lt;&lt;yyyy-MM-ddTHH:mm:ss.fffZ,FUN_GETDATE_UTC&gt;&gt;</pre>
&nbsp;</li>
<li>Select Array Filter (ItemResponse node) or type $.ItemResponse[*]  as below.
<div id="attachment_7420" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7420" class="wp-image-7420 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure-768x765.png" alt="ZS JSON Source - Configure" width="720" height="717" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure-768x765.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-json-source-configure.png 826w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7420" class="wp-caption-text">ZS JSON Source &#8211; Configure</p></div></li>
<li>That&#8217;s it, you are ready to load Wallmart API Data into SQL Server and you can use more <a href="https://zappysys.com//onlinehelp/ssis-powerpack/index.htm#page=ssis-format-specifiers.htm" target="_blank" rel="noopener">ZappySys Destination</a> components.</li>
<li>For pagination call please click <a href="https://zappysys.com/blog/ssis-rest-api-looping-until-no-more-pages-found/" target="_blank" rel="noopener">here</a> for reference to this link.</li>
</ol>
<h3>Load Walmart API data into SQL Server</h3>
<div class="content_block" id="custom_post_widget-5617"><p>ZappySys SSIS PowerPack makes it easy to load data from various sources such as REST, SOAP, JSON, XML, CSV or from other source into SQL Server, or PostgreSQL, or Amazon Redshift, or other  targets. The <strong>Upsert Destination</strong> component allows you to automatically insert new records and update existing ones based on key columns. Below are the detailed steps to configure it.</p>
<h3>Step 1: Add Upsert Destination to Data Flow</h3>
<ol>
<li>Drag and drop the <strong>Upsert Destination</strong> component from the SSIS Toolbox.</li>
<li>Connect your source component (e.g., JSON / REST / Other Source) to the Upsert Destination.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2017/08/ssis-data-flow-drag-drop-upsert-destination.png" /></a>
<p class="wp-caption-text">SSIS - Data Flow - Drang and Drop Upsert Destination Component</p>
</div>
<h3>Step 2: Configure Target Connection</h3>
<ol>
<li>Double-click the <strong>Upsert Destination</strong> component to open the configuration window.</li>
<li>Under <strong>Connection</strong>, select an existing target connection or click <strong>NEW</strong> to create a new connection.
<ul>
<li>Example: SQL Server, or PostgreSQL, or Amazon Redshift.</li>
</ul>
</li>
</ol>
<h3>Step 3: Select or Create Target Table</h3>
<ol>
<li>In the <strong>Target Table</strong> dropdown, select the table where you want to load data.</li>
<li>Optionally, click <strong>NEW</strong> to create a new table based on the source columns.</li>
</ol>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-configuration.png" /></a>
<p class="wp-caption-text">Configure SSIS Upsert Destination Connection - Loading data (REST / SOAP / JSON / XML /CSV) into SQL Server or other target using SSIS</p>
</div>
<h3>Step 4: Map Columns</h3>
<ol>
<li>Go to the <strong>Mappings</strong> tab.</li>
<li>Click <strong>Auto Map</strong> to map source columns to target columns by name.</li>
<li>Ensure you <strong>check the Primary key column(s)</strong> that will determine whether a record is inserted or updated.</li>
<li>You can manually adjust the mappings if necessary.</li>
</ol>
 <div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2020/09/upsert-destination-key.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination - Columns Mappings</p>
</div>
<h3>Step 5: Save Settings</h3>
<ul>
<li>Click <strong>OK</strong> to save the Upsert Destination configuration.</li>
</ul>
<h3>Step 6: Optional: Add Logging or Analysis</h3>
<ul>
<li>You may add extra destination components to log the number of inserted vs. updated records for monitoring or auditing purposes.</li>
</ul>
<h3>Step 7: Execute the Package</h3>
<ul>
<li>Run your SSIS package and verify that the data is correctly inserted and updated in the target table.</li>
</ul>
<div class="wp-caption aligncenter">
<a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png">
<img loading="lazy" decoding="async" class="size-full" alt="" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-upsert-destination-execute.png" /></a>
<p class="wp-caption-text">SSIS Upsert Destination Execution</p>
</div></div>
<h2>Walmart API integration using ODBC Driver (Power BI, Excel, MS Access)</h2>
<p>So far we have seen how to access Walmart API using SSIS. However there will be a time when you like to access API data inside other Apps using ODBC Driver. ZappySys Provides JSON/XML/CSV drivers for virtually any API including Walmart API. Here is how to access Walmart API using <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener">XML ODBC Driver</a>.</p>
<ol>
<li>Type &#8220;ODBC&#8221; in Start menu. Open ODBC Data sources (64 bit)<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3992" src="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png" alt="Open ODBC Data Sources from Startup menu" width="986" height="622" srcset="https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen.png 986w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-300x189.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/06/odbc-data-sources-start-up-screen-768x484.png 768w" sizes="(max-width: 986px) 100vw, 986px" /></a></li>
<li>Click Add on User DSN tab (if you need to use DSN under different Account &#8230;i.e. Service Account then click on System DSN Tab)</li>
<li>Select <a href="https://zappysys.com/products/odbc-powerpack/odbc-xml-soap-api-driver/" target="_blank" rel="noopener"><strong>ZappySys XML Driver</strong></a></li>
<li>When New DSN UI shows up, Change DSN name to anything you like (e.g. WalmartAPI)</li>
<li>Click on <strong>Load ConnectionString</strong> button and enter below connection. Make sure to replace few things<br />
First <strong>######YourClientId#######</strong> with your own clientid<br />
Second <strong>######YourSecret#######</strong> with your own secret<br />
Third <strong>######Base64OfClientIdAndSecret#######</strong> with base64 encoded string of <pre class="crayon-plain-tag">clientId:Secret</pre>    (both separated with colon). You can use any site <a href="https://www.base64encode.org/" target="_blank" rel="noopener">like this one</a> to generate base64 string of your clientid and secret (seperated by &#8220;:&#8221;)<br />
<pre class="crayon-plain-tag">DRIVER={ZappySys XML Driver};
ElementsToTreatAsArray='ns2:ItemResponse';
DataPath='https://marketplace.walmartapis.com/v3/items?nextCursor=*&amp;offset=2000&amp;limit=20';
DataConnectionType=HTTP;
AuthScheme='{none}';
Url='https://marketplace.walmartapis.com/v3/items?nextCursor=*&amp;offset=2000&amp;limit=20';
TokenUrl='https://marketplace.walmartapis.com/v3/token';
TokenRequestData='grant_type=client_credentials';
TokenRequestMethod='POST';
TokenResponseContentFilter='$.access_token';
TokenRequestHeaders='Accept:application/json||Cache-Control:no-cache||WM_SVC.NAME:Walmart Marketplace||WM_QOS.CORRELATION_ID:TokenId_&lt;&lt;yyyy-MM-ddTHH:mm:ss.fffZ,FUN_GETDATE_UTC&gt;&gt;||Authorization:Basic &lt;&lt;[$userid$]:[$password$],FUN_BASE64ENC&gt;&gt;';
TokenAuthHeader='WM_SEC.ACCESS_TOKEN';
TokenResponseContentType=Json;
UserName='######YourClientId#######';
CredentialType=TokenDynamic;
Password='######YourSecret#######';
Filter='$.ns2:ItemResponses.ns2:ItemResponse[*]';
RequestMethod='GET';
RequestHeaders='Content-Type: application/xml || Accept: application/xml || Authorization: Basic ######Base64OfClientIdAndSecret####### || WM_SVC.NAME: Walmart Marketplace || WM_QOS.CORRELATION_ID: TokenId_&lt;&lt;yyyy-MM-ddTHH:mm:ss.fffZ,FUN_GETDATE_UTC&gt;&gt;'</pre>
<div id="attachment_7712" style="width: 533px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/zappysys-driver-load-connection-string.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7712" class="size-full wp-image-7712" src="https://zappysys.com/blog/wp-content/uploads/2019/07/zappysys-driver-load-connection-string.png" alt="ZappySys Driver - Load Connection String" width="523" height="499" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/zappysys-driver-load-connection-string.png 523w, https://zappysys.com/blog/wp-content/uploads/2019/07/zappysys-driver-load-connection-string-300x286.png 300w" sizes="(max-width: 523px) 100vw, 523px" /></a><p id="caption-attachment-7712" class="wp-caption-text">ZappySys Driver &#8211; Load Connection String</p></div>
<p>&nbsp;</li>
<li>Now go to preview tab and enter below query and click Run below SQL.</p><pre class="crayon-plain-tag">select * from $</pre><p>
<strong>&#8211;OR&#8211;<br />
</strong>NOTE: Change <strong>YourClientId</strong> and <strong>YourSecret</strong> in below sql before running</p><pre class="crayon-plain-tag">SELECT * FROM $
WITH(
Src='https://marketplace.walmartapis.com/v3/items?nextCursor=*&amp;offset=2000&amp;limit=20'
,Header='Content-Type: application/xml
Accept: application/xml
Authorization: Basic &lt;&lt;YourClientid:YourSecret,FUN_BASE64ENC&gt;&gt;
WM_SVC.NAME: Walmart Marketplace
WM_QOS.CORRELATION_ID: TokenId_&lt;&lt;yyyy-MM-ddTHH:mm:ss.fffZ,FUN_GETDATE_UTC&gt;&gt;'
)</pre><p>
&nbsp;</li>
</ol>
<h2>Walmart API Integration with Other BI Tools (Power BI, Excel, SSRS, MS Access&#8230;)</h2>
<div class="content_block" id="custom_post_widget-7051">ZappySys ODBC Drivers built using ODBC standard which is widely adopted by industry for a long time. Which mean the majority of BI Tools / Database Engines / ETL Tools already there will support native / 3rd party ODBC Drivers. Below is the small list of most popular tools / programming languages our Drivers support. If your tool / programming language doesn't appear in the below list, which means we have not documented use case but as long as your tool supports ODBC Standard, our drivers should work fine.

&nbsp;

<img loading="lazy" decoding="async" class="" src="//zappysys.com/images/odbc-powerpack/odbc-powerpack-integration.jpg" alt="ZappySys ODBC Drivers for REST API, JSON, XML - Integrate with Power BI, Tableau, QlikView, QlikSense, Informatica PowerCenter, Excel, SQL Server, SSIS, SSAS, SSRS, Visual Studio / WinForm / WCF, Python, C#, VB.net, PHP. PowerShell " width="750" height="372" />
<table style="valign: top;">
<tbody>
<tr>
<td>
<p style="text-align: center;"><strong>BI / Reporting Tools
Integration</strong></p>
</td>
<td style="text-align: center;"><strong>ETL Tools
Integration
</strong></td>
<td style="text-align: center;"><strong>Programming Languages</strong>
<strong>Integration</strong></td>
</tr>
<tr>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/howto-import-json-rest-api-power-bi/" target="_blank" rel="noopener">Microsoft Power BI</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-tableau-read-json-soap-xml-csv/">Tableau</a></li>
 	<li><a href="https://zappysys.com/blog/read-rest-api-using-ssrs-reports-call-json-xml-web-service/" target="_blank" rel="noopener">SSRS (SQL Reporting Services)</a></li>
 	<li><a href="https://zappysys.com/blog/qlik-rest-connector-examples-read-json-xml-api/" target="_blank" rel="noopener">QlikView /Qlik Sense</a></li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-in-microstrategy-json-soap-xml/" target="_blank" rel="noopener">MicroStrategy</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-google-sheet-call-appscript-load-json-soap-xml-csv/" target="_blank" rel="noopener">Google Sheet</a></li>
 	<li><a href="https://zappysys.com/blog/import-json-excel-load-file-rest-api/" target="_blank" rel="noopener">Microsoft Excel</a></li>
 	<li><a href="https://zappysys.com/api/integration-hub/rest-api-connector/access?context=connector" target="_blank" rel="noopener">Microsoft Access</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li><a href="https://zappysys.com/blog/read-json-informatica-import-rest-api-json-file/" target="_blank" rel="noopener">Informatica PowerCenter</a> (Windows)</li>
 	<li>Informatica Cloud</li>
 	<li>SSIS (SQL Integration Services)</li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">SQL Server</a></li>
 	<li><a href="https://zappysys.com/blog/read-write-rest-api-data-in-talend-json-xml-soap/" target="_blank" rel="noopener">Talend Data Studio</a></li>
 	<li><a href="https://zappysys.com/blog/pentaho-read-rest-api-in-pentaho/" target="_blank" rel="noopener">Pentaho Kettle</a></li>
 	<li>Oracle OBIEE</li>
 	<li>Many more (not in this list).....</li>
</ul>
</td>
<td>
<ul>
 	<li>Visual Studio</li>
 	<li><a href="https://zappysys.com/blog/calling-rest-api-in-c/" target="_blank" rel="noopener">C#</a></li>
 	<li>C++</li>
 	<li><a href="https://zappysys.com/blog/connect-java-to-rest-api-json-soap-xml/" target="_blank" rel="noopener">JAVA</a></li>
 	<li><a href="https://zappysys.com/blog/set-rest-python-client/" target="_blank" rel="noopener">Python</a></li>
 	<li>PHP</li>
 	<li><a href="https://zappysys.com/blog/call-rest-api-powershell-script-export-json-csv/" target="_blank" rel="noopener">PowerShell</a></li>
 	<li><a href="https://zappysys.com/blog/import-rest-api-json-sql-server/" target="_blank" rel="noopener">T-SQL (Using Linked Server)</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
&nbsp;</div>
<h2>How to encrypt Authorization Token as Base64Encode</h2>
<ol>
<li>If you want to directly pass Authorization header Token as Base64Encode(clientId:clientSecret) encrypted in the get token call, you can encrypted it using ZS Logging task and used it. Please refer to this <a href="https://zappysys.com//onlinehelp/ssis-powerpack/index.htm#page=ssis-format-specifiers.htm" target="_blank" rel="noopener">link</a> for the same.</li>
<li>In visual studio just Drag and Drop ZS Logging Task in the design panel.
<div style="width: 405px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/logging-task/ssis-logging-task-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/logging-task/ssis-logging-task-drag.png" alt="Drag and Drop ZS Logging Task" width="395" height="80" /></a><p class="wp-caption-text">Drag and Drop ZS Logging Task</p></div></li>
<li>Double click on ZS Logging Task to configure it.</li>
<li>In the ZS Logging Task configure like the following image.
<div id="attachment_7453" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7453" class="wp-image-7453 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task-768x426.png" alt="Logging Task : Base64Enocde " width="720" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task-768x426.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task-300x167.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task-1024x569.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/07/ssis-walmart-encrypted-authorization-token-using-zs-logging-task.png 1050w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7453" class="wp-caption-text">Logging Task : Base64Enocde</p></div></li>
<li>That&#8217;s all, Save Base64Encoded token for use in HTTP Connection.</li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, we saw you how to extract information from REST API such as Walmart REST API using HTTP Connection and load into SQL Server. We also learned techniques like How to get Dynamic Token using HTTP Connection. To explore many other scenarios not discussed in this article download <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<p>Finally, you can use the following links for more information:</p>
<ul style="list-style-type: circle;">
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/json-source.htm" target="_blank" rel="noopener">JSON Source(REST API or File)</a>, <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-logging-task.htm" target="_blank" rel="noopener">ZS Logging Task</a></li>
<li>Walmart API: <a href="https://developer.walmart.com/#/apicenter/marketPlace/latest#getToken" target="_blank" rel="noopener">HTTP Connection</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-walmart-api-data-ssis-odbc/">How to read Walmart API data in SSIS / ODBC</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS PGP Encryption / Decryption (Using FREE GPG Tool)</title>
		<link>https://zappysys.com/blog/ssis-pgp-encryption-decryption/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Fri, 07 Jun 2019 02:42:20 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Tips & How-Tos]]></category>
		<category><![CDATA[decryption]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[openpgp]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7161</guid>

					<description><![CDATA[<p>Introduction In this new article, we will show you how to perform PGP encryption using SSIS (encrypt / decrypt files using public / private key). Our previous article was about SFTP using our SFTP task for SSIS. Now we will show how to encrypt the information. Requirements First of all, you will need SSDT for Business Intelligence for [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-pgp-encryption-decryption/">SSIS PGP Encryption / Decryption (Using FREE GPG Tool)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-encryption-logo.png"><img loading="lazy" decoding="async" class="wp-image-7202 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-encryption-logo.png" alt="" width="122" height="122" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-encryption-logo.png 500w, https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-encryption-logo-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-encryption-logo-300x300.png 300w" sizes="(max-width: 122px) 100vw, 122px" /></a>In this new article, we will show you how to perform PGP encryption using SSIS (encrypt / decrypt files using public / private key). Our previous article was about <a href="https://zappysys.com/blog/ssis-sftp-task-examples-upload-download-move-delete-files-folders/">SFTP using our SFTP task for SSIS</a>. Now we will show how to encrypt the information.</p>
<h2>Requirements</h2>
<ol>
<li>First of all, you will need SSDT for <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017">Business Intelligence for SSIS</a> projects.</li>
<li>Download and install FREE PGP Command line <a href="https://www.gnupg.org/download/index.html" target="_blank" rel="noopener">gnupg</a> for Windows.</li>
<li><strong>Optionally</strong> you can install <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a>.</li>
</ol>
<div class="su-note"  style="border-color:#9ddee5;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:#b7f8ff;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">Note: This article is for the information purpose only.</div></div>
<h3>What is PGP / GPG (GnuPG) / OpenPGP ?</h3>
<p><strong>PGP</strong> stands for Pretty Good Privacy. It was created by Phil Zimmermann. PGP is the most popular email encryption in the world. It is an Encryption that requires a public key, a private key. You can encrypt, decrypt and sign documents, emails. PGP Tools now acquired by Symantec. In sort PGP Tools developed by Phil are not Open Source any more so use other on if you really need FREE one.</p>
<p><strong>GPG</strong> (i.e. GnuPG)) stands for GNU Privacy Guard. <a href="https://www.gnupg.org/download/index.html" target="_blank" rel="noopener">This software</a> is for multiple platforms like Linux and Windows. In this article, we will focus on Windows because we are using SSIS that is mainly installed in Windows (at least by the moment). This tool is free, so we will focus on this one instead of trying other licensed versions.</p>
<p><strong>OpenPGP</strong> is standard around Public / Private Key Cryptography (<a href="https://tools.ietf.org/html/rfc4880" target="_blank" rel="noopener">RFC4880</a>) . <a href="https://www.openpgp.org/about/" target="_blank" rel="noopener">Check this page</a>. Both GPG and PGP follow OpenPGP Standard however there will be a case when they are not 100% compatible with each other.</p>
<p>For more information <a href="https://superuser.com/questions/1397874/gnupg-package-difference-between-pgp-and-gpg" target="_blank" rel="noopener">read this link</a> and <a href="https://askubuntu.com/questions/186805/difference-between-pgp-and-gpg" target="_blank" rel="noopener">this link</a>.</p>
<h2>Getting started</h2>
<p>In this article we will use GPG only which is essentially same features as PGP but GPG is Open Source around OpenPGP Standard and PGP is not open source.</p>
<p>So let&#8217;s get started. First of all, we will start with a simple the command line.</p>
<h3>GPG command line example</h3>
<p>After you install gpg command line we can open it to get started. There are many more examples <a href="https://www.glump.net/howto/cryptography/practical-introduction-to-gnu-privacy-guard-in-windows" target="_blank" rel="noopener">explained here</a> and <a href="https://gnupg.org/documentation/manpage.html" target="_blank" rel="noopener">here</a>.</p>
<ol>
<li>First of all, check the requirements and open the command line.</li>
<li>Secondly, in the command line write gpg &#8211;help this will list all the commands available:
<div id="attachment_7171" style="width: 764px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/gpg-command-line.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7171" class="size-full wp-image-7171" src="https://zappysys.com/blog/wp-content/uploads/2019/06/gpg-command-line.jpg" alt="LIst of gpg commands" width="754" height="481" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/gpg-command-line.jpg 754w, https://zappysys.com/blog/wp-content/uploads/2019/06/gpg-command-line-300x191.jpg 300w" sizes="(max-width: 754px) 100vw, 754px" /></a><p id="caption-attachment-7171" class="wp-caption-text">gpg help command</p></div></li>
<li>Also, in order to generate your personal key pair, write the following command:<br />
<pre class="crayon-plain-tag">gpg --gen-key</pre>
</li>
<li>Finally, the command previously provided will ask for a name and email, write an O to press OK and a Passphrase. You will be able to create your key pair with that information.</li>
</ol>
<h3>PGP encryption using SSIS introduction</h3>
<p>It is possible to perform PGP encryption using SSIS with the GPG command line which is free. We can use  native <a href="https://docs.microsoft.com/en-us/sql/integration-services/control-flow/execute-process-task?view=sql-server-2017" target="_blank" rel="noopener">execute process task</a> that comes with SSIS. In this article, we will show some commands of gpg.</p>
<ol>
<li>Open a new SSIS Package.</li>
<li>Drag Execute Process Task from SSIS Toolbox and double click to configure (see next step).</li>
<li>Using SSIS Execute Process Task, we will invoke the gpg commands. There are different ways to invoke the gpg commands. One way is to execute command stored in a .bat file or .cmd file</li>
<li>To invoke command from a file create a file called gpg.cmd and type <pre class="crayon-plain-tag">gpg --version</pre>   , save file to path like c:\sql\gpg.cmd for this demo.</li>
<li>Configure Execute Process Task something like this if you invoke command from batch file:
<div id="attachment_7173" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-ssis-execute-process-task.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7173" class="size-full wp-image-7173" src="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-ssis-execute-process-task.jpg" alt="Invoke a cmd file in SSIS to encrypt" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-ssis-execute-process-task.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2019/06/pgp-ssis-execute-process-task-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-7173" class="wp-caption-text">SSIS invoke gpg</p></div></li>
<li>Also, note that the <strong>windows style is hidden</strong>. That will hide the command line when running the package.</li>
<li>In addition, the <strong>StandardOutputVariable</strong> will create an object variable in the output.</li>
<li>To verify the output, we will use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/" target="_blank" rel="noopener">ZS Logging task</a>
<div style="width: 768px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-output-pgp-version-information.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="size-full wp-image-7174" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-output-pgp-version-information.jpg" alt="Show gpg output result from a variable" width="758" height="260" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-output-pgp-version-information.jpg 758w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-output-pgp-version-information-300x103.jpg 300w" sizes="(max-width: 758px) 100vw, 758px" /></a><p class="wp-caption-text">SSIS output results</p></div></li>
<li>Click OK to save Execute Process Task UI.</li>
<li>Now drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/">ZS Logging task</a> from toolbox and configure like below. This will Log output captured by gpg command. This step is optional but will help you a lot if you want to know what happened in previous step (e.g. capture error message)
<div id="attachment_7170" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-variables-logging-task-values.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7170" class="size-full wp-image-7170" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-variables-logging-task-values.jpg" alt="SSIS Show variable value" width="625" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-variables-logging-task-values.jpg 625w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-variables-logging-task-values-300x242.jpg 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-7170" class="wp-caption-text">SSIS Logging task</p></div></li>
</ol>
<h3>Execute GPG / PGP commands directly in SSIS Execute Process Task (Pass Arguments)</h3>
<p>1. In the previous example, we used a cmd file with the commands. Sometimes we need to use SSIS variables and pass information dynamically. In this new example, we will invoke the gpg command line directly and send the arguments in the arguments property like this:</p>
<div id="attachment_7176" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-execute-process-arguments.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7176" class="size-full wp-image-7176" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-execute-process-arguments.jpg" alt="gpg encryption in ssis" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-execute-process-arguments.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-execute-process-arguments-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-7176" class="wp-caption-text">SSIS execute gpg encryption</p></div>
<h3>Generate public key in PGP encryption using SSIS</h3>
<p>Now lets look at common task with PGP cryptography which is generate Public / Private Key pair.</p>
<ol>
<li>In order to generate a public key, you need to run the following arguments in SSIS:
<div id="attachment_7178" style="width: 966px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-gpg-generate-key.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7178" class="size-full wp-image-7178" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-gpg-generate-key.jpg" alt="Generating a public gpg key in SSIS" width="956" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-gpg-generate-key.jpg 956w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-gpg-generate-key-300x198.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-gpg-generate-key-768x507.jpg 768w" sizes="(max-width: 956px) 100vw, 956px" /></a><p id="caption-attachment-7178" class="wp-caption-text">SSIS generation of public key</p></div>
<pre class="crayon-plain-tag">--armor --output "c:\sql\ssiskey.txt" --export "Name"</pre>
</li>
<li>In addition, the key name is the name of the pair key created and the<br />
output contains the path of the stored key.</li>
</ol>
<h3>How to encrypt a file in PGP encryption using SSIS</h3>
<ol>
<li>First of all, we will encrypt a file named ssiskey.txt:</li>
<li>The argument used is the following:<br />
<pre class="crayon-plain-tag">--recipient "Name" --output "c:\sql\ssiskey.txt.gpg" --encrypt "c:\sql\ssiskey.txt"</pre>
<div id="attachment_7179" style="width: 932px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-encrypt-file-pgp.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7179" class="size-full wp-image-7179" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-encrypt-file-pgp.jpg" alt="How to encrypt a file using PGP in SSIS" width="922" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-encrypt-file-pgp.jpg 922w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-encrypt-file-pgp-300x205.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-encrypt-file-pgp-768x526.jpg 768w" sizes="(max-width: 922px) 100vw, 922px" /></a><p id="caption-attachment-7179" class="wp-caption-text">Encrypt file gpg in SSIS</p></div></li>
<li>We are creating an encrypted file named ssiskey.txt.pgp</li>
</ol>
<h3>How to decrypt a file in PGP encryption using SSIS</h3>
<ol>
<li>In order to start, we will decrypt the file created previously:
<div id="attachment_7181" style="width: 1034px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-decrypt-pgp.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7181" class="size-full wp-image-7181" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-decrypt-pgp.jpg" alt="PGP decryption in SSIS" width="1024" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-decrypt-pgp.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-decrypt-pgp-300x185.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-decrypt-pgp-768x473.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a><p id="caption-attachment-7181" class="wp-caption-text">Decrypt file using PGP</p></div></li>
<li>Also, we will use the following argument:<br />
<pre class="crayon-plain-tag">--decrypt-files "c:\sql\ssiskey.txt.gpg"</pre>
&nbsp;</li>
</ol>
<h3>How to import a public key in PGP encryption using SSIS</h3>
<ol>
<li>In order to send a message and decrypt it, you need a public key. If you publish a public key, the recipient needs to import the public key. To import a key use the following argument:<br />
<pre class="crayon-plain-tag">gpg --import "c:\sql\publickey.txt".</pre>
You can download a public key here:</p>
<ul>
<li><a href="https://futureboy.us/pgp.txt" target="_blank" rel="noopener">Public key</a></li>
</ul>
</li>
<li>Secondly, in the Execute Process Task, will look like this:
<div id="attachment_7183" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-pgp-gpg-import-key.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7183" class="size-full wp-image-7183" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-pgp-gpg-import-key.jpg" alt="Import SSIS key " width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-pgp-gpg-import-key.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-pgp-gpg-import-key-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-7183" class="wp-caption-text">How to import a public key in SSIS</p></div></li>
</ol>
<h3>How to encrypt multiple files in PGP encryption using SSIS</h3>
<ol>
<li>If you want to encrypt multiple files, you can use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">ZS Advanced File System</a> combined with the Foreach loop container to filter and select the files to encrypt.</li>
<li>In addition, the package will look like this:
<div id="attachment_7185" style="width: 260px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-list-files-ado-list.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7185" class="size-full wp-image-7185" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-list-files-ado-list.jpg" alt="Get multiple files" width="250" height="206" /></a><p id="caption-attachment-7185" class="wp-caption-text">Send a list of files to the foreach loop</p></div></li>
<li>Also, in the Advanced File System, we will list the files as ADO.net DataTable:
<div id="attachment_7186" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-get-list-ado-list.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7186" class="size-full wp-image-7186" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-get-list-ado-list.jpg" alt="ADO list of files" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-get-list-ado-list.jpg 683w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-get-list-ado-list-300x278.jpg 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-7186" class="wp-caption-text">Store list of files in SSIS</p></div></li>
<li>In the next step, we will use the Foreach ADO Enumerator in the Foreach Loop container:
<div id="attachment_7188" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-foreach-ado-enumerator.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7188" class="size-full wp-image-7188" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-foreach-ado-enumerator.jpg" alt="SSIS foreach loop container" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-foreach-ado-enumerator.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-foreach-ado-enumerator-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-7188" class="wp-caption-text">Foreach loop from the Advanced Files system</p></div></li>
<li>Next, we will select the first column (column 0) to get the file path from the list.
<div id="attachment_7189" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-mapping-column.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7189" class="size-full wp-image-7189" src="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-mapping-column.jpg" alt="Get the file path" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-mapping-column.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2019/06/ssis-mapping-column-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-7189" class="wp-caption-text">Send column 0 that contains the full path</p></div></li>
<li>Finally, we will use the following expression for the argument property to encrypt all the txt files of the ADO list:<br />
<pre class="crayon-plain-tag">"--recipient \"Daniel Calbimonte\" --output \""+ @[User::filepath]+".gpg\""+" 
--encrypt \""+@[User::filepath]+"\""</pre>
<div id="attachment_7190" style="width: 571px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/arguments-used-ssis.jpg" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7190" class="size-full wp-image-7190" src="https://zappysys.com/blog/wp-content/uploads/2019/06/arguments-used-ssis.jpg" alt="Expression to encrypt multiple files" width="561" height="503" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/arguments-used-ssis.jpg 561w, https://zappysys.com/blog/wp-content/uploads/2019/06/arguments-used-ssis-300x269.jpg 300w" sizes="(max-width: 561px) 100vw, 561px" /></a><p id="caption-attachment-7190" class="wp-caption-text">SSIS expression to encrypt multiple files</p></div></li>
</ol>
<h3>Troubleshooting PGP encryption using SSIS</h3>
<ol>
<li>First of all, if your package works in SSDT or VS and fails in the agent, verify that you are using a proxy account with permissions to run the gpg command line. For more information about SQL Agent proxies, refer to <a href="https://docs.microsoft.com/en-us/sql/ssms/agent/create-a-sql-server-agent-proxy?view=sql-server-2017" target="_blank" rel="noopener">this link</a>.</li>
</ol>
<h2>References</h2>
<p>For more information, refer to these links:</p>
<ul>
<li><a href="https://www.glump.net/howto/cryptography/practical-introduction-to-gnu-privacy-guard-in-windows#installing_in_other_operating_systems" target="_blank" rel="noopener">Practical Introduction to GNU Privacy Guard in Windows</a></li>
<li><a href="https://www.gnupg.org/gph/en/manual/book1.html" target="_blank" rel="noopener">The GNU Privacy Handbook</a></li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/ssis-pgp-encryption-decryption/">SSIS PGP Encryption / Decryption (Using FREE GPG Tool)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to read and write data to HTML in SSIS</title>
		<link>https://zappysys.com/blog/read-and-write-data-to-html-in-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Tue, 22 May 2018 22:16:51 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS HTML Table Source]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[result]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[variable]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=3584</guid>

					<description><![CDATA[<p>Introduction to read and write data to HTML in SSIS In this article, we will show how to send values from an SSIS Variable to an HTML file. We will use the SSIS Advanced File System Task to store the list of system files of a folder into a variable and then we will use [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/read-and-write-data-to-html-in-ssis/">How to read and write data to HTML in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction to read and write data to HTML in SSIS</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_.png"><img loading="lazy" decoding="async" class="alignleft wp-image-3618 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_-150x150.png" alt="HTML icon" width="150" height="150" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_-300x300.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_-768x768.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_-1024x1024.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/05/2000px-HTML5_logo_and_wordmark.svg_.png 2000w" sizes="(max-width: 150px) 100vw, 150px" /></a>In this article, we will show how to send values from an SSIS Variable to an HTML file. We will use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS Advanced File System Task </a> to store the list of system files of a folder into a variable and then we will use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/">SSIS Logging Task</a> to store the variable in an HTML file.</p>
<p>In the second part, we will read values from an HTML table and export the data into SQL Server. We will use the HTML file created in the first example. We will also use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-html-table-source/">ZS HTML Table Source</a> to read the data from the HTML table and export to SQL Server using the OLEDB Destination.</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:<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-logging-task-free/" 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-logging-task.png" alt="SSIS Logging Task" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/" target="_blank" rel="noopener">SSIS Logging Task (Free)</a></td>
</tr>
<tr style="line-height: 0px">
<td style="height: 58px" width="50px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-html-table-source/" 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-html-table-source.png" alt="SSIS HTML Table Source" width="50" height="50" /></a></td>
<td style="vertical-align: middle;height: 58px"><a href="https://zappysys.com/products/ssis-powerpack/ssis-html-table-source/" target="_blank" rel="noopener">SSIS HTML Table Source</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<br />
</a></td>
</tr>
</tbody>
</table>
</div>
<p>Finally, we will show how to read data from a SQL Server query and store into an HTML file. We will use the Execute SQL Task combined with the <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/">ZS SSIS Logging Task</a>.</p>
<h2 style="text-align: left">Requirements</h2>
<ol>
<li>First, you will need SSDT installed.</li>
<li>Secondly, <a href="https://zappysys.com/products/ssis-powerpack/">ZappySys PowerPack for SSIS.</a></li>
<li>Finally, SQL Server installed.</li>
</ol>
<h2>Getting started</h2>
<h3>How to save the list of system files into SQL an HTML table</h3>
<p>In the first example, we will use our ZappySys Advanced File System to copy a list of the system files in a folder. This list of files will be stored in an object variable and then we will save to a file.</p>
<ol>
<li>In the first place, we will use the Advanced File System Task and select the Get file list ADO.net DataTable action. We will list the files of the c:\sql folder and save the results into a variable:
<div id="attachment_3597" style="width: 693px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/list-of-files.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3597" class="size-full wp-image-3597" src="https://zappysys.com/blog/wp-content/uploads/2018/05/list-of-files.jpg" alt="SSIS list files" width="683" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/list-of-files.jpg 683w, https://zappysys.com/blog/wp-content/uploads/2018/05/list-of-files-300x278.jpg 300w" sizes="(max-width: 683px) 100vw, 683px" /></a><p id="caption-attachment-3597" class="wp-caption-text">SSIS list files</p></div></li>
<li>In addition, we will create a variable of type object named listfiles that will store the files information:
<div id="attachment_3599" style="width: 492px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3599" class="size-full wp-image-3599" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type.jpg" alt="SSIS object variable" width="482" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type.jpg 482w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type-300x237.jpg 300w" sizes="(max-width: 482px) 100vw, 482px" /></a><p id="caption-attachment-3599" class="wp-caption-text">SSIS object variable</p></div></li>
<li>Also, we will use the ZS Logging Tasks and join with the ZS Advanced File. The ZS Logging Task will be used to store the variable into a file:
<div id="attachment_3600" style="width: 333px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-folder-save-to-variable.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3600" class="size-full wp-image-3600" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-folder-save-to-variable.jpg" alt="SSIS object variable" width="323" height="205" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-folder-save-to-variable.jpg 323w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-folder-save-to-variable-300x190.jpg 300w" sizes="(max-width: 323px) 100vw, 323px" /></a><p id="caption-attachment-3600" class="wp-caption-text">SSIS save variable to HTML</p></div></li>
<li>In addition, it is possible to send the variable values into the Execution Log (SSIS output), to a file, to a MessageBox:
<div id="attachment_3601" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-output-variable-to-log-messagebo-file-variable.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3601" class="wp-image-3601 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-output-variable-to-log-messagebo-file-variable.jpg" alt="ssis output variable to log messagebo file variable" width="625" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-output-variable-to-log-messagebo-file-variable.jpg 625w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-output-variable-to-log-messagebo-file-variable-300x242.jpg 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-3601" class="wp-caption-text">SSIS output variable to log, message box and file variable to read and write data to HTML in SSIS</p></div></li>
<li>In this example, we will show the values into an HTML file named listfiles.html
<div id="attachment_3626" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-variable-into-html.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3626" class="size-full wp-image-3626" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-variable-into-html.jpg" alt="ssis save variable into html" width="625" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-variable-into-html.jpg 625w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-variable-into-html-300x242.jpg 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-3626" class="wp-caption-text">SSIS save variable iHTMLhtml</p></div></li>
<li>After executing the package, you will be able to see the HTML with a list of files, names, size, modification and creation information:
<div id="attachment_3627" style="width: 1350px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3627" class="size-full wp-image-3627" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1.jpg" alt="SSIS list files" width="1340" height="470" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1.jpg 1340w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1-300x105.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1-768x269.jpg 768w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1-1024x359.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-list-files-1-1080x380.jpg 1080w" sizes="(max-width: 1340px) 100vw, 1340px" /></a><p id="caption-attachment-3627" class="wp-caption-text">ssis list files</p></div></li>
</ol>
<h3>How to copy data from an HTML table to SQL Server</h3>
<p>The next example will save data from a file named listfiles.html created in the previous example with an HTML table. The example will export the table to SQL Server. However, with our HTML Table Source, you can export to any destination.</p>
<ol>
<li>In order to start, we will Drag and drop a data flow task and double click it:
<div id="attachment_3605" style="width: 540px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-data-flow.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3605" class="size-full wp-image-3605" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-data-flow.jpg" alt="ssis data flow" width="530" height="178" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-data-flow.jpg 530w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-data-flow-300x101.jpg 300w" sizes="(max-width: 530px) 100vw, 530px" /></a><p id="caption-attachment-3605" class="wp-caption-text">SSIS data flow</p></div></li>
<li>Next, in the Data Flow task, use the HTML Table Source and join to the OLEDB Destination:
<div id="attachment_3606" style="width: 352px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-to-oledb.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3606" class="size-full wp-image-3606" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-to-oledb.jpg" alt="ssis html table to oledb" width="342" height="221" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-to-oledb.jpg 342w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-to-oledb-300x194.jpg 300w" sizes="(max-width: 342px) 100vw, 342px" /></a><p id="caption-attachment-3606" class="wp-caption-text">SSIS HTML table SQL server</p></div></li>
<li>Also, in URLs enter the path of the HTML file created in the first example:
<div id="attachment_3607" style="width: 811px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-read.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3607" class="size-full wp-image-3607" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-read.jpg" alt="ssis html table read" width="801" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-read.jpg 801w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-read-300x222.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-html-table-read-768x569.jpg 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><p id="caption-attachment-3607" class="wp-caption-text">SSIS HTML table read</p></div></li>
<li>In addition, go to the OLEDB Source, specify the SQL Server name, database, and log in to it.<br />
In the name of table or view press new to create a new table:<br />
<pre class="crayon-plain-tag">CREATE TABLE [dbo.listfiles] (
[_rowNumber] int,
[_groupName] nvarchar(255),
[FullPath] nvarchar(255),
[Name] nvarchar(255),
[Size] int,
[AgeInDays] int,
[LastEditInDays] int,
[LastModifiedDate] datetime,
[CreationDate] datetime,
[LastModifiedDateUtc] datetime,
[CreationDateUtc] datetime,
[Extension] nvarchar(255),
[IsReadOnly] nvarchar(255),
[FolderPath] nvarchar(255)
)</pre>
<div id="attachment_3608" style="width: 834px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-oledb-create-table.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3608" class="size-full wp-image-3608" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-oledb-create-table.jpg" alt="ssis oledb create table" width="824" height="719" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-oledb-create-table.jpg 824w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-oledb-create-table-300x262.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-oledb-create-table-768x670.jpg 768w" sizes="(max-width: 824px) 100vw, 824px" /></a><p id="caption-attachment-3608" class="wp-caption-text">SSIS OLEDB create table</p></div></li>
<li>Also, go to Mappings page to map all the columns.
<div id="attachment_3609" style="width: 834px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-map-columns.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3609" class="size-full wp-image-3609" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-map-columns.jpg" alt="ssis map columns" width="824" height="663" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-map-columns.jpg 824w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-map-columns-300x241.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-map-columns-768x618.jpg 768w" sizes="(max-width: 824px) 100vw, 824px" /></a><p id="caption-attachment-3609" class="wp-caption-text">SSIS map columns</p></div></li>
<li>Finally, run the package and you will have all the data exported.</li>
</ol>
<h3>How to export SQL Server results to an HTML in SSIS</h3>
<p>The following example will show how to export the results of an SQL query into an HTML file.</p>
<ol>
<li>In order to start, we will use the Execute SQL Task. Specify the option Full result set and create an OLEDB connection specifying the Server Name, database name and the select statement to a table:
<div id="attachment_3611" style="width: 747px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-results.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3611" class="size-full wp-image-3611" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-results.jpg" alt="ssis sql results" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-results.jpg 737w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-results-300x257.jpg 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-3611" class="wp-caption-text">SSIS SQL query results</p></div></li>
<li>Secondly, go to the Result Set page and in the Result Name, set 0 and in Variable name, create a new variable:
<div id="attachment_3612" style="width: 745px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-result-to-variable-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3612" class="size-full wp-image-3612" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-result-to-variable-1.jpg" alt="ssis sql result to variable" width="735" height="228" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-result-to-variable-1.jpg 735w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-sql-result-to-variable-1-300x93.jpg 300w" sizes="(max-width: 735px) 100vw, 735px" /></a><p id="caption-attachment-3612" class="wp-caption-text">ssis sql result to variable</p></div></li>
<li>Also, create a variable of type object:
<div id="attachment_3613" style="width: 492px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3613" class="size-full wp-image-3613" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type-1.jpg" alt="ssis object data type" width="482" height="380" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type-1.jpg 482w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-object-data-type-1-300x237.jpg 300w" sizes="(max-width: 482px) 100vw, 482px" /></a><p id="caption-attachment-3613" class="wp-caption-text">SSIS object data type</p></div></li>
<li>Finally, use the ZS Logging Task to save the results in a File. Specify the Log file path and insert the variable:
<div id="attachment_3614" style="width: 635px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-to-html-file.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3614" class="wp-image-3614 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-to-html-file.jpg" alt="ssis save to html file to export data to read and write data to HTML in SSIS" width="625" height="504" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-to-html-file.jpg 625w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-save-to-html-file-300x242.jpg 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-3614" class="wp-caption-text">SSIS save to HTML file</p></div></li>
</ol>
<h2>Conclusion about read and write data to HTML in SSIS</h2>
<p>To conclude, in this article, we learned how to export a list of files system properties and names to SQL Server. How to read an HTML table to SQL Server and finally how to export SQL Server results to an HTML in SSIS. There are nice tools to read and write data to HTML in SSIS</p>
<p>If you liked the tools, you can download them <a href="https://zappysys.com/products/ssis-powerpack/download/">HERE.</a></p>
<h2>References</h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack ZappySys</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/integration-services-ssis-variables?view=sql-server-2017">Integration Services (SSIS) Variables</a></li>
<li><a href="https://docs.microsoft.com/en-us/sql/integration-services/control-flow/execute-sql-task?view=sql-server-2017">Execute SQL Task</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/read-and-write-data-to-html-in-ssis/">How to read and write data to HTML in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS Base64 Encode Decode without Coding</title>
		<link>https://zappysys.com/blog/ssis-base64-encode-decode-without-coding/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 07 Sep 2016 16:47:38 +0000</pubDate>
				<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[ssis logging task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=774</guid>

					<description><![CDATA[<p>Introduction In this post you will learn how to use FREE SSIS Logging Task to perform ssis base64 encode decode and save to Variable or File  (i.e. convert Base64 Encoded value to plain text or encode plain text to base64) . You can also use many other format specifiers found here How to invoke Placeholder [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-base64-encode-decode-without-coding/">SSIS Base64 Encode Decode without Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this post you will learn how to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/" target="_blank" rel="noopener">FREE SSIS Logging Task</a> to perform ssis base64 encode decode and save to Variable or File  (i.e. convert Base64 Encoded value to plain text or encode plain text to base64) . You can also use many other <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">format specifiers found here</a></p>
<h2>How to invoke Placeholder Functions</h2>
<p>There are 3 ways you can use placeholder functions in many tasks with Variable Icon next to the property.</p>
<ol>
<li>User Variable Placeholder</li>
<li>Static String Placeholder</li>
<li>Mixed Placeholder (Static String with Variable)</li>
</ol>
<p><strong>Examples: </strong></p>
<pre class="crayon-plain-tag">{{User::var1,FUN_BASE64ENC}} </pre>
<strong>&#8211;OR&#8211;</strong><br />
<pre class="crayon-plain-tag">&lt;&lt;some direct string,FUN_BASE64ENC&gt;&gt;</pre>
<p><strong>&#8211;OR&#8211;</strong></p>
<pre class="crayon-plain-tag">&lt;&lt;{{User::var1}} and {{User::var2}} ,FUN_BASE64ENC&gt;&gt;</pre>
<h2>Encode Plain text to Base64 string (SSIS base64 encode decode)</h2>
<p>Many times you have requirement to convert plain text into Base64 encoded string (This is very common when you have to transfer data over the web &#8211; set query string / http headers / body ). Typically to perform this you may have to write C# Script if you are SSIS developer but below is very simple way to do without writing any code. <a href="https://zappysys.com/blog/how-to-set-base64-encoded-authorization-header-for-http-web-request/" target="_blank" rel="noopener">Here is the most common use case of Base64 encoded string</a></p>
<ol>
<li>Download <a href="https://zappysys.com/free-ssis-transformations-components-tasks/" target="_blank" rel="noopener">FREE Tasks/Components of SSIS PowerPack</a></li>
<li>Create new SSIS Package</li>
<li>Drag ZS Logging Task from Toolbox</li>
<li>Create SSIS variable which holds plain text value (Lets call it varPlainText. Set some initial value which you want to encode)</li>
<li>Configure <u><span style="color: #000080;">SSIS Logging Task</span></u> as below
<div id="attachment_776" style="width: 310px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-base64-encode-decode-without-coding.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-776" class="wp-image-776 size-medium" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-base64-encode-decode-without-coding-300x182.png" alt="SSIS Base64 Encode, Decode using SSIS Logging Task (Without coding convert plain text to base 64 string)" width="300" height="182" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-base64-encode-decode-without-coding-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-base64-encode-decode-without-coding.png 1010w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-776" class="wp-caption-text">SSIS Base64 Encode, Decode using SSIS Logging Task (Without coding convert plain text to base 64 string)</p></div></li>
<li>Run it and you will see new file created with encoded value. You can also save encoded value to Variable if you change <strong>Logging Mode = Variable</strong> rather than File</li>
</ol>
<h2>Convert Base64 Encoded value to plain text (Decode)</h2>
<p>To convert Base64 encoded string into plaintext you can perform similar steps described in the above section except you need to use BASE64DEC format specifier rather than BASE64ENC</p>
<p><strong>Example:</strong></p><pre class="crayon-plain-tag">&lt;&lt;QUJDREVGMTIzIyM=,FUN_BASE64DEC&gt;&gt;
--OR--
{{User::MySSISVar1,FUN_BASE64DEC}}</pre><p>
&nbsp;</p>
<h2>How to decode Base64 file in SSIS and save to new file</h2>
<p>If you have a file coming as a base64 encoded string and you want to decode it and save it to a new file then it&#8217;s simple too. Basically, you will need <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">SSIS Advanced File System Task</a>  and <span style="color: #000080;"><u>SSIS Logging Task</u></span> to achieve this (see package below).</p>
<div id="attachment_775" style="width: 310px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-file-encode-using-logging-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-775" class="wp-image-775 size-medium" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-file-encode-using-logging-task-300x158.png" alt="SSIS decode base64 file - Read content convert to plain text and save to new file" width="300" height="158" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-file-encode-using-logging-task-300x158.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-file-encode-using-logging-task.png 603w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-775" class="wp-caption-text">SSIS decode base64 file &#8211; Read content convert to plain text and save to new file</p></div>
<p>Here are your steps.</p>
<ol>
<li>Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">SSIS Advanced File System Task</a> and use read file content option to save file content into SSIS Variable</li>
<li>Configure Advanced File System as below.
<div id="attachment_777" style="width: 310px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-advanced-file-system-task-read-file-content-into-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-777" class="wp-image-777 size-medium" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-advanced-file-system-task-read-file-content-into-variable-300x174.png" alt="Read file content into SSIS variable using SSIS Advanced File System task" width="300" height="174" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-advanced-file-system-task-read-file-content-into-variable-300x174.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-advanced-file-system-task-read-file-content-into-variable.png 727w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-777" class="wp-caption-text">Read file content into SSIS variable using SSIS Advanced File System task</p></div></li>
<li>Next step connect <u><span style="color: #000080;">SSIS Logging Task</span></u></li>
<li>Configure SSIS Logging Task as per below screenshot.
<div id="attachment_778" style="width: 310px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-encoded-file-content.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-778" class="wp-image-778 size-medium" src="//zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-encoded-file-content-300x260.png" alt="Decode base64 file content in SSIS - Use Logging Task" width="300" height="260" srcset="https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-encoded-file-content-300x260.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/09/ssis-decode-base64-encoded-file-content.png 568w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-778" class="wp-caption-text">Decode base64 file content in SSIS &#8211; Use Logging Task</p></div></li>
</ol>
<h2>Convert Base64 Encoded string of local file content (Binary or Text)</h2>
<p>Using FUN_FILE_BASE64ENC we can encode the image or any other local file(Binary or Text) to the Base64 string.</p>
<h3>FUN_FILE_BASE64ENC</h3>
<p><strong>Syntax:</strong></p><pre class="crayon-plain-tag">&lt;&lt;file_path,FUN_FILE_BASE64ENC&gt;&gt;</pre><p>
Returns BASE64 encoded string of local file content (binary or text).</p>
<h4>Parameters:</h4>
<table style="width: 100%;">
<thead>
<tr>
<th style="width: 30%;">Name</th>
<th style="width: 70px;">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>file_path</td>
<td>[String] File path for which you like encode content as Base64.</td>
</tr>
</tbody>
</table>
<h4>Examples:</h4>
<pre class="crayon-plain-tag">&lt;&lt;c:\someimage.png,FUN_FILE_BASE64ENC&gt;&gt;
--OR--
{{User::MySSISVar1,FUN_FILE_BASE64ENC}}</pre>
<h4>Sample Output:</h4>
<p>This returns base64 encoded string of binary file (png)<br />
<pre class="crayon-plain-tag">bXl1c2V..........Ac3NXb3Jk</pre>
<p>The post <a href="https://zappysys.com/blog/ssis-base64-encode-decode-without-coding/">SSIS Base64 Encode Decode without Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>5 Ways to Export JSON from SQL Server using SSIS</title>
		<link>https://zappysys.com/blog/export-json-from-sql-server-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 07 Dec 2015 19:38:44 +0000</pubDate>
				<category><![CDATA[SSIS JSON Export Task]]></category>
		<category><![CDATA[SSIS JSON File Destination]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS Export JSON Task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=209</guid>

					<description><![CDATA[<p>Introduction SQL Server 2012 and all previous versions lacking native JSON support, same theory is true for their ETL Platform SSIS. If you are one of them who wants to export JSON from SQL Server or any other RDBMS like MySQL, Oracle then you can easily output complex JSON using any of the following components. Five ways of [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-json-from-sql-server-using-ssis/">5 Ways to Export JSON from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>SQL Server 2012 and all previous versions lacking native JSON support, same theory is true for their ETL Platform SSIS. If you are one of them who wants to export JSON from SQL Server or any other RDBMS like MySQL, Oracle then you can easily output complex JSON using any of the following components.</p>
<h2>Five ways of creating JSON inside SSIS</h2>
<p>ZappySys toolset provides multiple ways creating JSON inside SSIS. You can choose method suitable for your scenario. Each method has pros and cons so choose it as per your need.</p>
<h3>JSON File Destination</h3>
<p><img decoding="async" class="alignleft" style="font-family: inherit; font-size: inherit;" title="SSIS JSON Destination (Create JSON File)" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-file-destination/ssis-json-file-destination.png" alt="SSIS JSON Destination (Create JSON File)" width="100" /><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-destination-connector/" target="_blank" rel="noopener">SSIS JSON Destination</a> can be used to generate simple or complex JSON files out of relational data source such as SQL Server, Oracle, MySQL. In few clicks you can create desired JSON Shape from single or multiple tables (Parent/Child Nested Documents).</p>
<p><strong>PROS:</strong> Multiple data flow components can be attached. Which means unlike <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> you are not limited to OLEDB or ODBC Sources only.</p>
<p><strong>CONS:</strong> When you remove upstream component it may break Dataset mappings. Also server side Lookup Option is not available. File Splitting Options not available.</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-json-file-destination/" target="_blank" rel="noopener">some articles</a> for use case of this component.</p>
<div id="attachment_5358" style="width: 943px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5358" class="size-full wp-image-5358" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png" alt="JSON File Destination - Generate JSON in SSIS from multiple inputs" width="933" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png 933w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-300x252.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-768x645.png 768w" sizes="(max-width: 933px) 100vw, 933px" /></a><p id="caption-attachment-5358" class="wp-caption-text">JSON File Destination &#8211; Generate JSON in SSIS from multiple inputs</p></div>
<h3>JSON Generator Transform</h3>
<h3><span style="font-size: 16px;"><img decoding="async" class="alignleft" title="JSON Generator Transform" src="https://zappysys.com/images/SSIS-PowerPack/ssis-json-generator-transform.png" alt="JSON Generator Transform" width="100" /></span></h3>
<p><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a> can be used to generate single or multiple JSON documents from any type of data sources (e.g. SQL Server, MySQL, Flat File, Excel) inside data flow task. It takes multiple inputs and outputs JSON String Output Column which can be used to feed JSON to other downstream system.</p>
<p><strong>PROS:</strong> Multiple data flow components can be attached. Which means unlike <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> you are not limited to OLEDB or ODBC Sources only.</p>
<p><strong>CONS:</strong> When you remove upstream component it may break Dataset mappings. Also server side Lookup Option is not available. File Splitting Options not available. Output is JSON String Column.</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-json-generator-transform/" target="_blank" rel="noopener">some articles</a> for use case of this transform.</p>
<div id="attachment_4918" style="width: 792px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4918" class="size-full wp-image-4918" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png" alt="Preview JSON - Generate for BigQuery Table Insert" width="782" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png 782w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert-300x246.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert-768x629.png 768w" sizes="(max-width: 782px) 100vw, 782px" /></a><p id="caption-attachment-4918" class="wp-caption-text">Preview JSON &#8211; Generate for BigQuery Table Insert</p></div>
<h3>Export JSON Task</h3>
<p><em><img decoding="async" class="alignleft" src="https://zappysys.com/images/SSIS-PowerPack/ssis-export-json-file-task.png" alt="SSIS Export JSON File Task" /></em><a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">SSIS Export JSON File Task</a> can be used to generate simple or complex JSON files out of relational data source such as SQL Server, Oracle, MySQL. It also support exporting directly to cloud (e.g. Azure Blob Storage, Amazon AWS S3, Secure FTP). In few clicks you can create desired JSON Shape from single or multiple tables (Parent/Child Nested Documents)</p>
<p><strong>PROS:</strong> Simple to use with flexible options to export to file, variable, AWS S3, Azure Blob, FTP / SFTP location. Allows to split records. File Splitting Options available (Split By Size  / Row Count).</p>
<p><strong>CONS:</strong> You can only use limited data sources as Dataset input (e.g. OLEDB / ODBC or SQL Server).</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-json-export-task/" target="_blank" rel="noopener">some articles</a> for use case of this task.</p>
<h3>Template Transform</h3>
<p><img decoding="async" class="alignleft" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/template-transform/ssis-template-transform.png" alt="SSIS SSIS Template Transform" />Template Transform can be used to create dynamic strings inside data flow. You can use upstream columns as placeholders or use SSIS variables anywhere in the template to create desired text (e.g. XML / JSON document).</p>
<p><strong>PROS:</strong> Very Simple to use.</p>
<p><strong>CONS:</strong> Cannot use multiple inputs. It may not be used to create Complex JSON and options like do not output NULL attributes is not possible.</p>
<p>&nbsp;</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-template-transform/" target="_blank" rel="noopener">some articles</a> for use case of this transform.</p>
<div id="attachment_2614" style="width: 983px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2614" class="size-full wp-image-2614" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png" alt="Create JSON for API Request (POST) using SSIS Template Transform" width="973" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png 973w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-768x482.png 768w" sizes="(max-width: 973px) 100vw, 973px" /></a><p id="caption-attachment-2614" class="wp-caption-text">Create JSON for API Request (POST) using SSIS Template Transform</p></div>
<h3>Logging Task (Control Flow Approach)</h3>
<p><img decoding="async" class="alignleft" src="https://zappysys.com/images/SSIS-PowerPack/ssis-logging-task.png" /> Just like Template Transform you can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/" target="_blank" rel="noopener">ZS Logging Task</a> to create JSON string from Template and Variable Placeholders.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Here is how to use Logging Task to save JSON into a variable.</p>
<ol>
<li>Select Variable which you like to Set on Logging Task</li>
<li>Enter your Template JSON String which you like to produce (see example below). Notice the use of yyyy-MM-dd <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">format specifier</a> and also JSONENCODE function.<br />
<pre class="crayon-plain-tag">{
 ActionId: {{User::vActionId}},
 CreatedOn: "{{User::vOrderDate,yyyy-MM-ddTHH:mm:ss}}",
 Notes: "{{User::vNotes,JSONENCODE}}"
}</pre>
</li>
<li>Select Message Type = <strong>None</strong></li>
<li><strong>Uncheck Append</strong>, and <strong>Prefix</strong> options like below
<div id="attachment_222" style="width: 732px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-222" class="wp-image-222 size-full" src="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png" alt="Creating JSON / XML Document using SSIS Logging Task" width="722" height="528" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png 722w, https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder-300x219.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-222" class="wp-caption-text">Creating JSON / XML Document using SSIS Logging Task</p></div></li>
</ol>
<p>&nbsp;</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-logging-task/" target="_blank" rel="noopener">some articles</a> for use case of this task.</p>
<p>&nbsp;</p>
<h2>Create JSON using SSIS Export JSON Task</h2>
<p>Now let&#8217;s look at Export JSON Task form example to create JSON. Steps listed in below sections are very similar to JSON File Destination or JSON Generator Transform.</p>
<p>ZappySys offers innovative Layout Editor for JSON / XML creation from multiple sources. You can use Layout Editor to produce desired JSON Layout (Layout is stored in XML format behind the scene) and then in later step you will see how to make it dynamic so values are changed at runtime.</p>
<p>You can read layout as direct value, read from variable or read from file from disk.</p>
<h3>Select source connection for data</h3>
<p>First lets create new OLEDB or ADO.net connection from where we will read data. In our case we reading from Northwind Database.</p>
<div id="attachment_216" style="width: 565px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-216" class="size-full wp-image-216" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png" alt="SSIS JSON Export Task - Select Source Database Connection" width="555" height="218" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png 555w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection-300x118.png 300w" sizes="(max-width: 555px) 100vw, 555px" /></a><p id="caption-attachment-216" class="wp-caption-text">SSIS JSON Export Task &#8211; Select Source Database Connection</p></div>
<h3>Create Datasets</h3>
<p>Now add datasets which will be used to produce JSON File. One dataset will be always Root Dataset (Example: If your Root information is about customer then select customer table or query as your Main dataset. All other sections will be child sections)</p>
<div id="attachment_215" style="width: 419px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-215" class="size-full wp-image-215" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png" alt="Add SQL Dataset - Export JSON from SQL Query Option" width="409" height="431" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png 409w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset-285x300.png 285w" sizes="(max-width: 409px) 100vw, 409px" /></a><p id="caption-attachment-215" class="wp-caption-text">Add SQL Dataset &#8211; Export JSON from SQL Query Option</p></div>
<h3>Add Output Columns for Main JSON Document</h3>
<p>Now its time to add columns for our output. If * is added by default then remove. * means output all columns. When you add columns first make sure you select correct parent node under which you want to add columns. In our case &#8220;Mappings&#8221; is parent node.</p>
<div id="attachment_214" style="width: 391px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-214" class="size-full wp-image-214" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png" alt="Add Output Columns for JSON Document - Column Selection Screen" width="381" height="446" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png 381w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns-256x300.png 256w" sizes="(max-width: 381px) 100vw, 381px" /></a><p id="caption-attachment-214" class="wp-caption-text">Add Output Columns for JSON Document &#8211; Column Selection Screen</p></div>
<h3>Add JSON Array / JOIN Conditions for related document</h3>
<p>Now let&#8217;s look at how to add JSON Array. For example Customer may have one or more Orders so we need to add node called Orders which may Produce JSON fragment like below</p>
<pre class="crayon-plain-tag">Orders : [ {...} , {...} ] </pre>
<p>Once customer related columns added, its time to add Orders section.</p>
<ol>
<li>This is Array of documents so first highlight &#8220;Mappings&#8221; node</li>
<li>Click &#8220;Add Document Array&#8221; option from toolbar.</li>
<li>On Add/Edit Elements UI specify name for JSON Attribute and specify correct relationship to parent dataset. In our case Orders related to Customers using CustomerID key.</li>
</ol>
<div id="attachment_212" style="width: 548px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-212" class="size-full wp-image-212" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png" alt="Add Child Section - nested JSON document , Define Parent-Child Relationship" width="538" height="432" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png 538w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation-300x241.png 300w" sizes="(max-width: 538px) 100vw, 538px" /></a><p id="caption-attachment-212" class="wp-caption-text">Add Child Section &#8211; nested JSON document , Define Parent-Child Relationship</p></div>
<h3>Handling JSON Array with dummy root dataset (Multiple Arrays)</h3>
<p>So in previous section we saw how to add array and define JOIN condition with parent dataset. Now what if you really have no parent dataset to join with ? For example we need to produce following sample JSON where Order array is related to Customer by common Column CustomerID as JOIN column. But Customer is not bound with any parent column. So how do you define JOIN condition? In such case you have to use below technique called dummy root dataset. (See next section on how to handle only one dataset using <strong>Single Dataset Array Mode</strong>)</p>
<p><strong>Sample JSON (Dummy root pattern)</strong></p><pre class="crayon-plain-tag">{
    "Customers": [
      {
        "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste",
        "Orders": [
          {
            "OrderID": 1000,
            "OrderDate": "2015-12-01"
          },
          {
            "OrderID": 1001,
            "OrderDate": "2015-12-01"
          }
        ]
      },

      {
        "CustomerID": "ANATR",
        "CompanyName": "Ana Trujillo Emparedados y helados",
        "Orders": [
          {
            "OrderID": 1002,
            "OrderDate": "2015-12-01"
          },
          {
            "OrderID": 1003,
            "OrderDate": "2015-12-01"
          }
        ]
      }

    ]
  }
}</pre><p>
Since root level always needs dataset, we must provide dummy dataset (only one row) even though there is no need for Parent Dataset JOIN in Customer Array. Typically you can write query like below to product dummy row in SQL Server or other database using OLEDB Source or Use <a href="https://zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">Dummy Data Source</a> with Max Rows=1 setting to produce one fake record.</p><pre class="crayon-plain-tag">SELECT 1 as Col1</pre><p>
<strong>Using Dummy DataSource as Input</strong></p>
<p>For generating JSON which needs dummy root. Perform the following steps</p>
<ol>
<li>Drag Dummy Data Source from SSIS Toolbox. Change <strong>How many rows</strong> to 1. Click OK</li>
<li>Now drag two more OLEDB sources and Configure (e.g. Customers and Orders)</li>
<li>Now drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-destination-connector/">ZS JSON FIle Destination</a> component or <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/">ZS JSON Generator</a></li>
<li>Now connect Dummy datasource then Customers and then Orders</li>
<li>Double click JSON component to configure layout. You may notice that Dummy Input is set as Root by default.</li>
<li>You can now select Mappings node and click on Add Array Documents icon. Configure like below. Notice we have not selected any JOIN criteria because its joined with Dummy Root.
<div id="attachment_5357" style="width: 785px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5357" class="size-full wp-image-5357" src="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png" alt="Add array to join with dummy dataset" width="775" height="617" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png 775w, https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export-300x239.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export-768x611.png 768w" sizes="(max-width: 775px) 100vw, 775px" /></a><p id="caption-attachment-5357" class="wp-caption-text">Add array to join with dummy dataset</p></div></li>
<li>Now select newly added node and Click Add column icon to add CustomerID, CompanyName column under Customers array</li>
<li>Now select Customers array node and click Array Documents icon to Add Orders array.</li>
<li>Once Orders Array ia added you can Select Orders node and Insert new element to add OrderID and OrderDate columns</li>
<li>Finally it will look like below
<div id="attachment_5358" style="width: 943px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5358" class="size-full wp-image-5358" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png" alt="JSON File Destination - Generate JSON in SSIS from multiple inputs" width="933" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png 933w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-300x252.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-768x645.png 768w" sizes="(max-width: 933px) 100vw, 933px" /></a><p id="caption-attachment-5358" class="wp-caption-text">JSON File Destination &#8211; Generate JSON in SSIS from multiple inputs</p></div></li>
</ol>
<p>&nbsp;</p>
<h3>Single dataset used as array</h3>
<p>Now lets look at one more pattern just like described in the previous section but now we have just one nested level (Only customers and not using Orders). If you have such case then choose Single dataset pattern option in the output mode. On Export Task you may see as check box rather than dropdown. To produced desired JSON (see blow) perform these steps.</p>
<ol>
<li>Select Output mode as <strong>Single Dataset Array</strong></li>
<li>In your Layout builder click on <strong>Add Document Array</strong> Icon and name it &#8220;Customers&#8221;.</li>
<li>After that highlight newly added node &gt; Right-Click &gt; <strong>Add Elements</strong> under that node</li>
<li>That&#8217;s it you will now see preview like below.</li>
</ol>
<pre class="crayon-plain-tag">{
    "Customers": [
      {
        "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste"
      },

      {
        "CustomerID": "ANATR",
        "CompanyName": "Ana Trujillo Emparedados y helados"
      }
    ]
  }
}</pre>
&nbsp;</p>
<h3>How to export JSON in 2D Array format</h3>
<p>If you have to export JSON as 2D array format then you can change following option.</p>
<p><img decoding="async" class="figureimage" title="SSIS Export to JSON File Task - Export as 2D Array" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-json-file-task/ssis-export-json-2d-array-format.png" alt="SSIS Export JSON File Task - Export as 2D Array" /></p>
<p>Here are examples of output for each option.<br />
Select say you have source data with 2 columns <i>id</i> and <i>name</i>.</p>
<p><b>Default</b></p><pre class="crayon-plain-tag">[{id:1,name:&quot;AA&quot;}, {id:2,name:&quot;BB&quot;}]</pre><p>
<b>Multicontent</b></p><pre class="crayon-plain-tag">{id:1,name:&quot;AA&quot;}{id:2,name:&quot;BB&quot;}</pre><p>
<b>ArrayDocs</b></p><pre class="crayon-plain-tag">[{id:1,name:&quot;AA&quot;}, {id:2,name:&quot;BB&quot;}]</pre><p>
<b>Array2D</b></p><pre class="crayon-plain-tag">[[1,&quot;AA&quot;],[2,&quot;BB&quot;]]</pre><p>
<b>Array2DWithHeader</b></p><pre class="crayon-plain-tag">[[&quot;id&quot;,&quot;name&quot;],[1,&quot;AA&quot;],[2,&quot;BB&quot;]]</pre><p>
<b>ArrayLines</b></p><pre class="crayon-plain-tag">[1,&quot;AA&quot;][2,&quot;BB&quot;]</pre><p>
<b>ArrayLinesWithHeader</b></p><pre class="crayon-plain-tag">[&quot;id&quot;,&quot;name&quot;][1,&quot;AA&quot;][2,&quot;BB&quot;]</pre><p>
&nbsp;</p>
<h3>Preview JSON output using live preview</h3>
<p>You can enable / disable Live preview of JSON layout as below.</p>
<div id="attachment_210" style="width: 573px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-210" class="size-full wp-image-210" src="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png" alt="JSON Output preview in SSIS Export JSON File Task" width="563" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png 563w, https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis-300x253.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-210" class="wp-caption-text">JSON Output preview in SSIS Export JSON File Task</p></div>
<h2>Make things dynamic (Using SSIS Variable for SQL or Layout)</h2>
<p>There will be a time when you have use dynamic values in your JSON generation. You may have to Alias something from variable or you have to supply Variable in your SQL used for Dataset. Not to worry. ZappySys Supports multiple ways to make it dynamic. You can use SSIS Variables following 3 ways to make Layout XML dynamic.</p>
<ol>
<li>Use SSIS variable inside Dataset SQL (Only for <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">ZS Export JSON Task</a>)</li>
<li>Anywhere inside Layout XML (Click <strong>Edit Code</strong> option)</li>
<li>Load Layout From Variable (Indirect Method)</li>
</ol>
<h3>Using Variable inside Dataset SQL</h3>
<p>Here is how you can use Variable inside dataset SQL for <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">ZS Export JSON Task</a></p>
<div id="attachment_5359" style="width: 736px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5359" class="size-full wp-image-5359" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png" alt="SSIS Export JSON Task - Using Variable for Dynamic SQL" width="726" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png 726w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable-300x222.png 300w" sizes="(max-width: 726px) 100vw, 726px" /></a><p id="caption-attachment-5359" class="wp-caption-text">SSIS Export JSON Task &#8211; Using Variable for Dynamic SQL</p></div>
<h3>Using Variable inside Layout XML</h3>
<p>Here is how you can insert SSIS Variable anywhere in Layout XML. In below Example we are choosing Alias for one column from some SSIS Variable.</p>
<div id="attachment_5360" style="width: 865px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5360" class="size-full wp-image-5360" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png" alt="SSIS JSON File Destination - Using SSIS Variable for Dynamic Layout" width="855" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png 855w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout-768x531.png 768w" sizes="(max-width: 855px) 100vw, 855px" /></a><p id="caption-attachment-5360" class="wp-caption-text">SSIS JSON File Destination &#8211; Using SSIS Variable for Dynamic Layout</p></div>
<h3>Load Layout From Variable</h3>
<p>If you have some need to load Layout XML from File or SSIS Variable. You can use Load Layout from Variable Option.</p>
<p>For example in below screenshot we are creating layout first and ave to some variable. Or you can load from external file using <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a>.  Connect Logging task to Export JSON Task and you ready to produce JSON.</p>
<div id="attachment_222" style="width: 732px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-222" class="size-full wp-image-222" src="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png" alt="Set SSIS Variable value (multi-line content using placeholder)" width="722" height="528" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png 722w, https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder-300x219.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-222" class="wp-caption-text">Set SSIS Variable value (multi-line content using placeholder)</p></div>
<p>Here is how to load Layout From any SSIS Variable. You can also load Layout from XML file or Variable which contains layout File Path.</p>
<div id="attachment_210" style="width: 573px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-210" class="wp-image-210 size-full" src="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png" alt="JSON Layout from SSIS Variable" width="563" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png 563w, https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis-300x253.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-210" class="wp-caption-text">JSON Layout from SSIS Variable</p></div>
<h2>Other JSON Output Options</h2>
<p>Execute package and verify generated JSON it should look like below (Date format may be different in your case if you have set different on JSON options tab). For clarity we have formatted JSON below but in your output it may be compact version so reduce file size.</p>
<h3>Indent JSON Output</h3>
<p>You can check Indent option to make JSON look pretty like below.</p><pre class="crayon-plain-tag">{
  "CustomerID": "ALFKI",
  "CompanyName": "Alfreds Futterkiste",
  "ContactName": null,
  "Orders": [
    {
      "OrderID": 10643,
      "OrderDate": "1997-08-25T00:00:00"
    },
    {
      "OrderID": 10692,
      "OrderDate": "1997-10-03T00:00:00"
    },
    {
      "OrderID": 10702,
      "OrderDate": "1997-10-13T00:00:00"
    },
    {
      "OrderID": 10835,
      "OrderDate": "1998-01-15T00:00:00"
    },
    {
      "OrderID": 10952,
      "OrderDate": "1998-03-16T00:00:00"
    },
    {
      "OrderID": 11011,
      "OrderDate": "1998-04-09T00:00:00"
    }
  ]
}</pre><p>
<h3>Hide NULL Attribute Option</h3>
<p>There will be a time when you want to Hide NULL attribute rather than showing <strong>MyAttr: null</strong> this is also possible by checking Hide NULL Attribute Option on Options Tab.</p>
<h2>Export JSON to Amazon S3, Azure Blob, Secure FTP (SFTP / FTPS)</h2>
<p>Export JSON Task support some really good options to save file to other than local file system. If you want to export JSON directly to Amazon / Azure Cloud or FTP Server without saving to local disk then you can use Azure / FTP / Amazon Connection Manager on Target Tab of Export JSON Task. This option is only available for <strong>PRO Edition</strong> Users.</p>
<div style="width: 666px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-json-file-task/ssis-export-sql-tables-to-json-file-azure-blob-amazon-s3-secure-ftp-split-gzip-compress.png" alt="Export JSON / CSV / XML Files to Azure Blob, Amazon S3, Secure FTP Storage" width="656" height="440" /><p class="wp-caption-text">Export JSON / CSV / XML Files to Azure Blob, Amazon S3, Secure FTP Storage</p></div>
<h2>Conclusion</h2>
<p>If you want to output JSON from SQL Server or any other relational DB then its not simple task in SSIS specially when you have nested JSON documents (e.g. Customer-&gt;Orders). In this post you have seen how to use <a href="//zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/">SSIS JSON Export Task</a> to generate nested JSON from multiple datasets.</p>
<p>The post <a href="https://zappysys.com/blog/export-json-from-sql-server-using-ssis/">5 Ways to Export JSON from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
