<?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 Trash Destination Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/components/ssis-trash-destination/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/components/ssis-trash-destination/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 05 Mar 2026 01:25:16 +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 Trash Destination Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/components/ssis-trash-destination/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Get Office 365 Mail Attachments using SSIS</title>
		<link>https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 22 Feb 2020 08:27:34 +0000</pubDate>
				<category><![CDATA[REST API]]></category>
		<category><![CDATA[SSIS JSON Parser Transform]]></category>
		<category><![CDATA[SSIS JSON Source (File/REST)]]></category>
		<category><![CDATA[SSIS OAuth Connection]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS Trash Destination]]></category>
		<category><![CDATA[SSIS WEB API Destination]]></category>
		<category><![CDATA[attachments]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[office 365]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=8791</guid>

					<description><![CDATA[<p>Introduction In our previous article, we saw how to get Office 365 data in Power BI. Now, let’s look at how to get Office 365 Mail Attachments using SSIS without any coding. Microsoft Graph API is a unified way to access many Microsoft services, including the Office 365 API. In this post, we will use the SSIS [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/">How to Get Office 365 Mail Attachments using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<div class="su-note"  style="border-color:#e5dd9d;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:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>UPDATE:</strong> ZappySys has released a brand new <a href="https://zappysys.com/api/integration-hub/outlook-mail-connector/ssis">Outlook Mail (Office 365) connector</a>, which makes it much simpler to <strong>download attachments, read/search emails, users, mail folders, send email, and more in SSIS</strong> compared to the steps listed in this article. You can still use the steps from this article, but if you are new to APIs or want to avoid the learning curve, use a newer approach.</div></div>
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png"><img decoding="async" class="alignleft wp-image-1694" src="//zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png" alt="" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration.png 241w, https://zappysys.com/blog/wp-content/uploads/2017/08/microsoft-office-365-api-integration-150x150.png 150w" sizes="(max-width: 100px) 100vw, 100px" /></a><span style="box-sizing: border-box; margin: 0px; padding: 0px;">In our previous article, we saw <a href="https://zappysys.com/blog/get-office-365-data-in-power-bi-using-microsoft-graph-api-and-odbc/" target="_blank" rel="noopener">how to get Office 365 data in Power BI</a>.</span> Now, let’s look at how to get Office 365 Mail Attachments using SSIS without any coding. <a href="https://developer.microsoft.com/en-us/graph/docs/concepts/overview" target="_blank" rel="noopener">Microsoft Graph API</a> is a unified way to access many Microsoft services, including the <strong>Office 365 API</strong>. In this post, we will use the <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">SSIS JSON</a><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><a target="_blank" rel="noopener">/REST API Source Connector</a> to retrieve the Outlook Messages list and its attachments</span>.</p>
<h2></h2>
<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>Use Case of Microsoft Graph API</h2>
<p>Here are some use cases for why you want to use the Microsoft Graph API</p>
<ul>
<li>Read/Write events from <strong>Outlook Calendar</strong></li>
<li>Send <strong>email</strong>  / Read <strong>emails</strong></li>
<li>Get the list of files from <strong>OneDrive</strong></li>
<li>Upload/ Download files to <strong>OneDrive</strong></li>
<li>Read/Write <strong>Excel Sheet</strong> (Use range or a specific range of a specific sheet)</li>
<li>Read <b>the SharePoint</b> Document library</li>
<li>Search content from <b>the SharePoint</b> document library</li>
<li>Get AD users for your Organization (AD Accounts)</li>
<li>Update OneNote</li>
<li>Track changes to Users, Events, Calendar Items using the <a href="https://developer.microsoft.com/en-us/graph/docs/concepts/delta_query_overview" target="_blank" rel="noopener">delta API</a></li>
</ul>
<div class="content_block" id="custom_post_widget-5670"><h2 style="text-align: left;">Register Application (OAuth2 App for Graph API)</h2>
<p style="text-align: left;">The first step to access any Office 365 API / Graph API is to register an OAuth App in the Azure Portal. After
following these steps, you will get the following two items to use in the next section:</p>

<ul style="text-align: left;">
 	<li>Application Id</li>
 	<li>Application Secret</li>
</ul>
<p style="text-align: left;">In this section, you will learn how to register a custom app in Microsoft Azure portal that will allow access to the
OneDrive. So, let's get started -</p>

<ol>
 	<li style="text-align: left;">Log into <a href="https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps">Microsoft
Azure portal</a> to register a custom app.</li>
 	<li style="text-align: left;">Register a new application by clicking New Registration link.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png"><img fetchpriority="high" decoding="async" class="size-full wp-image-9034" src="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png" alt="New App Registration in Azure portal" width="748" height="221" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration.png 748w, https://zappysys.com/blog/wp-content/uploads/2020/07/NewRegistration-300x89.png 300w" sizes="(max-width: 748px) 100vw, 748px" /></a></li>
 	<li style="text-align: left;">Provide the name of the custom app and who can access the app in the organization.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9005 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg" alt="Register an OneDrive App" width="610" height="518" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1.jpg 610w, https://zappysys.com/blog/wp-content/uploads/2020/07/RegisterOneDriveApp-1-300x255.jpg 300w" sizes="(max-width: 610px) 100vw, 610px" /></a></li>
 	<li style="text-align: left;">Go to the App overview and add a Redirect URL.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg"><img loading="lazy" decoding="async" class="wp-image-9044 size-full" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg" alt="Add a Redirect URL" width="937" height="122" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1.jpg 937w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-300x39.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI-1-768x100.jpg 768w" sizes="(max-width: 937px) 100vw, 937px" /></a></li>
 	<li style="text-align: left;">Click on "Add a Platform" under Platform Configuration section and then select "Web" under Web applications
section to enter a Redirect URL.
<pre class="lang:default decode:true">https://zappysys.com/oauth</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9007" src="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg" alt="Redirect URL" width="466" height="564" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2.jpg 466w, https://zappysys.com/blog/wp-content/uploads/2020/07/RedirectURI2-248x300.jpg 248w" sizes="(max-width: 466px) 100vw, 466px" /></a></li>
 	<li style="text-align: left;">Create a Client Secret key which will be used to Authenticate the custom Azure app.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9010" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg" alt="Add a Client Secret" width="576" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret.jpg 576w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret-300x210.jpg 300w" sizes="(max-width: 576px) 100vw, 576px" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9011" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret2.jpg" alt="Secret Key Expiration Period" width="208" height="259" /></a><a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9012" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg" alt="Specify Secret Key" width="1024" height="176" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3.jpg 1024w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-300x52.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret3-768x132.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></a>
<div><strong>Note</strong> - Take a note of <strong>Client Secret</strong>, it will be required while
configuring OAuth connection in the SSIS later</div></li>
 	<li style="text-align: left;">Add API Permissions.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9008" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions.jpg" alt="OneDrive API Permissions" width="1291" height="415" /></a></li>
 	<li style="text-align: left;">Select following permissions from the Delegated Permissions section.
<pre class="lang:default decode:true">User.ReadBasic.All
Files.Read
offline_access</pre>
<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg"><img loading="lazy" decoding="async" class="size-full wp-image-9009" src="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg" alt="Select Delegated Permissions" width="512" height="571" srcset="https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2.jpg 512w, https://zappysys.com/blog/wp-content/uploads/2020/07/APIPermissions2-269x300.jpg 269w" sizes="(max-width: 512px) 100vw, 512px" /></a></li>
 	<li>Take a note of Client ID, it will be required while configuring OAuth connection in the SSIS later.<a href="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg"><img loading="lazy" decoding="async" class="wp-image-9013 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2020/07/ClientSecret4.jpg" alt="App Client ID" width="810" height="274" /></a></li>
</ol></div>
<h2>Step-By-Step to call the Microsoft Graph Rest API Using SSIS</h2>
<p>Now, let&#8217;s look at examples to access your Outlook.com emails using SSIS. You can use the same techniques to call pretty much any Office 365 API.</p>
<h3>Configure SSIS OAuth Connection for Graph REST API</h3>
<p>The first step to access any Graph API is to configure an OAuth connection</p>
<ol>
<li>Open Visual Studio</li>
<li>Open an existing SSIS Project or create a new one using File &gt; New &gt; Project &gt; Choose “Integration Services Project” Type under Business Intelligence template category.</li>
<li>Create Package</li>
<li>Right-click inside the Connection Managers area and click <strong>New Connection…</strong></li>
<li>From the connection type list, select the <strong>ZS-OAUTH</strong> connection type.
<div id="attachment_11825" style="width: 959px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11825" class="size-full wp-image-11825" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png" alt="" width="949" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager.png 949w, https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager-300x141.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/Create-a-new-SSIS-OAuth-API-Connection-Manager-768x362.png 768w" sizes="(max-width: 949px) 100vw, 949px" /></a><p id="caption-attachment-11825" class="wp-caption-text">Create a new SSIS OAuth API Connection Manager</p></div></li>
<li>On the OAuth Connection Manager, configure the following options
<ol style="list-style-type: lower-alpha;">
<li>Select &#8220;Custom&#8221; from the Provider dropdown</li>
<li>Select OAuth2 from the OAuth version</li>
<li>Enter your Application Id and Secret Key (i.e., App Password) obtained in the previous section <a href="https://apps.dev.microsoft.com/#/appList" target="_blank" rel="noopener">from here</a>.</li>
<li>Enter the following URL in the Authorization URL<br />
<pre class="crayon-plain-tag">https://login.microsoftonline.com/common/oauth2/v2.0/authorize</pre>
</li>
<li>Use the following URL in the token URL field<br />
<pre class="crayon-plain-tag">https://login.microsoftonline.com/common/oauth2/v2.0/token</pre>
</li>
<li>Enter the following <a href="https://developer.microsoft.com/en-us/graph/docs/authorization/permission_scopes" target="_blank" rel="noopener">Graph API Scopes</a> (each scope must be entered on a new line).<br />
<pre class="crayon-plain-tag">user.read
mail.read
offline_access</pre>
<div class="su-note"  style="border-color:#e5dd9d;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:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: Always include <strong>the offline_access</strong> scope, which returns a refresh_token, which allows you to renew the token without going through the login process again. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">For more information about which scopes are needed, always refer to the API help page (e.g., if you want to read mail using <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_messages" target="_blank" rel="noopener">this API,</a> then you will see it says you can use <strong>Mail.Read</strong> or <strong>Mail.ReadWrite</strong> scope).</span></div></div></li>
<li>Go to the <strong>Advanced tab</strong> and enter the following URL in the Callback/Return URL (assuming the same URL used when you registered the App in the previous section)<br />
<pre class="crayon-plain-tag">https://zappysys.com/oauth</pre>
</li>
<li>Now go back to the first tab and click Generate Token. When prompted, log in using your Personal Microsoft Account or Work Account (Office 365 or AD login)</li>
<li>After logging in, you will see the Accept option. Just click it. If things go right, then you will see the Access Token and Refresh Token fields populated.</li>
</ol>
</li>
<li>Once everything is configured, you can click <strong>Test Connection</strong> to verify the connection works.
<div class="mceTemp"></div>
<div id="attachment_11832" style="width: 713px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11832" class="size-full wp-image-11832" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png" alt="" width="703" height="754" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API.png 703w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-OAuth-Connection-Manager-for-Office-365-REST-API-Microsoft-Graph-API-280x300.png 280w" sizes="(max-width: 703px) 100vw, 703px" /></a><p id="caption-attachment-11832" class="wp-caption-text">SSIS OAuth Connection Manager for Office 365 REST API Microsoft Graph API</p></div></li>
</ol>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">NOTE: Typically, RefreshToken is long-lived, but in some cases, they may expire soon too. If that’s the case, then you can configure the above OAuth connection to change the refresh token pattern. Simply enter the token file path and re-authenticate by clicking Generate Token. After that, each time you make an API call, it will save a new refresh token in the file.</div></div>
<h3>Download the Messages Attachment Files from Outlook</h3>
<p>Let’s start with an example. We use the SSIS JSON Source and Web API Destination components to make a call to the Microsoft Graph REST API.</p>
<ol>
<li>First of all, drag and drop the <strong>Data Flow Task</strong> from the SSIS Toolbox and double-click it to edit.
<div id="attachment_11784" style="width: 485px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11784" class="size-full wp-image-11784" src="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png" alt="" width="475" height="178" srcset="https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow.png 475w, https://zappysys.com/blog/wp-content/uploads/2026/02/Drag-and-drop-Data-flow-300x112.png 300w" sizes="(max-width: 475px) 100vw, 475px" /></a><p id="caption-attachment-11784" class="wp-caption-text">Drag and drop Data flow</p></div></li>
<li>From the SSIS toolbox, drag and drop the<strong> JSON Source</strong> onto the Data Flow Designer surface.
<div class="mceTemp"></div>
<div id="attachment_11533" style="width: 553px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11533" class="size-full wp-image-11533" src="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png" alt="" width="543" height="146" srcset="https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag.png 543w, https://zappysys.com/blog/wp-content/uploads/2015/09/ssis-json-source-adapter-drag-300x81.png 300w" sizes="(max-width: 543px) 100vw, 543px" /></a><p id="caption-attachment-11533" class="wp-caption-text">SSIS JSON Source &#8211; Drag and Drop</p></div></li>
<li>Double-click the <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-source/?"><strong>JSON Source</strong></a>, then enter the following URL to invoke the Messages API call with search options to retrieve emails with attachments.<br />
<pre class="crayon-plain-tag">https://graph.microsoft.com/v1.0/me/messages?$select=sentDateTime,from,subject,hasAttachments&amp;$search="hasAttachments:True"</pre>
Set the filter to <code>$.value[*]</code> and click the preview.</p>
<div id="attachment_11831" style="width: 837px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11831" class="size-full wp-image-11831" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png" alt="" width="827" height="887" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example.png 827w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example-280x300.png 280w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-JSON-Source-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Read-Mail-Example-768x824.png 768w" sizes="(max-width: 827px) 100vw, 827px" /></a><p id="caption-attachment-11831" class="wp-caption-text">SSIS JSON Source – Get data from Microsoft Graph API (Office 365 API – Read Mail Example)</p></div>
<p>To customize the URL with additional parameters, check <a href="https://developer.microsoft.com/en-us/graph/docs/overview/query_parameters" target="_blank" rel="noopener">this help link</a>. It’s a standard OData Protocol, so you can leverage many common OData features (e.g., use $top parameters to set pageSize. Default is 10 for List Mail, but you can include more records per response by changing it, such as <strong>…/messages?$top=50</strong>).</li>
<li> Now, let&#8217;s use Template Transform to set the URL using the message ID to make the <a href="https://docs.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&amp;tabs=http" target="_blank" rel="noopener">Get attachment API</a> call.</p><pre class="crayon-plain-tag">https://graph.microsoft.com/v1.0/me/messages/&lt;%id%&gt;/attachments</pre><p>
<div id="attachment_11833" style="width: 848px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11833" class="size-full wp-image-11833" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png" alt="" width="838" height="560" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id.png 838w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-300x200.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-768x513.png 768w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Template-Transform-sending-attachment-id-272x182.png 272w" sizes="(max-width: 838px) 100vw, 838px" /></a><p id="caption-attachment-11833" class="wp-caption-text">SSIS Template Transform sending attachment id</p></div>
<div class="mceTemp"></div>
</li>
<li>Now we need to use the <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/?_gl=1*1fgshu4*_up*MQ..*_gs*MQ..&amp;gclid=CjwKCAiAzZ_NBhAEEiwAMtqKy8lyVraD40LVoEOcaJPgdN6RaL8j21-KaDKKbrh3VFlYirORdiQ3MxoCtO8QAvD_BwE&amp;gbraid=0AAAAADhWWLJ5j927a8ePIZceRs447LN9W"><strong>Web API Destination</strong></a> to make the Get Attachment API call by message ID. Select the Input column for URL as that TemplateOutput.
<div id="attachment_11834" style="width: 733px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11834" class="size-full wp-image-11834" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png" alt="" width="723" height="775" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example.png 723w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Web-API-Destination-–-Get-data-from-Microsoft-Graph-API-Office-365-API-–-Get-Attachment-Example-280x300.png 280w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-11834" class="wp-caption-text">SSIS Web API Destination – Get data from Microsoft Graph API (Office 365 API – Get Attachment Example)</p></div></li>
<li>Now, the next step is to parse the JSON Response String of the get attachment api call. For that, we need to use a <strong><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/?utm_source=google&amp;utm_medium=cpc&amp;utm_campaign=22259122063&amp;utm_content=&amp;utm_term=&amp;gad_source=1&amp;gad_campaignid=22582753584&amp;gbraid=0AAAAADhWWLJ5j927a8ePIZceRs447LN9W&amp;gclid=CjwKCAiAzZ_NBhAEEiwAMtqKy1ZTPt9tVn9Xy9xU7z27q__H4RRoMa_SfgZg5L8maavtcr5HfzCl0RoC6_sQAvD_BwE">JSON Parser</a></strong>. Select the input as Web PAI Destination ResponseText and use the below sample JSON string to configure the metadata(Columns).<br />
<pre class="crayon-plain-tag">{"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users('support%40zappysys.com')/messages('AQMkADAwATMwMAItMDkyMC0zZTg4AC0wMAItMDAKAEYAAAP_JUy')/attachments"
,"value":[{"@odata.type":"#microsoft.graph.fileAttachment","@odata.mediaContentType":"text/plain"
,"id":"AQMkADAwATMwMAItMDkyMC0zZTg4AC0wMAItMDAKAEYAAAP_JUy_27M"
,"lastModifiedDateTime":"2020-02-21T07:36:16Z"
,"name":"Test.txt","contentType":"text/plain","size":870,"isInline":false
,"contentId":null,"contentLocation":null,"contentBytes":"VGVzdCBNZXNzYWdl"}]}</pre>
<div id="attachment_11828" style="width: 1043px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11828" class="size-full wp-image-11828" src="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png" alt="" width="1033" height="713" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example.png 1033w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-1024x707.png 1024w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-using-JSON-example-768x530.png 768w" sizes="(max-width: 1033px) 100vw, 1033px" /></a><p id="caption-attachment-11828" class="wp-caption-text">JSON Parser Transform &#8211; using JSON example</p></div>
<div class="mceTemp"></div>
</li>
<li> Now, in the JSON Parser, go to the Go-to columns Tab and set the <strong>contentBytes</strong> DataType to <strong>DT_IMAGE,</strong> and increase the other columns&#8217; <strong>DT_WSTR</strong> lengths by 1000 and 1500. We set contentBytes to the <strong>DT_IMAGE</strong>  datatype, which is like varbinary(MAX).
<div id="attachment_11829" style="width: 838px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11829" class="size-full wp-image-11829" src="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png" alt="" width="828" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype.png 828w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype-300x221.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/JSON-Parser-Transform-Columns-Tab-fix-the-datatype-768x567.png 768w" sizes="(max-width: 828px) 100vw, 828px" /></a><p id="caption-attachment-11829" class="wp-caption-text">JSON Parser Transform Columns Tab fix the datatype</p></div></li>
<li>Furthermore, in the next step, we need to use an SSIS Derived Column to set the FilePath where we want to save the attachments, and then concatenate the local file path with the attachment name column.
<div id="attachment_11830" style="width: 798px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11830" class="size-full wp-image-11830" src="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png" alt="" width="788" height="624" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1.png 788w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1-300x238.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/SSIS-Derived-Column-Add-New-Column-1-768x608.png 768w" sizes="(max-width: 788px) 100vw, 788px" /></a><p id="caption-attachment-11830" class="wp-caption-text">SSIS Derived Column: Add New Column</p></div></li>
<li>Finally, we need to use the <a href="https://docs.microsoft.com/en-us/sql/integration-services/data-flow/transformations/export-column-transformation?view=sql-server-ver15" target="_blank" rel="noopener">Export Column</a> Transform (Native) to export attachment bytes to a local file. It needs to know 2 upstream info Bytes and the target file path.
<div id="attachment_11827" style="width: 763px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11827" class="size-full wp-image-11827" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png" alt="" width="753" height="637" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration.png 753w, https://zappysys.com/blog/wp-content/uploads/2020/02/Export-Column-configuration-300x254.png 300w" sizes="(max-width: 753px) 100vw, 753px" /></a><p id="caption-attachment-11827" class="wp-caption-text">Export Column configuration</p></div></li>
<li>Make sure to attach the export column to some destination (e.g., our ZS Trash Destination); the engine might remove it. At the same time, it optimizes the runtime. It may remove all transformations that don&#8217;t have a destination, such as deploying the package to SQL Server, or when you set optimize in Visual Studio.</li>
<li>That&#8217;s it, execute the package, and it will download all the email attachments.
<div id="attachment_11826" style="width: 1050px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11826" class="size-full wp-image-11826" src="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png" alt="" width="1040" height="559" srcset="https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments.png 1040w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-1024x550.png 1024w, https://zappysys.com/blog/wp-content/uploads/2020/02/Downloaded-Mail-Attachments-768x413.png 768w" sizes="(max-width: 1040px) 100vw, 1040px" /></a><p id="caption-attachment-11826" class="wp-caption-text">Downloaded Mail Attachments</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>After all, in this article, we learned how to make a Microsoft Graph API REST API call. We used the <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS JSON / REST API Connector</a> to extract data from Outlook Mail using OAuth. Made the Get attachment API call using the <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">Web API Destination</a> and parsed the JSON response using the <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-parser-transform/" target="_blank" rel="noopener">JSON Parser</a>. And using the Native SSIS Export Column, we saved the export attachment&#8217;s bytes to a local file. 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 style="list-style-type: none;">
<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></li>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-web-api-destination.htm" target="_blank" rel="noopener">Web API Destination</a></li>
<li>Help File: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-json-parser-transform.htm" target="_blank" rel="noopener">JSON Parser Transform</a></li>
<li><a href="https://docs.microsoft.com/en-us/graph/overview" target="_blank" rel="noopener">Overview of the Microsoft Graph API</a></li>
</ul>
</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/get-office-365-mail-attachments-using-ssis/">How to Get Office 365 Mail Attachments using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Using SSIS Trash Destination and Dummy Data Source</title>
		<link>https://zappysys.com/blog/ssis-trash-destination-dummy-data-source-example/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 25 Jun 2019 11:57:47 +0000</pubDate>
				<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS Trash Destination]]></category>
		<category><![CDATA[Destination]]></category>
		<category><![CDATA[DummyData]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[Trash]]></category>
		<category><![CDATA[ZappySys]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7283</guid>

					<description><![CDATA[<p>Introduction In this article, you will learn Using SSIS Trash Destination and Dummy Data Source (FREE). You can write data into the file using Trash Destination, You can use Trash Destination to write data into a raw file from any source. We will use FREE Dummy Data Source to generate random data for testing purpose. [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-trash-destination-dummy-data-source-example/">Using SSIS Trash Destination and Dummy Data Source</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-7284 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/06/trash-destination.png" alt="" width="128" height="128" />In this article, you will learn Using SSIS Trash Destination and Dummy Data Source (FREE). You can write data into the file using Trash Destination, You can use Trash Destination to write data into a raw file from any source. We will use FREE Dummy Data Source to generate random data for testing purpose. Trash Destination can be used to terminate your dataflow pipeline without doing any expensive processing on incoming data. This component is very useful during testing where you want to focus on the source and transforms but don&#8217;t really care about the destination.</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>
</ol>
<h2>Components mention in this article</h2>
<div class="su-table su-table-alternate">
<table style="height: 44px;width: 307px">
<tbody>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter.png" alt="" width="40" height="40" /></a></td>
<td style="height: 22px;width: 247px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/trash-destination.htm" target="_blank" rel="noopener">ZS Trash Destination</a></td>
</tr>
<tr style="height: 22px">
<td style="height: 22px;width: 1px"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-source/ssis-dummy-data-source-adapter.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignnone wp-image-3074" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-source/ssis-dummy-data-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/dummydata-source.htm" target="_blank" rel="noopener">ZS Dummy Data Source</a></td>
</tr>
</tbody>
</table>
</div>
<h2>Getting Started</h2>
<p>SSIS ZS Trash Destination and Dummy Data Source are free. If you check save Data to file then by default all input columns are logged to file. If you wish to log the selected input column then use Advanced Editor. This component does not support an error output. Any bad random value ill cause error or Truncation (e.g. If your sample value is 5 characters long but output column length is set to 3 chars). If you have error output attached with RedirectRow option on error, Truncation then you can capture bad rows along with an exact reason of error.</p>
<h2>Write data into the file using Trash Destination</h2>
<h3>Overview</h3>
<p>In this tutorial, you will learn how to Using SSIS Trash Destination and Dummy Data Source.  Let&#8217;s use ZS DummyData Source to write data into ZS Trash Destination. Here you can select our, any of suitable <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-source-adapters.htm" target="_blank" rel="noopener">Source Adapter</a>.</p>
<h3><span id="Method_1_8211_Using_Template_Transform">Method 1 – Using ZS DummyData Source</span></h3>
<ol>
<li>Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Double click on the Data Flow task to see the Data Flow designer surface.</li>
<li>From the SSIS toolbox drag and drop ZS DummyData Source on the data flow designer surface.
<div style="width: 492px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/ssis-dummy-data-source-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/ssis-dummy-data-source-adapter-drag.png" alt="Drag and Drop ZS DummyData Source" width="482" height="120" /></a><p class="wp-caption-text">Drag and Drop ZS DummyData Source</p></div></li>
<li>Double click DummyData Source and select Customer profile from Template dropdown.</li>
<li>Once you change Template you will notice that a lot of columns automatically added. Notice how sample values are set for many columns along with their value delimiter. You may use many inbuilt placeholders in your sample values such as ({NULL} for a null value, {TAB} for the tab character, {CRLF} for new line).</li>
<li>Change [How many rows] setting to 5000.
<div style="width: 863px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/configure-dummydata-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/configure-dummydata-source.png" alt="SSIS DummyData Source - Configure" width="853" height="720" /></a><p class="wp-caption-text">SSIS DummyData Source &#8211; Configure</p></div></li>
<li>Click OK to save settings.</li>
<li>We can use DummyData Source like this, click <a href="https://zappysys.com/blog/export-json-from-sql-server-using-ssis/#Handling_JSON_Array_with_dummy_root_dataset_Multiple_Arrays" target="_blank" rel="noopener">here.</a></li>
<li>Here, you can insert data into SQL Server Table, Check <a href="https://zappysys.com/blog/read-sap-s4-hana-data-ssis-cloud-odata-rest-api/#Load_into_SAP_HANA_data_into_SQL_Server_using_OLEDB_Destination" target="_blank" rel="noopener">Here.</a></li>
<li>Now, Just Drag and Drop Our Free ZS Trash Destination on the data flow designer surface from SSIS Toolbox.
<div style="width: 529px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" alt="SSIS Trash Destination - Drag and Drop" width="519" height="121" /></a><p class="wp-caption-text">SSIS Trash Destination &#8211; Drag and Drop</p></div></li>
<li>Now single click on ZS DummyData Source once you see the blue arrow from the source &#8230; connect it to ZS Trash Destination.</li>
<li>Double click on ZS Trash Destination to configure it.
<div style="width: 622px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" alt="SSIS Trash Destination - Configure" width="612" height="523" /></a><p class="wp-caption-text">SSIS Trash Destination &#8211; Configure</p></div></li>
<li>Click OK to save configure setting UI.</li>
<li>Right-click on the path and Add Data Viewer.</li>
<li>Execute the package and verify source data in the data viewer.
<div style="width: 618px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/configure-dummydata-source-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/dummy-data-Source/configure-dummydata-source-2.png" alt="Execute Package and Verify Data Source" width="608" height="564" /></a><p class="wp-caption-text">Execute Package and Verify Data Source</p></div></li>
</ol>
<h3><span id="Method_1_8211_Using_Template_Transform">Method 2 – Using OLE DB Source</span></h3>
<p>Let&#8217;s use ZS OLE DB Source to write data into ZS Trash Destination.</p>
<ol>
<li>Open Visual Studio and Create New SSIS Package Project.</li>
<li>Now, Drag and Drop SSIS Data Flow Task from SSIS Toolbox.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>We are going through SQL Server Database, need OLE DB Connection for Data Source.</li>
</ol>
<h4>How to create OLE DB Connection.</h4>
<ol>
<li>Let&#8217;s, Right-click on Connection Managers Panel to Create OLEDB Connection, so you can use Source and Context Menu will appear, Select New OLEDB Connection from the Context Menu.
<div style="width: 485px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-1.png" alt="Create OLE DB Connection" width="475" height="353" /></a><p class="wp-caption-text">Create OLE DB Connection</p></div></li>
<li>Now, click on New button for create Connection.
<div style="width: 665px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-2.png" alt="Create New OLE DB Connection" width="655" height="558" /></a><p class="wp-caption-text">Create New OLE DB Connection</p></div></li>
<li>In the Connection Manager, just follow the steps in the following image we have created.
<div style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-new-oledb-connection-step-3.png" alt="OLE DB Connection Configure" width="720" height="625" /></a><p class="wp-caption-text">OLE DB Connection Configure</p></div></li>
<li>Click on OK button to save connection configure setting UI.</li>
</ol>
<h4>How to write into Trash Destination from OLE DB Source</h4>
<ol>
<li>Drag and Drop OLE DB Source from SSIS toolbox.
<div id="attachment_7289" style="width: 515px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7289" class="wp-image-7289 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" alt="OLE DB Source - Drag and Drop" width="505" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png 505w, https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop-300x113.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></a><p id="caption-attachment-7289" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div></li>
<li>Double click on OLE DB Source for configure it.</li>
<li>In the Connection Manager, just follow the steps in the following image we have created.
<div style="width: 828px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/oledb-connection-manager/ssis-oledb-source-editor-manager.png" alt="OLE DB Source - Configure" width="818" height="714" /></a><p class="wp-caption-text">OLE DB Source &#8211; Configure</p></div></li>
<li>Click on OK button to save OLE DB Source Editor setting UI.</li>
<li>Now, Just Drag and Drop Our Free ZS Trash Destination on the data flow designer surface from SSIS Toolbox.
<div style="width: 529px" class="wp-caption aligncenter"><a href="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://i1.wp.com/zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ssis-trash-destination-adapter-drag.png" alt="SSIS ZS Trash Destination - Drag and Drop" width="519" height="121" /></a><p class="wp-caption-text">SSIS ZS Trash Destination &#8211; Drag and Drop</p></div></li>
<li>Now, single click on OLE DB Source once you see the blue arrow from the source &#8230; connect it to ZS Trash Destination.</li>
<li>Double click on ZS Trash Destination to configure it.
<div style="width: 622px" class="wp-caption aligncenter"><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/trash-destination/ui-trash-destination-settings.png" alt="SSIS ZS Trash Destination - Configure" width="612" height="523" /></a><p class="wp-caption-text">SSIS ZS Trash Destination &#8211; Configure</p></div></li>
<li>Click OK to save configure setting UI.</li>
<li>Right-click on the path and Add data viewer.</li>
<li>Execute the package and verify source data in the data viewer.
<div id="attachment_7290" style="width: 655px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/execute-trash-destination-with-oledb-source.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7290" class="wp-image-7290 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/execute-trash-destination-with-oledb-source.png" alt="Execute Package and Verify Data" width="645" height="586" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/execute-trash-destination-with-oledb-source.png 645w, https://zappysys.com/blog/wp-content/uploads/2019/06/execute-trash-destination-with-oledb-source-300x273.png 300w" sizes="(max-width: 645px) 100vw, 645px" /></a><p id="caption-attachment-7290" class="wp-caption-text">Execute Package and Verify Data</p></div></li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to write data into a raw file and read data in SSIS. We used the Trash Destination for write data and Dummy Data Source to read data. You can <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">download SSIS PowerPack from here</a> to try many other scenarios not discussed in this blog. SSIS PowerPack is a collection of 70+ high performance, just drag and drop connector/task for SSIS(i.e. Microsoft SQL Server Integration Service). After you install SSIS PowerPack you will see many new Custom Tasks and Components in your Visual Studio SSIS Toolbox.</p>
<h2>References</h2>
<p>Finally, you can use the following links for more information:</p>
<ul>
<li>ZS Trash Destination</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">ZS Dummy Data Source</a></li>
<li>Help File:
<ul>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/trash-destination.htm" target="_blank" rel="noopener">ZS Trash Destination</a></li>
<li><a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/dummydata-source.htm" target="_blank" rel="noopener">ZS Dummy Data Source</a></li>
</ul>
</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/ssis-trash-destination-dummy-data-source-example/">Using SSIS Trash Destination and Dummy Data Source</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to convert Varbinary to Base64 in SSIS</title>
		<link>https://zappysys.com/blog/convert-varbinary-base64-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 30 Jan 2019 00:38:10 +0000</pubDate>
				<category><![CDATA[SSIS Set Variable Transform]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[SSIS Trash Destination]]></category>
		<category><![CDATA[base64]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6255</guid>

					<description><![CDATA[<p>Introduction In this post we will show you how to convert varbinary to Base64 in SSIS. We will use FREE Tasks provided by ZappySys. Preparing Sample Data First let&#8217;s create a sample table with some Varbinary datatype. Run following command in SSMS to create a sample table with one sample row. [crayon-69d4a66e805bb682314680/] &#160; Method 1 [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/convert-varbinary-base64-ssis/">How to convert Varbinary to Base64 in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this post we will show you how to convert varbinary to Base64 in SSIS. We will use <a href="https://zappysys.com/free-ssis-transformations-components-tasks/">FREE Tasks</a> provided by ZappySys.</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>Preparing Sample Data</h2>
<p>First let&#8217;s create a sample table with some Varbinary datatype. Run following command in SSMS to create a sample table with one sample row.</p><pre class="crayon-plain-tag">create table binarydata(
 data varbinary(max)
)
go
insert into binarydata(data )
values(0x5468697320697320612074657374) /*binary of "This is a test"*/</pre><p>
&nbsp;</p>
<h2>Method 1 &#8211; Using Template Transform</h2>
<p>Let&#8217;s use <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-template-transform.htm" target="_blank" rel="noopener">Template Transform</a> to convert Varbinary data to Base64 format. When you use columns with binary data in Template transform it automatically converts to Base64 by default.</p>
<ol>
<li>Go to Data flow</li>
<li>Drag your OLEDB Source and configure it to outputs SQL Data with Varbinary column  (e.g. select data from dbo.binarydata).</li>
<li>Now drag <strong>ZS Template Transform</strong> from SSIS Toolbox</li>
<li>Connect OLEDB Source to Template Transform</li>
<li>Double click Template Transform  to configure. Now you can click <strong>Insert Placeholders</strong> &gt; <strong>Columns</strong> &gt; Select your <strong>Upstream column</strong> name (which has Varbinary data)</li>
<li>You will see Template text as  &lt;%MyVarBinaryColumn%&gt;</li>
<li>Click OK to Save Template Transform</li>
<li>Now connect Template transform to any Destination e.g. OLEDB Destination.  You can <strong>Map TemplateOutput</strong> column to target column. This will contain Base64 representation of Varbinary data. For example purpose we used ZS Trash destination (Check save to file)</li>
</ol>
<p>&nbsp;</p>
<div id="attachment_6256" style="width: 644px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-convert-varbinary-to-base64.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6256" class="size-full wp-image-6256" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-convert-varbinary-to-base64.png" alt="Convert Varbinary to BASE64 using SSIS Template Transform" width="634" height="488" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-convert-varbinary-to-base64.png 634w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-convert-varbinary-to-base64-300x231.png 300w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-6256" class="wp-caption-text">Convert Varbinary to BASE64 using SSIS Template Transform</p></div>
<h3>Save Base64 string to Variable</h3>
<p>In previous step we saw how Template Transform can convert binary data (i.e. Varbinary datatype) to BASE64 string. Now let&#8217;s look at how to save this value to Variable using <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-set-variable-transform.htm" target="_blank" rel="noopener">Set Variable Transform</a>.</p>
<div id="attachment_6273" style="width: 673px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-set-variable-transform-convert-binary-to-base64.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6273" class="size-full wp-image-6273" src="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-set-variable-transform-convert-binary-to-base64.png" alt="Using SSIS Set Variable Transform in Data flow (Capture binary data as base64 example)" width="663" height="625" srcset="https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-set-variable-transform-convert-binary-to-base64.png 663w, https://zappysys.com/blog/wp-content/uploads/2019/01/ssis-set-variable-transform-convert-binary-to-base64-300x283.png 300w" sizes="(max-width: 663px) 100vw, 663px" /></a><p id="caption-attachment-6273" class="wp-caption-text">Using SSIS Set Variable Transform in Data flow (Capture binary data as base64 example)</p></div>
<h2>Method 2 &#8211; Using Trash Destination</h2>
<p>Another way to dump Binary data to CSV file is use ZS Trans Destination. See previous screenshot. If you map OLEDB Source directly to Trash destination without Template Transform then you will see something like below.</p><pre class="crayon-plain-tag">data
VGhpcyBpcyBhIHRlc3Q=</pre><p>
&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/convert-varbinary-base64-ssis/">How to convert Varbinary to Base64 in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
