<?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 advanced file system task Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/ssis-advanced-file-system-task/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/ssis-advanced-file-system-task/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 11 Dec 2025 12:52:13 +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 advanced file system task Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/ssis-advanced-file-system-task/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to upload files on SharePoint Online using SSIS</title>
		<link>https://zappysys.com/blog/upload-files-sharepoint-online-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 29 Dec 2023 12:49:39 +0000</pubDate>
				<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[Foreach Loop Container]]></category>
		<category><![CDATA[sharepoint online]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[SSIS Power]]></category>
		<category><![CDATA[SSIS SharePoint Online Connector]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10902</guid>

					<description><![CDATA[<p>Introduction In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate SharePoint Online into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful SharePoint Online Connector that [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-sharepoint-online-using-ssis/">How to upload files on SharePoint Online using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/sharepoint-icon.jpg"><img loading="lazy" decoding="async" class="wp-image-3731 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/sharepoint-icon.jpg" alt="sharepoint icon" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/sharepoint-icon.jpg 225w, https://zappysys.com/blog/wp-content/uploads/2018/05/sharepoint-icon-150x150.jpg 150w" sizes="(max-width: 100px) 100vw, 100px" /></a>In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate SharePoint Online into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful <a href="https://zappysys.com/api/integration-hub/sharepoint-connector/">SharePoint Online Connector</a> that makes uploading files to SharePoint Online a breeze. In this guide, we&#8217;ll walk you through the process of uploading files to SharePoint Online using SSIS and the <a href="https://zappysys.com/api/integration-hub/sharepoint-connector/ssis">ZappySys SSIS PowerPack SharePoint Online Connector</a>.</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>Upload files to SharePoint Online with SSIS:</h2>
<p>In this section, we will learn how to configure and use SharePoint Online Connector in the API Source to upload files on SharePoint Online.</p>
<ol>
<li>Begin by opening Visual Studio and creating a new project.</li>
<li>Select Integration Service Project and in the new project window set the appropriate name and location for the project. Click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol style="list-style-type: lower-alpha;">
<li>SSIS ToolBox on the left sidebar</li>
<li>Solution Explorer and Property Window on the right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window at the bottom</li>
</ol>
<div id="attachment_10258" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/zappysys-ssis-project-with-toolbox/#main"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10258" class="wp-image-10258" src="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png" alt="zappysys ssis project with toolbox" width="700" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-768x490.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png 1287w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-10258" class="wp-caption-text">SSIS Toolbox &#8211; ZappySys Tasks</p></div>
<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>NOTE</strong>: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in the SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div></div></li>
<li>Now, Drag and Drop the SSIS Data Flow Task from the SSIS Toolbox. Double-click on the Data Flow Task to see the Data Flow Designer.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10260" src="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10263" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png" alt="" width="684" height="643" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png 684w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection-300x282.png 300w" sizes="(max-width: 684px) 100vw, 684px" /></a></li>
</ol>
<h2>Configuring the SharePoint Online Connector</h2>
<ol>
<li>Use a preinstalled SharePoint Online Connector from the Popular Connector List or press the Search Online radio button to download SharePoint Online Connector. Once downloaded simply use it in the configuration:
<div id="attachment_10888" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-sharepoint-walkthrough.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10888" class="wp-image-10888 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-sharepoint-walkthrough.png" alt="SSIS ZS API Connection Manager - Select SharePoint Online Connector" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-sharepoint-walkthrough.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-sharepoint-walkthrough-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-sharepoint-walkthrough-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10888" class="wp-caption-text">SSIS ZS API Connection Manager &#8211; Select SharePoint Online Connector</p></div></li>
<li>Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed.</li>
<li>After configuring all the required properties in the API Connection Manager, please click on the &#8220;Test Connection&#8221; button to confirm that the connection is established successfully.<br />
<h3>Method1: Connect to SharePoint Online using User Credentials [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/sharepoint-connector/help/authentication/UserCreds"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10884" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-generate-token-user-credentials.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10884" class="wp-image-10884 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-generate-token-user-credentials.png" alt="SSIS ZS API Connection Manager - Generate Token - SharePoint Online with User Credentials" width="866" height="814" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-generate-token-user-credentials.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-generate-token-user-credentials-300x282.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-generate-token-user-credentials-768x722.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10884" class="wp-caption-text">SSIS ZS API Connection Manager &#8211; Generate Token &#8211; SharePoint Online with User Credentials</p></div>
<h3>Method2: Connect to SharePoint Online using Application Credentials [OAuth]</h3>
<p>You may press a link, <a href="https://zappysys.com/api/integration-hub/sharepoint-connector/help/authentication/AppCreds"><strong>Steps to Configure</strong></a>, to help set specific parameters.</p>
<div id="attachment_10892" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-application-creds-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10892" class="size-full wp-image-10892" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-application-creds-generate-token.png" alt="SSIS API Source - Generate Token - SharePoint Online with Application Credentials" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-application-creds-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-application-creds-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-application-creds-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10892" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; SharePoint Online with Application Credentials</p></div></li>
</ol>
<h2>How to upload a local file to SharePoint Online</h2>
<p>In the API Source Component, we&#8217;ve chosen the API Connection Manager. Next, we need to configure the remaining properties of the component to upload a local file to SharePoint Online.</p>
<ol>
<li>Choose the <strong>Upload file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>Select the desired Drive ID from the <strong>DriveId</strong> drop-down.</li>
<li>Specify the desired source file path for the file being uploaded by setting the <strong>DiskFilePath</strong> parameter.</li>
<li>Specify the desired Target Path by setting the <strong>SharePointFilePath</strong> parameter.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10906" style="width: 1010px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10906" class="wp-image-10906" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1-1024x569.png" alt="SSIS API Source – SharePoint Online – Upload Single File" width="1000" height="555" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1-1024x569.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1-300x167.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1-768x426.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-single-file-upload-1.png 1410w" sizes="(max-width: 1000px) 100vw, 1000px" /></a><p id="caption-attachment-10906" class="wp-caption-text">SSIS API Source – SharePoint Online – Upload Single File</p></div>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to SharePoint Online using the <strong>ZappySys SharePoint Online Connector</strong> for uploading a local file to SharePoint Online.</p>
<h2>How to upload multiple files to SharePoint Online</h2>
<p>In the API Source Component, we&#8217;ve selected the API Connection Manager. Next, we need to configure the remaining properties of the component to upload multiple files to SharePoint Online. Additionally, we should utilize a Foreach Loop Container to iterate through each file one by one in a loop.</p>
<ol>
<li>Create 3 SSIS variables as described below.<br />
<table border="1">
<tbody>
<tr>
<th>Variable Name</th>
<th>Datatype</th>
<th>Value</th>
</tr>
<tr>
<td>varFileLists</td>
<td>Object</td>
<td>System.Object</td>
</tr>
<tr>
<td>varFileName</td>
<td>String</td>
<td>fake.extension</td>
</tr>
<tr>
<td>varFullFilePath</td>
<td>String</td>
<td>C:/fake/fake.extension</td>
</tr>
</tbody>
</table>
</li>
<li>Go to Control Flow, From the SSIS toolbox drag and drop <strong>ZS Advanced File System Task</strong> on the control flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10363" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png" alt="SSIS Advanced File System Task - Drag &amp; Drop" width="580" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png 580w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop-300x125.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></a></li>
<li>Select the &#8220;Get file list as ADO.NET Data Table&#8221; action from the Action drop-down menu. Set the file path in the Path textbox. Choose the variable (Object type) where you want to store the file list, and then click the OK button to save the settings.
<div id="attachment_10364" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10364" class="size-full wp-image-10364" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png" alt="SSIS Advanced File System Task - Get file list as ADO.net Data Table" width="712" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png 712w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable-300x263.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-10364" class="wp-caption-text">SSIS Advanced File System Task &#8211; Get file list as ADO.net Data Table</p></div></li>
<li>Now, drag and drop the &#8220;Foreach Loop Container&#8221; from the SSIS Toolbox and connect it with the &#8220;ZS Advanced File System Task.&#8221; Double-click on the &#8220;Foreach Loop Container&#8221; to edit its properties.
<div id="attachment_10365" style="width: 750px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10365" class="size-full wp-image-10365" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png" alt="SSIS Foreach Loop Container - Drag &amp; Drop" width="740" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png 740w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive-300x215.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><p id="caption-attachment-10365" class="wp-caption-text">SSIS Foreach Loop Container &#8211; Drag &amp; Drop</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Collection&#8221; tab, choose the Enumerator as &#8220;Foreach ADO Enumerator.&#8221; In the &#8220;ADO object source variable&#8221; field, select your SSIS object-typed variable. Select the &#8220;Rows in the first table&#8221; radio option.
<div id="attachment_10371" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10371" class="size-full wp-image-10371" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png" alt="SSIS Foreach Loop Editor - Collection - Select Variable &amp; Enumeration mode" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10371" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Collection &#8211; Select Variable &amp; Enumeration mode</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Variable Mappings&#8221; tab, select the variables that you want to map to the values from the collection, and then click the &#8220;OK&#8221; button to save your selections.
<div id="attachment_10370" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10370" class="size-full wp-image-10370" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png" alt="SSIS Foreach Loop Editor - Variable Mappings tab" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10370" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Variable Mappings</p></div></li>
<li>Inside the Foreach Loop Container, drag and drop the Data Flow Task, and then rename it according to your preference.
<div id="attachment_10854" style="width: 830px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10854" class="size-full wp-image-10854" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png" alt="SSIS Data Flow Task - Drag &amp; Drop inside Foreach Loop Container" width="820" height="428" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png 820w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload-300x157.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload-768x401.png 768w" sizes="(max-width: 820px) 100vw, 820px" /></a><p id="caption-attachment-10854" class="wp-caption-text">SSIS Data Flow Task &#8211; Drag &amp; Drop inside Foreach Loop Container</p></div></li>
<li>Double-click on the Data Flow Task to see the Data Flow Designer, From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="SSIS API Source - Drag &amp; Drop" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Double-click on the <strong>API Source</strong> component to configure it for uploading multiple files to SharePoint Online.
<ol style="list-style-type: lower-alpha;">
<li>Choose the <strong>Upload file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>Please specify the desired SSIS Variable [varFileName] containing the uploaded file name by setting the <strong>SharePointFilePath</strong> parameter.</li>
<li>To specify the desired local SSIS variable [varFullFilePath], which holds the file path, set the <strong>DiskFilePath</strong> parameter.<br />
When configuring the SSIS variable directly in the Raw Edit, JSON may become invalid due to the requirement of slashes within the local file path. To address this, we use a JSONENC Placeholder Function for proper escaping.<br />
<pre class="crayon-plain-tag">&lt;&lt;{{User::varUserFullFilePath}},FUN_JSONENC&gt;&gt;</pre></li>
<li>If you wish to upload the local file to a specific folder in SharePoint Online, please set the folderName in the <strong>SharePointFilePath </strong>parameter.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10904" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-multiple-files-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10904" class="size-full wp-image-10904" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-multiple-files-upload.png" alt="SSIS API Source – SharePoint Online – Upload Multiple files configuration" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-multiple-files-upload.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-multiple-files-upload-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-sharepoint-multiple-files-upload-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10904" class="wp-caption-text">SSIS API Source – SharePoint Online – Upload Multiple files configuration</p></div>
<p>To configure dynamic filenames and file paths, you can set variables. Click on &#8220;Raw Edit,&#8221; and in the &#8220;Edit Parameters&#8221; popup, you can use SSIS variables, as shown in the above image.</p>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call.<br />
After that, you can execute the SSIS Package and check the execution to upload multiple files on SharePoint Online. Below is the sample screenshot attached.</p>
<div id="attachment_10905" style="width: 1010px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10905" class="wp-image-10905" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint-1024x465.png" alt="Multiple files uploaded on SharePoint Online using SSIS" width="1000" height="454" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint-1024x465.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint-300x136.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint-768x349.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-sharepoint.png 1262w" sizes="(max-width: 1000px) 100vw, 1000px" /></a><p id="caption-attachment-10905" class="wp-caption-text">Multiple files uploaded on SharePoint Online using SSIS</p></div>
<p>With just a few clicks, we have successfully configured the call to SharePoint Online using the <strong>ZappySys SharePoint Online Connector</strong> for uploading multiple files to SharePoint Online.</li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to connect with SharePoint Online using SSIS API Connection Manager and upload single or multiple files to SharePoint Online using a combination of SSIS components, including the <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source component</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS ZS Advanced File System Task</a>, Foreach Loop Container, and SSIS variables.</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-sharepoint-online-using-ssis/">How to upload files on SharePoint Online using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to upload files on OneDrive using SSIS</title>
		<link>https://zappysys.com/blog/upload-files-onedrive-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 08 Dec 2023 06:03:06 +0000</pubDate>
				<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[Foreach Loop Container]]></category>
		<category><![CDATA[onedrive]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[upload files to OneDrive]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10847</guid>

					<description><![CDATA[<p>Introduction In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate OneDrive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful OneDrive Connector that makes uploading [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-onedrive-using-ssis/">How to upload files on OneDrive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2020/08/microsoft-onedrive-logo.png"><img loading="lazy" decoding="async" class="alignleft wp-image-9115" src="https://zappysys.com/blog/wp-content/uploads/2020/08/microsoft-onedrive-logo.png" alt="Download File from OneDrive in SSIS" width="100" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2020/08/microsoft-onedrive-logo.png 261w, https://zappysys.com/blog/wp-content/uploads/2020/08/microsoft-onedrive-logo-150x150.png 150w" sizes="(max-width: 100px) 100vw, 100px" /></a>In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate OneDrive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful <a href="https://zappysys.com/api/integration-hub/onedrive-connector/">OneDrive Connector</a> that makes uploading files to OneDrive a breeze. In this guide, we&#8217;ll walk you through the process of uploading files to OneDrive using SSIS and the <a href="https://zappysys.com/api/integration-hub/onedrive-connector/ssis">ZappySys SSIS PowerPack OneDrive Connector</a>.</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>Upload files to OneDrive with SSIS:</h2>
<p>In this section, we will learn how to configure and use OneDrive Connector in the API Source to upload files on OneDrive.</p>
<ol>
<li>Begin with opening Visual Studio and Creating a New Project.</li>
<li>Select Integration Service Project and in the new project window set the appropriate name and location for the project. Click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol style="list-style-type: lower-alpha;">
<li>SSIS ToolBox on the left sidebar</li>
<li>Solution Explorer and Property Window on the right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window at the bottom</li>
</ol>
<div id="attachment_10258" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/zappysys-ssis-project-with-toolbox/#main"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10258" class="wp-image-10258" src="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png" alt="zappysys ssis project with toolbox" width="700" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-768x490.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png 1287w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-10258" class="wp-caption-text">SSIS Toolbox &#8211; ZappySys Tasks</p></div>
<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>NOTE</strong>: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in the SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div></div></li>
<li>Now, Drag and Drop the SSIS Data Flow Task from the SSIS Toolbox. Double-click on the Data Flow Task to see the Data Flow Designer.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10260" src="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10263" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png" alt="" width="684" height="643" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png 684w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection-300x282.png 300w" sizes="(max-width: 684px) 100vw, 684px" /></a></li>
</ol>
<h2>Configuring the OneDrive Connector</h2>
<ol>
<li>Use a preinstalled OneDrive Connector from the Popular Connector List or press the Search Online radio button to download OneDrive Connector. Once downloaded simply use it in the configuration:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-onedrive-walkthrough.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10851" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-onedrive-walkthrough.png" alt="ssis onedrive template selection walkthrough" width="783" height="719" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-onedrive-walkthrough.png 783w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-onedrive-walkthrough-300x275.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-template-selection-onedrive-walkthrough-768x705.png 768w" sizes="(max-width: 783px) 100vw, 783px" /></a></li>
<li>Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed.</li>
<li>After configuring all the required properties in the API Connection Manager, please click on the &#8220;Test Connection&#8221; button to confirm that the connection is established successfully.<br />
<h3>Method1: Connect to OneDrive using User Credentials [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/onedrive-connector/help/authentication/UserCreds"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10850" style="width: 755px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-generate-token-user-credentials.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10850" class="wp-image-10850 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-generate-token-user-credentials.png" alt="SSIS API Source - Generate Token - OneDrive with User Credentials" width="745" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-generate-token-user-credentials.png 745w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-generate-token-user-credentials-285x300.png 285w" sizes="(max-width: 745px) 100vw, 745px" /></a><p id="caption-attachment-10850" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; OneDrive with User Credentials</p></div>
<h3>Method2: Connect to OneDrive using Application Credentials [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/onedrive-connector/help/authentication/AppCreds"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10849" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-application-creds-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10849" class="size-full wp-image-10849" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-application-creds-generate-token.png" alt="SSIS API Source - Generate Token - OneDrive with Application Credentials" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-application-creds-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-application-creds-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-application-creds-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10849" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; OneDrive with Application Credentials</p></div></li>
</ol>
<h2>How to upload a local file to OneDrive</h2>
<p>In the API Source Component, we&#8217;ve chosen the API Connection Manager. Next, we need to configure the remaining properties of the component to upload a local file to OneDrive.</p>
<ol>
<li>Choose the <strong>Upload file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>Select the desired Drive ID from the <strong>DriveId</strong> drop-down.</li>
<li>Specify the desired source file path for the file being uploaded by setting the <strong>SourceFilePath</strong> parameter.</li>
<li>Specify the desired Target Path by setting the <strong>TargetFilePath</strong> parameter.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10852" style="width: 685px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-single-file-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10852" class="size-full wp-image-10852" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-single-file-upload.png" alt="SSIS API Source - OneDrive - Upload Single File" width="675" height="808" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-single-file-upload.png 675w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-single-file-upload-251x300.png 251w" sizes="(max-width: 675px) 100vw, 675px" /></a><p id="caption-attachment-10852" class="wp-caption-text">SSIS API Source &#8211; OneDrive &#8211; Upload Single File</p></div>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to OneDrive using the <strong>ZappySys OneDrive Connector</strong> for uploading a local file to OneDrive.</p>
<h2>How to upload multiple files to OneDrive</h2>
<p>In the API Source Component, we&#8217;ve selected the API Connection Manager. Next, we need to configure the remaining properties of the component to upload multiple files to OneDrive. Additionally, we should utilize a Foreach Loop Container to iterate through each file one by one in a loop.</p>
<ol>
<li>Create 3 SSIS variables as described below.<br />
<table border="1">
<tbody>
<tr>
<th>Variable Name</th>
<th>Datatype</th>
<th>Value</th>
</tr>
<tr>
<td>varFileLists</td>
<td>Object</td>
<td>System.Object</td>
</tr>
<tr>
<td>varFileName</td>
<td>String</td>
<td>fake.extension</td>
</tr>
<tr>
<td>varFullFilePath</td>
<td>String</td>
<td>C:/fake/fake.extension</td>
</tr>
</tbody>
</table>
</li>
<li>Go to Control Flow, From the SSIS toolbox drag and drop <strong>ZS Advanced File System Task</strong> on the control flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10363" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png" alt="SSIS Advanced File System Task - Drag &amp; Drop" width="580" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png 580w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop-300x125.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></a></li>
<li>Select the &#8220;Get file list as ADO.NET Data Table&#8221; action from the Action drop-down menu. Set the file path in the Path textbox. Choose the variable (Object type) where you want to store the file list, and then click the OK button to save the settings.
<div id="attachment_10364" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10364" class="size-full wp-image-10364" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png" alt="SSIS Advanced File System Task - Get file list as ADO.net Data Table" width="712" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png 712w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable-300x263.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-10364" class="wp-caption-text">SSIS Advanced File System Task &#8211; Get file list as ADO.net Data Table</p></div></li>
<li>Now, drag and drop the &#8220;Foreach Loop Container&#8221; from the SSIS Toolbox and connect it with the &#8220;ZS Advanced File System Task.&#8221; Double-click on the &#8220;Foreach Loop Container&#8221; to edit its properties.
<div id="attachment_10365" style="width: 750px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10365" class="size-full wp-image-10365" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png" alt="SSIS Foreach Loop Container - Drag &amp; Drop" width="740" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png 740w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive-300x215.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><p id="caption-attachment-10365" class="wp-caption-text">SSIS Foreach Loop Container &#8211; Drag &amp; Drop</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Collection&#8221; tab, choose the Enumerator as &#8220;Foreach ADO Enumerator.&#8221; In the &#8220;ADO object source variable&#8221; field, select your SSIS object-typed variable. Select the &#8220;Rows in the first table&#8221; radio option.
<div id="attachment_10371" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10371" class="size-full wp-image-10371" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png" alt="SSIS Foreach Loop Editor - Collection - Select Variable &amp; Enumeration mode" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10371" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Collection &#8211; Select Variable &amp; Enumeration mode</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Variable Mappings&#8221; tab, select the variables that you want to map to the values from the collection, and then click the &#8220;OK&#8221; button to save your selections.
<div id="attachment_10370" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10370" class="size-full wp-image-10370" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png" alt="SSIS Foreach Loop Editor - Variable Mappings tab" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10370" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Variable Mappings</p></div></li>
<li>Inside the Foreach Loop Container, drag and drop the Data Flow Task, and then rename it according to your preference.
<div id="attachment_10854" style="width: 830px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10854" class="size-full wp-image-10854" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png" alt="SSIS Data Flow Task - Drag &amp; Drop inside Foreach Loop Container" width="820" height="428" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload.png 820w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload-300x157.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-dataflow-task-inside-foreachloop-container-multiplefiles-upload-768x401.png 768w" sizes="(max-width: 820px) 100vw, 820px" /></a><p id="caption-attachment-10854" class="wp-caption-text">SSIS Data Flow Task &#8211; Drag &amp; Drop inside Foreach Loop Container</p></div></li>
<li>Double-click on the Data Flow Task to see the Data Flow Designer, From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="SSIS API Source - Drag &amp; Drop" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Double-click on the <strong>API Source</strong> component to configure it for uploading multiple files to OneDrive.
<ol style="list-style-type: lower-alpha;">
<li>Choose the <strong>Upload file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>Please specify the desired SSIS Variable [varFileName] containing the uploaded file name by setting the <strong>TargetFilePath</strong> parameter.</li>
<li>To specify the desired local SSIS variable [varFullFilePath], which holds the file path, set the <strong>SourceFilePath</strong> parameter.<br />
When configuring the SSIS variable directly in the Raw Edit, JSON may become invalid due to the requirement of slashes within the local file path. To address this, we use a JSONENC Placeholder Function for proper escaping.<br />
<pre class="crayon-plain-tag">&lt;&lt;{{User::varUserFullFilePath}},FUN_JSONENC&gt;&gt;</pre></li>
<li>If you wish to upload the local file to a specific folder in OneDrive, please set the folderName in the <strong>TargetFilePath </strong>parameter.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10857" style="width: 833px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-multiple-files-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10857" class="size-full wp-image-10857" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-multiple-files-upload.png" alt="SSIS API Source - OneDrive - Upload Multiple files configuration" width="823" height="619" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-multiple-files-upload.png 823w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-multiple-files-upload-300x226.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-api-source-onedrive-multiple-files-upload-768x578.png 768w" sizes="(max-width: 823px) 100vw, 823px" /></a><p id="caption-attachment-10857" class="wp-caption-text">SSIS API Source &#8211; OneDrive &#8211; Upload Multiple files configuration</p></div>
<p>To configure dynamic filenames and file paths, you can set variables. Click on &#8220;Raw Edit,&#8221; and in the &#8220;Edit Parameters&#8221; popup, you can use SSIS variables, as shown in the above image.</p>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call.<br />
After that, you can execute the SSIS Package and check the execution to upload multiple files on OneDrive. Below is the sample screenshot attached.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive.png"><img loading="lazy" decoding="async" class="size-medium_large wp-image-10859" src="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive-768x274.png" alt="Multiple files uploaded on OneDrive using SSIS" width="720" height="257" srcset="https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive-768x274.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive-300x107.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive-1024x365.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/12/ssis-uploaded-multiple-files-onedrive.png 1317w" sizes="(max-width: 720px) 100vw, 720px" /></a><br />
<span style="font-size: 14px;">Multiple files uploaded on OneDrive using SSIS</span></p>
<p>With just a few clicks, we have successfully configured the call to OneDrive using the <strong>ZappySys OneDrive Connector</strong> for uploading multiple files to OneDrive.</li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to connect with OneDrive using SSIS API Connection Manager and upload single or multiple files to OneDrive using a combination of SSIS components, including the <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source component</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS ZS Advanced File System Task</a>, Foreach Loop Container, and SSIS variables.</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-onedrive-using-ssis/">How to upload files on OneDrive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to upload files on Google Drive using SSIS</title>
		<link>https://zappysys.com/blog/upload-files-google-drive-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 07 Sep 2023 12:18:50 +0000</pubDate>
				<category><![CDATA[Google API]]></category>
		<category><![CDATA[SSIS API Source]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[Foreach Loop Container]]></category>
		<category><![CDATA[google api]]></category>
		<category><![CDATA[Google Drive]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[upload files]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=10255</guid>

					<description><![CDATA[<p>Introduction In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful Google Drive Connector that [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/">How to upload files on Google Drive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo.png"><img loading="lazy" decoding="async" class="alignleft wp-image-11097" src="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-300x284.png" alt="" width="106" height="100" srcset="https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-300x284.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo-768x727.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/11/google_drive_logo.png 980w" sizes="(max-width: 106px) 100vw, 106px" /></a>In today&#8217;s data-driven world, the ability to seamlessly integrate and transfer files between different platforms is crucial for efficient business operations. If you&#8217;re a user of SQL Server Integration Services (SSIS) and looking to integrate Google Drive into your data workflow, you&#8217;re in luck. ZappySys SSIS PowerPack offers a powerful <a href="https://zappysys.com/api/integration-hub/google-drive-connector/">Google Drive Connector</a> that makes uploading files to Google Drive a breeze. In this guide, we&#8217;ll walk you through the process of uploading files to Google Drive using SSIS and the <a href="https://zappysys.com/api/integration-hub/google-drive-connector/ssis">ZappySys SSIS PowerPack Google Drive Connector</a>.</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>Upload files to Google Drive with SSIS:</h2>
<p>In this section, we will learn how to configure and use Google Drive Connector in the API Source to upload files on Google Drive.</p>
<ol>
<li>Begin with opening Visual Studio and Creating a New Project.</li>
<li>Select Integration Service Project and in the new project window set the appropriate name and location for the project. Click OK.</li>
<li>In the new SSIS project screen you will find the following:
<ol style="list-style-type: lower-alpha;">
<li>SSIS ToolBox on the left sidebar</li>
<li>Solution Explorer and Property Window on the right bar</li>
<li>Control flow, data flow, event Handlers, Package Explorer in tab windows</li>
<li>Connection Manager Window at the bottom</li>
</ol>
<div id="attachment_10258" style="width: 710px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/zappysys-ssis-project-with-toolbox/#main"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10258" class="wp-image-10258" src="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png" alt="zappysys ssis project with toolbox" width="700" height="447" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-1024x653.png 1024w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-300x191.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox-768x490.png 768w, https://zappysys.com/blog/wp-content/uploads/2023/08/zappysys-ssis-project-with-toolbox.png 1287w" sizes="(max-width: 700px) 100vw, 700px" /></a><p id="caption-attachment-10258" class="wp-caption-text">SSIS Toolbox &#8211; ZappySys Tasks</p></div>
<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>NOTE</strong>: If you don&#8217;t see ZappySys SSIS PowerPack Task or Components in the SSIS Toolbox, please refer to <a href="https://zappysys.zendesk.com/hc/en-us/articles/115004935754-I-don-t-see-PowerPack-components-in-SSIS-Toolbox">this help link</a>.</div></div></li>
<li>Now, Drag and Drop the SSIS Data Flow Task from the SSIS Toolbox. Double-click on the Data Flow Task to see the Data Flow Designer.<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10260" src="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2023/08/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a></li>
<li>From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double-click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Select <strong>New Connection</strong> to create a new connection:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10263" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png" alt="" width="684" height="643" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection.png 684w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-new-connection-300x282.png 300w" sizes="(max-width: 684px) 100vw, 684px" /></a></li>
</ol>
<h2>Configuring the Google Drive Connector</h2>
<ol>
<li>Use a preinstalled Google Drive Connector from the Popular Connector List or press the Search Online radio button to download Google Drive Connector. Once downloaded simply use it in the configuration:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10354" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png" alt="ssis googledrive template selection walkthrough" width="781" height="686" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough.png 781w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-300x264.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-template-selection-googledrive-walkthrough-768x675.png 768w" sizes="(max-width: 781px) 100vw, 781px" /></a></li>
<li>Proceed with selecting the desired Authentication Type. Then select API Base URL (in most cases default one is the right one). Finally, fill in all the required parameters and set optional parameters if needed.</li>
<li>After configuring all the required properties in the API Connection Manager, please click on the &#8220;Test Connection&#8221; button to confirm that the connection is established successfully.<br />
<h3>Method1: Connect to Google Drive using User Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/OAuth"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10355" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10355" class="size-full wp-image-10355" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with User Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10355" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with User Account</p></div>
<h3>Method2: Connect to Google Drive using Service Account [OAuth]</h3>
<p>You may press a link <a href="https://zappysys.com/api/integration-hub/google-drive-connector/help/authentication/ServiceAccount"><strong>Steps to Configure</strong></a> which will help set certain parameters.</p>
<div id="attachment_10353" style="width: 876px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10353" class="size-full wp-image-10353" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png" alt="SSIS API Source - Generate Token - Google Drive with Service Account" width="866" height="773" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token.png 866w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-300x268.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-serviceaccount-generate-token-768x686.png 768w" sizes="(max-width: 866px) 100vw, 866px" /></a><p id="caption-attachment-10353" class="wp-caption-text">SSIS API Source &#8211; Generate Token &#8211; Google Drive with Service Account</p></div></li>
</ol>
<h2>How to upload a local file to Google Drive</h2>
<p>In the API Source Component, we&#8217;ve chosen the API Connection Manager. Next, we need to configure the remaining properties of the component to upload a local file to Google Drive.</p>
<ol>
<li>Choose the <strong>Upload a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for uploading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/create"><strong>Help for: Upload File</strong></a>.</li>
<li>Please specify the desired filename for the uploaded file by setting the <strong>FileName</strong> parameter.</li>
<li>Specify the desired local file path by setting the <strong>DiskFilePath</strong> parameter.</li>
<li>If you wish to upload the local file to a specific folder in Google Drive, please choose the folder ID from the dropdown menu labeled <strong>ParentFolderId</strong>. Otherwise, you can skip this parameter as it&#8217;s optional.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10357" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10357" class="size-full wp-image-10357" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png" alt="SSIS API Source - Google Drive - Upload Single File" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-single-file-upload-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10357" class="wp-caption-text">SSIS API Source &#8211; Google Drive &#8211; Upload Single File</p></div>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the <strong>ZappySys Google Drive Connector</strong> for uploading a local file to Google Drive.</p>
<h2>How to upload multiple files to Google Drive</h2>
<p>In the API Source Component, we&#8217;ve selected the API Connection Manager. Next, we need to configure the remaining properties of the component to upload multiple files to Google Drive. Additionally, we should utilize a Foreach Loop Container to iterate through each file one by one in a loop.</p>
<ol>
<li>Create 3 SSIS variables as described below.<br />
<table border="1">
<tbody>
<tr>
<th>Variable Name</th>
<th>Datatype</th>
<th>Value</th>
</tr>
<tr>
<td>varFileLists</td>
<td>Object</td>
<td>System.Object</td>
</tr>
<tr>
<td>varFileName</td>
<td>String</td>
<td>fake.extension</td>
</tr>
<tr>
<td>varFullFilePath</td>
<td>String</td>
<td>C:/fake/fake.extension</td>
</tr>
</tbody>
</table>
</li>
<li>Go to Control Flow, From the SSIS toolbox drag and drop <strong>ZS Advanced File System Task</strong> on the control flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10363" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png" alt="SSIS Advanced File System Task - Drag &amp; Drop" width="580" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop.png 580w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-drag-and-drop-300x125.png 300w" sizes="(max-width: 580px) 100vw, 580px" /></a></li>
<li>Select the &#8220;Get file list as ADO.NET Data Table&#8221; action from the Action drop-down menu. Set the file path in the Path textbox. Choose the variable (Object type) where you want to store the file list, and then click the OK button to save the settings.
<div id="attachment_10364" style="width: 722px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10364" class="size-full wp-image-10364" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png" alt="SSIS Advanced File System Task - Get file list as ADO.net Data Table" width="712" height="623" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable.png 712w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-advanced-file-system-task-store-filelists-adotable-in-object-variable-300x263.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-10364" class="wp-caption-text">SSIS Advanced File System Task &#8211; Get file list as ADO.net Data Table</p></div></li>
<li>Now, drag and drop the &#8220;Foreach Loop Container&#8221; from the SSIS Toolbox and connect it with the &#8220;ZS Advanced File System Task.&#8221; Double-click on the &#8220;Foreach Loop Container&#8221; to edit its properties.
<div id="attachment_10365" style="width: 750px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10365" class="size-full wp-image-10365" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png" alt="SSIS Foreach Loop Container - Drag &amp; Drop" width="740" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive.png 740w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-foreach-loop-container-drag-and-drop-googledrive-300x215.png 300w" sizes="(max-width: 740px) 100vw, 740px" /></a><p id="caption-attachment-10365" class="wp-caption-text">SSIS Foreach Loop Container &#8211; Drag &amp; Drop</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Collection&#8221; tab, choose the Enumerator as &#8220;Foreach ADO Enumerator.&#8221; In the &#8220;ADO object source variable&#8221; field, select your SSIS object-typed variable. Select the &#8220;Rows in the first table&#8221; radio option.
<div id="attachment_10371" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10371" class="size-full wp-image-10371" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png" alt="SSIS Foreach Loop Editor - Collection - Select Variable &amp; Enumeration mode" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-collection-tab-configuration-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10371" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Collection &#8211; Select Variable &amp; Enumeration mode</p></div></li>
<li>In the Foreach Loop Editor&#8217;s &#8220;Variable Mappings&#8221; tab, select the variables that you want to map to the values from the collection, and then click the &#8220;OK&#8221; button to save your selections.
<div id="attachment_10370" style="width: 747px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10370" class="size-full wp-image-10370" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png" alt="SSIS Foreach Loop Editor - Variable Mappings tab" width="737" height="631" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings.png 737w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-googledrive-multiplefiles-upload-foreach-loop-editor-variablemappings-300x257.png 300w" sizes="(max-width: 737px) 100vw, 737px" /></a><p id="caption-attachment-10370" class="wp-caption-text">SSIS Foreach Loop Editor &#8211; Variable Mappings</p></div></li>
<li>Inside the Foreach Loop Container, drag and drop the Data Flow Task, and then rename it according to your preference.
<div id="attachment_10374" style="width: 716px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10374" class="size-full wp-image-10374" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png" alt="SSIS Data Flow Task - Drag &amp; Drop inside Foreach Loop Container" width="706" height="420" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload.png 706w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-dataflow-task-inside-foreachloop-container-googledrive-multiplefiles-upload-300x178.png 300w" sizes="(max-width: 706px) 100vw, 706px" /></a><p id="caption-attachment-10374" class="wp-caption-text">SSIS Data Flow Task &#8211; Drag &amp; Drop inside Foreach Loop Container</p></div></li>
<li>Double-click on the Data Flow Task to see the Data Flow Designer, From the SSIS toolbox drag and drop API Source (Predefined Templates) on the data flow designer surface, and double click on it to edit it:<br />
<a href="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-10262" src="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg" alt="SSIS API Source - Drag &amp; Drop" width="659" height="292" srcset="https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop.jpg 659w, https://zappysys.com/blog/wp-content/uploads/2023/08/ssis-api-source-drag-and-drop-300x133.jpg 300w" sizes="(max-width: 659px) 100vw, 659px" /></a></li>
<li>Double-click on the <strong>API Source</strong> component to configure it for uploading multiple files to Google Drive.
<ol style="list-style-type: lower-alpha;">
<li>Choose the <strong>Upload a file</strong> endpoint from the &#8220;Select Table/Endpoint&#8221; dropdown menu.</li>
<li>To access detailed API documentation for uploading files, you can click on the following link: <a href="https://developers.google.com/drive/api/reference/rest/v3/files/create"><strong>Help for: Upload File</strong></a>.</li>
<li>Please specify the desired SSIS Variable [varFileName] which contains file name for the uploaded file by setting the <strong>FileName</strong> parameter.</li>
<li>To specify the desired local SSIS variable [varFullFilePath], which holds the file path, set the <strong>DiskFilePath</strong> parameter.<br />
When configuring the SSIS variable directly in the Raw Edit, JSON may become invalid due to the requirement of slashes within the local file path. To address this, we use a JSONENC Placeholder Function for proper escaping.<br />
<pre class="crayon-plain-tag">&lt;&lt;{{User::varUserFullFilePath}},FUN_JSONENC&gt;&gt;</pre></li>
<li>If you wish to upload the local file to a specific folder in Google Drive, please choose the folder ID from the dropdown menu labeled <strong>ParentFolderId</strong>. Otherwise, you can skip this parameter as it&#8217;s optional.</li>
</ol>
<p>Please refer to the sample screenshot below.</p>
<div id="attachment_10369" style="width: 896px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10369" class="size-full wp-image-10369" src="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png" alt="SSIS API Source - Google Drive - Upload Multiple files - configuration" width="886" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload.png 886w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload-300x204.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/09/ssis-api-source-googledrive-multiple-files-upload-768x523.png 768w" sizes="(max-width: 886px) 100vw, 886px" /></a><p id="caption-attachment-10369" class="wp-caption-text">SSIS API Source &#8211; Google Drive &#8211; Upload Multiple files configuration</p></div>
<p>To configure dynamic filenames and file paths, you can set variables. Click on &#8220;Raw Edit,&#8221; and in the &#8220;Edit Parameters&#8221; popup, you can use SSIS variables, as shown in the image below.</p>
<p>Once you have configured all the mentioned properties above, please click on the &#8220;Preview Data&#8221; button to initiate the API call. With just a few clicks, we have successfully configured the call to Google Drive using the <strong>ZappySys Google Drive Connector</strong> for uploading multiple files to Google Drive.</li>
</ol>
<h2>Conclusion</h2>
<p>In this blog, we learned how to connect with Google Drive using SSIS API Connection Manager and upload single or multiple files to Google Drive using a combination of SSIS components, including the <a href="https://zappysys.com/products/ssis-powerpack/ssis-api-source/">SSIS API Source component</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS ZS Advanced File System Task</a>, Foreach Loop Container, and SSIS variables.</p>
<p>The post <a href="https://zappysys.com/blog/upload-files-google-drive-using-ssis/">How to upload files on Google Drive using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to save a list of files into a table using SSIS.</title>
		<link>https://zappysys.com/blog/how-to-save-a-list-of-files-into-a-table-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Mon, 27 Mar 2023 11:47:11 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[html table source]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=9901</guid>

					<description><![CDATA[<p>Introduction In this post, we will show how to save a list of files into a table a table using SSIS. The article will show how to get a list of files and then store the list of files into an Excel file. Prerequisites Before we perform the steps listed in this article, you will [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-save-a-list-of-files-into-a-table-using-ssis/">How to save a list of files into a table using SSIS.</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><strong>Introduction</strong></h2>
<p>In this post, we will show how to save a list of files into a table a table using SSIS. The article will show how to get a list of files and then store the list of files into an Excel file.</p>
<h2><strong>Prerequisites</strong></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>SSIS designer installed. Sometimes it is referred to as BIDS or SSDT (<a href="https://learn.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-ver16">download it from the Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using Microsoft SQL Server Integration Services.</li>
<li>Make sure <a href="https://zappysys.com/products/ssis-powerpack/">ZappySys SSIS PowerPack</a> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/">download it</a>).</li>
<li>Optional (If you want to Deploy and Schedule ) &#8211; <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593">Deploy and Schedule SSIS Packages</a></li>
</ol>
<h2><strong>Step-by-step process to save the list of files and folders into an article</strong></h2>
<h3>Save the information in a variable with the Advanced file system task</h3>
<p>1. Drag and drop the Advance File System Task from the SSIS toolbox, chose to Get file list as ADO.net Data table and select an object variable type</p>
<div id="attachment_9951" style="width: 596px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/afst1-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9951" class="wp-image-9951 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/afst1-1.png" alt="Advanced file system task 1" width="586" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/afst1-1.png 586w, https://zappysys.com/blog/wp-content/uploads/2023/02/afst1-1-296x300.png 296w" sizes="(max-width: 586px) 100vw, 586px" /></a><p id="caption-attachment-9951" class="wp-caption-text">Getting the file list in a variable</p></div>
<h3>Save the result in a file with Logging task in order to save a list of files into a table</h3>
<p>2. The next step is to save the result in a HTML file: select the file destination, uncheck append and prefix datetime. Select the file in log mode and none in message type, and insert the variable in the message as follows:</p>
<div id="attachment_9953" style="width: 546px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/lt1-1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9953" class="wp-image-9953 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/lt1-1.png" alt="save a list of files into a table - Logging task configuration" width="536" height="473" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/lt1-1.png 536w, https://zappysys.com/blog/wp-content/uploads/2023/02/lt1-1-300x265.png 300w" sizes="(max-width: 536px) 100vw, 536px" /></a><p id="caption-attachment-9953" class="wp-caption-text">Save the value from the variable in a file without a prefix</p></div>
<div class="mceTemp"></div>
<h3>Read the table and save it on a new file in order to save a list of files into a table</h3>
<p>3. Now, Drag and Drop SSIS <b>Data Flow Task</b> from SSIS Toolbox</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/drag-and-drop-data-flow-task.png" width="460" height="155" /></p>
<p>4. Double click on the DataFlow task to see DataFlow designer surface.</p>
<p>5. From the SSIS toolbox drag and drop HTML source and insert the path for the new file, you can preview the file if it was previously created.</p>
<div id="attachment_9954" style="width: 811px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/htmls1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9954" class="wp-image-9954 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/htmls1.png" alt="save a list of files into a table - HTML Source configuration" width="801" height="593" srcset="https://zappysys.com/blog/wp-content/uploads/2023/02/htmls1.png 801w, https://zappysys.com/blog/wp-content/uploads/2023/02/htmls1-300x222.png 300w, https://zappysys.com/blog/wp-content/uploads/2023/02/htmls1-768x569.png 768w" sizes="(max-width: 801px) 100vw, 801px" /></a><p id="caption-attachment-9954" class="wp-caption-text">Preview the HTML file</p></div>
<p>7. Then you can use a destination like the <a href="https://zappysys.com/products/ssis-powerpack/ssis-excel-file-destination/">Excel destination</a>, <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-destination-connector/">JSON destination</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-destination/">CSV destination</a></p>
<div id="attachment_9955" style="width: 268px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow1.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-9955" class="wp-image-9955 size-full" src="https://zappysys.com/blog/wp-content/uploads/2023/02/dataflow1.png" alt="save a list of files into a table - Save from HTML table into Excel" width="258" height="298" /></a><p id="caption-attachment-9955" class="wp-caption-text">Save the path list into an excel file</p></div>
<p>If everything is OK, the information will be stored in Excel. However, you can select any destination.</p>
<h2>Conclusion</h2>
<p>In this article, we show how to save a list of files in a table. Basically, we use the Advanced file system to save the list in a file. We use the Logging Task</p>
<p>The post <a href="https://zappysys.com/blog/how-to-save-a-list-of-files-into-a-table-using-ssis/">How to save a list of files into a table using SSIS.</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to remove invalid characters from XML using SSIS and Regex</title>
		<link>https://zappysys.com/blog/how-to-remove-invalid-characters-from-xml-using-ssis-and-regex/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 10 Jan 2017 20:27:45 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=926</guid>

					<description><![CDATA[<p> Introduction In this blog post, you will see how to remove invalid characters from XML using SSIS. We will use the search and replace feature of the Advanced File System Task. Remove Invalid characters from XML. The XML file specification specifies which characters can be part of XML data and which should be avoided. If you [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-remove-invalid-characters-from-xml-using-ssis-and-regex/">How to remove invalid characters from XML using SSIS and Regex</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2> Introduction</h2>
<p>In this blog post, you will see how to remove invalid characters from XML using SSIS. We will use the search and replace feature of the <a target="_blank" rel="noopener">Advanced File System Task</a>.</p>
<h2>Remove Invalid characters from XML.</h2>
<p>The XML file specification specifies which characters can be part of XML data and which should be avoided. If you use an invalid character, the XML Parser can throw an error indicating that it found an invalid character. Here is a <a href="https://en.wikipedia.org/wiki/Valid_characters_in_XML" target="_blank" rel="noopener">very useful link</a> that explains which characters are allowed in XML and which are not.</p>
<h2>Using SSIS and Regex to clean invalid XML Characters</h2>
<p>To clean invalid characters, we can use the following regular expression. This basically removes any characters outside the allowed character range.</p><pre class="crayon-plain-tag">[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]</pre><p>
The above expression is sufficient for most cases, but it is not the best solution. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">If you really want the most accurate expression <span style="box-sizing: border-box; margin: 0px; padding: 0px;">per the <a href="http://www.w3.org/TR/xml/#charsets" target="_blank" rel="noopener">XML Specs,</a> </span>use the expression below.</span> It can be <b>SLOW for large XML files</b>.</p><pre class="crayon-plain-tag">[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd]|([\ud800-\udbff](?![\udc00-\udfff]))|((?&lt;![\ud800-\udbff])[\udc00-\udfff])</pre><p>
<h2>Remove any characters</h2>
<p>If you don&#8217;t have a range of valid characters but you know a list of invalid characters, use the expression below (without the ^). For example, if you want to remove A, C, and E; then use the below</p><pre class="crayon-plain-tag">[ACE]

--OR-- Use hex codes

[\x41\x43\x45]</pre><p>
You can also use a range</p>
[0-9A-Za-z]
<h2>Step-By-Step Example</h2>
<ol>
<li>Download and install <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack from here.</a></li>
<li>Create a new SSIS Project.</li>
<li>Drag the <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">ZS Advanced File System Task</a> from the SSIS Toolbox to the control flow designer.</li>
<li>Double-click the task to edit its properties, as shown below. Enter the following expression for a Regular Expression.<br />
<pre class="crayon-plain-tag">[^\x09\x0A\x0D\x20-\xD7FF\xE000-\xFFFD\x10000-x10FFFF]</pre>
</li>
<li>Save the package and execute. After you run the task, it will remove (replace with blank) any invalid character in your XML file.</li>
</ol>
<p>Here is the screenshot of the Task configuration.</p>
<div id="attachment_11598" style="width: 830px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/SSIS-Advanced-File-System-Task-Search-and-Replace-Option-Remove-invalid-XML-characters-using-Regex-Regular-Expression.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11598" class="size-full wp-image-11598" src="https://zappysys.com/blog/wp-content/uploads/2017/01/SSIS-Advanced-File-System-Task-Search-and-Replace-Option-Remove-invalid-XML-characters-using-Regex-Regular-Expression.png" alt="" width="820" height="595" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/SSIS-Advanced-File-System-Task-Search-and-Replace-Option-Remove-invalid-XML-characters-using-Regex-Regular-Expression.png 820w, https://zappysys.com/blog/wp-content/uploads/2017/01/SSIS-Advanced-File-System-Task-Search-and-Replace-Option-Remove-invalid-XML-characters-using-Regex-Regular-Expression-300x218.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/01/SSIS-Advanced-File-System-Task-Search-and-Replace-Option-Remove-invalid-XML-characters-using-Regex-Regular-Expression-768x557.png 768w" sizes="(max-width: 820px) 100vw, 820px" /></a><p id="caption-attachment-11598" class="wp-caption-text">SSIS Advanced File System Task &#8211; Search and Replace Option -Remove invalid XML characters using Regex (Regular Expression)</p></div>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/how-to-remove-invalid-characters-from-xml-using-ssis-and-regex/">How to remove invalid characters from XML using SSIS and Regex</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>SSIS check file is locked and wait until file is unlocked (C# Script)</title>
		<link>https://zappysys.com/blog/ssis-check-file-locked-wait-file-unlocked-c-script/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 23 Feb 2016 13:58:18 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[script task]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis advanced file system task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis validation task]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=362</guid>

					<description><![CDATA[<p>Introduction In this small blog post you will learn How to move files using SSIS Advanced File System Task and How to wait until file is unlocked using C# Script Task. How to check if file is locked (SSIS C# Script Task) If you want to check if file is locked in C# then below [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-check-file-locked-wait-file-unlocked-c-script/">SSIS check file is locked and wait until file is unlocked (C# Script)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In this small blog post you will learn How to move files using <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS Advanced File System Task</a> and <i>How to wait until file is unlocked</i> using <strong>C# Script Task</strong>.</p>
<h2>How to check if file is locked (SSIS C# Script Task)</h2>
<p>If you want to check if file is locked in C# then below code will do the trick. But no worry if you dont know C#. ZappySys SSIS PowerPack comes with two tasks which can solve this issue without coding. You can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS Advanced File System Task</a> with <strong>Get file lock status action</strong> or Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-validation-task/">SSIS Validation Task</a> which has option to throw error on lock condition or you can continue by saving lock status into variable and continue without throwing error. </p>
<pre class="crayon-plain-tag">// Attempt to open the file exclusively. -- If you get erro means file is locked
using (FileStream fs = new FileStream(fullPath,
	FileMode.Open, FileAccess.ReadWrite,
	FileShare.None, 100))
{
	fs.ReadByte();

	// If we got this far the file is ready
	break;
}</pre> </p>
<h2>How to wait until file is unlocked (SSIS C# Script Task)</h2>
<p>Now lets check real example which will first check for locked file using <a href="https://zappysys.com/products/ssis-powerpack/ssis-validation-task/">SSIS Validation Task</a> and then if file is locked then  wait until file is unlocked (with some timeout hardcoded in script). </p>
<p>If specified wait time is reached then script will throw error. Once file is unlocked <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">SSIS Advanced File System Task</a> will copy file to target.</p>
<div id="attachment_368" style="width: 563px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-check-file-locked-wait-until-unlocked.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-368" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-check-file-locked-wait-until-unlocked.png" alt="SSIS - How to check if file is locked. Wait until file is unlocked (C# Code - SSIS Script Task)." width="553" height="458" class="size-full wp-image-368" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-check-file-locked-wait-until-unlocked.png 553w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-check-file-locked-wait-until-unlocked-300x248.png 300w" sizes="(max-width: 553px) 100vw, 553px" /></a><p id="caption-attachment-368" class="wp-caption-text">SSIS &#8211; How to check if file is locked. Wait until file is unlocked (C# Code &#8211; SSIS Script Task).</p></div>
<h3>SSIS Validation Task -Store file lock status into variable</h3>
<div id="attachment_367" style="width: 550px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-validation-task-check-if-file-is-locked.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-367" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-validation-task-check-if-file-is-locked.png" alt="SSIS Validation Task -Check if file is locked. Save status to variable or throw error." width="540" height="567" class="size-full wp-image-367" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-validation-task-check-if-file-is-locked.png 540w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-validation-task-check-if-file-is-locked-286x300.png 286w" sizes="(max-width: 540px) 100vw, 540px" /></a><p id="caption-attachment-367" class="wp-caption-text">SSIS Validation Task -Check if file is locked. Save status to variable or throw error.</p></div>
<h3>SSIS Advanced File System Task &#8211; Copy, Move, Rename, Delete multiple files</h3>
<div id="attachment_366" style="width: 711px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-advanced-file-system-task-how-to-copy-move-files.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-366" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-advanced-file-system-task-how-to-copy-move-files.png" alt="SSIS Advanced File System Task. Copy, Move, Rename, Delete multiple files" width="701" height="559" class="size-full wp-image-366" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-advanced-file-system-task-how-to-copy-move-files.png 701w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-advanced-file-system-task-how-to-copy-move-files-300x239.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-366" class="wp-caption-text">SSIS Advanced File System Task. Copy, Move, Rename, Delete multiple files</p></div>
<h3>SSIS C# Script Task &#8211; Check file is locked, wait until file is unlocked</h3>
<pre class="crayon-plain-tag">#region Namespaces
using System;
using System.Data;
using Microsoft.SqlServer.Dts.Runtime;
using System.Windows.Forms;
using System.IO;
#endregion

namespace ST_334a75922c6a47a5b4ac21ee8e4e5fff
{
	[Microsoft.SqlServer.Dts.Tasks.ScriptTask.SSISScriptTaskEntryPointAttribute]
	public partial class ScriptMain : Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTARTScriptObjectModelBase
	{
		public void Main()
		{
			// TODO: Add your code here
            try
            {
                var file = Dts.Variables["User::filePath"].Value.ToString();

                bool continueIfFileMissing = false;
                if (!System.IO.File.Exists(file))
                {
                    if (continueIfFileMissing)
                    {
                        Dts.TaskResult = (int)ScriptResults.Success;
                        return;
                    }
                    LogError("File not found: " + file);
                    Dts.TaskResult = (int)ScriptResults.Failure;
                }
                    
                WaitForFile(file, maxWaitInSec:30);
                Dts.TaskResult = (int)ScriptResults.Success;
            }
            catch (Exception ex)
            {
                LogError(ex.Message);
                Dts.TaskResult = (int)ScriptResults.Failure;
            }           
			
		}
        /// &lt;summary&gt;
        /// Blocks until the file is not locked any more.
        /// &lt;/summary&gt;
        /// &lt;param name="fullPath"&gt;&lt;/param&gt;
        bool WaitForFile(string fullPath,int maxWaitInSec)
        {
            int numTries = 0;
            while (true)
            {
                ++numTries;
                try
                {
                    // Attempt to open the file exclusively.
                    using (FileStream fs = new FileStream(fullPath,
                        FileMode.Open, FileAccess.ReadWrite,
                        FileShare.None, 100))
                    {
                        fs.ReadByte();

                        // If we got this far the file is ready
                        break;
                    }
                }
                catch (Exception ex)
                {
                   if(numTries==1 ||  numTries % 20 ==0 )
                      LogWarning(string.Format("WaitForFile {0} failed to get an exclusive lock: {1}",fullPath, ex.Message));

                    //if (numTries &gt; 10)
                    //{
                    //    LogWarning(string.Format(
                    //        "WaitForFile {0} giving up after 10 tries",
                    //        fullPath));
                    //    return false;
                    //}

                   if (numTries &gt;= maxWaitInSec * 2)
                   {
                       throw new Exception("Max wait time reached for file : " + fullPath + ". Waited for " + maxWaitInSec + " seconds but lock not released");
                   }

                    // Wait for the lock to be released
                    System.Threading.Thread.Sleep(500);
                }

                
            }

            LogInformation( string.Format( "WaitForFile {0} returning true after {1} tries",fullPath, numTries));
            return true;
        }

        private void LogInformation(string msg)
        {
            bool again = false;
            Dts.Events.FireInformation(0, "ScriptTask", msg, "", 0,ref again);
        }
        
        private void LogError(string msg)
        {
            Dts.Events.FireError(0, "ScriptTask", msg, "", 0);
        }
        private void LogWarning(string msg)
        {
            Dts.Events.FireWarning(0, "ScriptTask", msg, "", 0);
        }
        #region ScriptResults declaration
        /// &lt;summary&gt;
        /// This enum provides a convenient shorthand within the scope of this class for setting the
        /// result of the script.
        /// 
        /// This code was generated automatically.
        /// &lt;/summary&gt;
        enum ScriptResults
        {
            Success = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Success,
            Failure = Microsoft.SqlServer.Dts.Runtime.DTSExecResult.Failure
        };
        #endregion

	}
}</pre> </p>
<h2>Download Sample Package</h2>
<p>Below sample will work only if you have <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a> Installed. Download it <a href="https://zappysys.com/products/ssis-powerpack/download/">from here</a> it will take only 1 minute to install<br />
<a href="//zappysys.com/downloads/files/ssis/2012/AdvancedFileSystemTask_Copy_Locked.zip">Download SSIS 2012 &#8211; Sample Package (Process Locked file)</a></p>
<h2>Conclusion</h2>
<p>Processing and detecting locked files in SSIS can be tricky but using small C# script it can save you some headache. Download <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> to try many options not available in native File System Task.</p>
<p>Other Keywords:<br />
<i>Check locked files in SSIS</i><br />
<i>How to check whether file is locked or not in SSIS</i><br />
<i>Detect locked file in SSIS</i><br />
<i>Wait until file is unlocked using C# script</i><br />
<i>How to handle file locking issue in SSIS using C# script</i></p>
<p>The post <a href="https://zappysys.com/blog/ssis-check-file-locked-wait-file-unlocked-c-script/">SSIS check file is locked and wait until file is unlocked (C# Script)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
