<?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/category/ssis/tasks/ssis-advanced-file-system-task/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/tasks/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, 30 Oct 2025 23:27:53 +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/category/ssis/tasks/ssis-advanced-file-system-task/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<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 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 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>SSIS PGP Encryption / Decryption (Using FREE GPG Tool)</title>
		<link>https://zappysys.com/blog/ssis-pgp-encryption-decryption/</link>
		
		<dc:creator><![CDATA[ZappySys Team]]></dc:creator>
		<pubDate>Fri, 07 Jun 2019 02:42:20 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Tips & How-Tos]]></category>
		<category><![CDATA[decryption]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[gpg]]></category>
		<category><![CDATA[openpgp]]></category>
		<category><![CDATA[pgp]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7161</guid>

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

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

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

					<description><![CDATA[<p>Introduction In this short article, you will learn how to write Regular expressions in SSIS (i.e. Regex) and what tool to use to test them. You will also find helpful resources on how to write more sophisticated expressions and learn more about them. For demo purposes, we will use FREE SSIS Regex Parser Task to parse and [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/">Using Regular Expressions in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-regex-parser-task.png"><img loading="lazy" decoding="async" class=" wp-image-2974 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-regex-parser-task.png" alt="" width="114" height="114" /></a>In this short article, you will learn how to write Regular expressions in SSIS (i.e. Regex) and what tool to use to test them. You will also find helpful resources on how to write more sophisticated expressions and learn more about them. For demo purposes, we will use <strong>FREE</strong> <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task</a> to parse and extract the text using Regex.</p>
<p>&nbsp;</p>
<p>You can use Regular expressions in several SSIS PowerPack connectors:</p>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task (FREE)</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-azure-blob-storage-task/" target="_blank" rel="noopener">Azure Blob Storage Task</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/" target="_blank" rel="noopener">Advanced File System Task</a>,</li>
<li><a href="https://zappysys.com/products/ssis-powerpack/ssis-amazon-s3-task/" target="_blank" rel="noopener">Amazon S3 Storage Task</a> and others.</li>
</ul>
<h2>Writing Regular Expressions in SSIS</h2>
<p>Based on the SSIS component you use it will include the filename in filtering options or match the text: See below Syntax to write Regex in ZappySys tools. We support additional construct {{X, Y}} at the end of Regex to control two parameters. This additional construct is useful for data extracted from matching regex. If you want to Test patterns and not worry about data extraction then no need to use last {{<pre class="crayon-plain-tag">Occurance_Index</pre>, <pre class="crayon-plain-tag">Group_Index_Or_Name</pre>}}</p>
<p><strong>Syntax:</strong><br />
<pre class="crayon-plain-tag">&lt;your Regular Expression&gt;[{{Occurance_Index|*[,Group_Index_Or_Name]}}]</pre>
<p><strong>Where:</strong><br />
<pre class="crayon-plain-tag">Occurance_Index</pre>=Occurrence index you want to extract (X=0 means the first match) and * means all matches. Use a minus sign to get an occurrence from reverse (e.g. {{-0}} returns the last match)<br />
<pre class="crayon-plain-tag">Group_Index_Or_Name</pre>=Group index/name within your search pattern (Groups are indicated by parentheses in regular expression, Y=0 means first group). If you named your group in the pattern then you can use the Group name. To use Group Name you must use the new version (the old version doesn&#8217;t support this)</p>
<p><strong>How to name a group?</strong></p>
<p>E.g. (\w+)@(<strong>?&lt;domain&gt;</strong>\w+.com)</p>
<p><strong>How to use the group name in the match extract?</strong></p>
<p>E.g. (\w+)@(<strong>?&lt;domain&gt;</strong>\w+.com){{0,<strong>domain</strong>}}</p>
<p><strong>Example Input:</strong></p>
<p>Let&#8217;s assume we have the following input text. We will test various Expressions.</p><pre class="crayon-plain-tag">Customer =&gt; AAA
Email =&gt; aaa@google.com
Phone =&gt; 101-222-3333
========
Customer =&gt; BBB
Email =&gt; bbb@yahoo.com
Phone =&gt; 102-222-3333
========
Customer =&gt; CCC
Email =&gt; ccc@hotmail.com
Phone =&gt; 103-222-3333
========
Customer =&gt; DDD
Email =&gt; ddd@outlook.com
Phone =&gt; 104-222-3333</pre><p>
<strong>Sample Regex Expressions</strong></p>
<div class="su-table su-table-alternate">
<table style="border-collapse: collapse;width: 100%;height: 332px" border="1">
<tbody>
<tr style="height: 22px">
<td style="width: 50%;height: 22px"><strong>Expression</strong></td>
<td style="width: 50%;height: 22px"><strong>Description</strong></td>
</tr>
<tr style="height: 46px">
<td style="width: 50%;height: 46px">(?s).*</td>
<td style="width: 50%;height: 46px">Match anything including new lines. To match anything without new line just use <pre class="crayon-plain-tag">(.*)</pre></td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*)</td>
<td style="width: 50%;height: 22px">Get first email id from text ({{0}} is omitted from end because {{0}} id default)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{-0}}</td>
<td style="width: 50%;height: 22px">Get last email id from text</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{*}}</td>
<td style="width: 50%;height: 22px">Get all email addresses (separate them with new line). When you suffix Regular expression with {{*}} it will return all matches.</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{2}}</td>
<td style="width: 50%;height: 22px">Get third email id from text (i.e. ends with {{X}} where X is occurrence index starting from 0)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">\w+([-+.&#8217;]\w+)*@(?&lt;domain&gt;\w+([-.]\w+)*\.\w+([-.]\w+)*){{0,2}}</td>
<td style="width: 50%;height: 22px">Get first email pattern match (i.e. Index=0) and extract domain (i.e. 2nd group). Index starting from 0 for occurrence and group</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">(\d*)-(\d*)-(\d*)</td>
<td style="width: 50%;height: 22px">Get first phone number from text (If you don&#8217;t include {{X,Y}} at the end then it will be always [0,0])</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">^((?!demo|test).)*$</td>
<td style="width: 50%;height: 22px">Match whole input text if it does not contain words like demo or test. If word found then No Match</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;tag&gt;((.|\n)*?)&lt;/tag&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract anything between &lt;tag&gt;&#8230;&lt;/tag&gt; (Include new line char i.e. \n)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;tag&gt;(.*)&lt;/tag&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract anything between &lt;tag&gt;&#8230;&lt;/tag&gt; (Exclude new line char i.e. \n)</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">&lt;!\[CDATA\[((.|\n)*?)\]\]\&gt;{{0,1}}</td>
<td style="width: 50%;height: 22px">Extract content from CData section of XML Data (This can be CSV, JSON or nested XML )</td>
</tr>
<tr style="height: 22px">
<td style="width: 50%;height: 22px">^$</td>
<td style="width: 50%;height: 22px">Match blank string</td>
</tr>
</tbody>
</table>
</div>
<h2>More Regular Expression Examples</h2>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td style="width: 196px"><strong>Input Text</strong></td>
<td style="width: 223px"><strong>Regex</strong></td>
<td style="width: 163px"><strong>Matched text</strong></td>
<td style="width: 752px"><strong>Comment</strong></td>
</tr>
<tr>
<td style="width: 196px">&lt;row id=&#8221;123&#8243; process=&#8221;Y&#8221;&gt;</td>
<td style="width: 223px">id=&#8221;([^&#8221;]*)&#8221;{{0,1}}</td>
<td style="width: 163px"><strong>123</strong></td>
<td style="width: 752px">This expression shows how to extract group value (i.e. {{0,1}} &#8211; first match and 2nd group ). It extracts text between double quotes using <strong>[^&#8221;]*</strong> pattern , match anything until double quote is found.  {{0,1}} syntax is ZappySys specific so it may not work with other Regex engines.</td>
</tr>
<tr>
<td style="width: 196px">&lt;data&gt;123&lt;/data&gt;</td>
<td style="width: 223px">&lt;data&gt;([^&lt;]*)&lt;\/data&gt;{{0,1}}</td>
<td style="width: 163px"><strong>123</strong></td>
<td style="width: 752px">This expression shows how to extract group value (i.e. {{0,1}} &#8211; first match and 2nd group ). It extracts text between double quotes using <strong>[^&lt;]*</strong> pattern , match anything until <strong>&lt;</strong>  is found.  {{0,1}} syntax is ZappySys specific so it may not work with other Regex engines.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt</td>
<td style="width: 223px" valign="top">File</td>
<td style="width: 163px" valign="top"><strong>File</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that has &#8220;File&#8221; keyword in it.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_SOURCE.dat<br />
File_20180930_source.dat</td>
<td style="width: 223px" valign="top">source|SOURCE</td>
<td style="width: 163px" valign="top"><strong>SOURCE</strong> and <strong>source</strong></td>
<td style="width: 752px" valign="top">Will match text/filenames that contain either &#8220;source&#8221; <strong>or</strong> &#8220;SOURCE&#8221; keyword.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt</td>
<td style="width: 223px" valign="top">File.+source</td>
<td style="width: 163px" valign="top"><strong>File_20180930_source</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that contains keyword that starts with &#8220;File&#8221; <strong>and</strong> ends with &#8220;source&#8221;.<br />
Basically, you can use this pattern if you want to match two keywords in the text that appear in particular order.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
File_20180830_source.dat</td>
<td style="width: 223px" valign="top">\.txt$|\.dat$</td>
<td style="width: 163px" valign="top"><strong>.txt</strong> and <strong>.dat</strong></td>
<td style="width: 752px" valign="top">Will match text/all filenames that end with &#8220;.txt&#8221; <strong>or</strong> &#8220;.dat&#8221;.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
file_20190102_source.txt</td>
<td style="width: 223px" valign="top">^(F|f)ile_\d{8}</td>
<td style="width: 163px" valign="top"><strong>File_20180930</strong><br />
<strong>file_20190102</strong></td>
<td style="width: 752px" valign="top">Will match text/filename that starts with &#8220;File_&#8221; <strong>or</strong> &#8220;file_&#8221; <strong>and</strong> then followed by 8 digits.</td>
</tr>
<tr>
<td style="width: 196px" valign="top">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px" valign="top">(.+)_(.+)_(.+){{0,2}}</td>
<td style="width: 163px" valign="top"><strong>20180930</strong></td>
<td style="width: 752px" valign="top">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{0,2}} notation will bring back second group (index &#8220;2&#8221;) of first match (index &#8220;0&#8221;).</td>
</tr>
<tr>
<td style="width: 196px">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px">(.+)_(.+)_(.+){{1,2}}</td>
<td style="width: 163px"><strong>20190101</strong></td>
<td style="width: 752px">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{1,2}} notation will bring back second group (index &#8220;2&#8221;) of second match (index &#8220;1&#8221;).</td>
</tr>
<tr>
<td style="width: 196px">File_20180930_source.txt<br />
File_20190101_none.txt</td>
<td style="width: 223px">(.+)_(.+)_(.+){{*,2}}</td>
<td style="width: 163px"><strong>20180930<br />
20190101<br />
</strong></td>
<td style="width: 752px">Will match text that has three groups of text strings, separated by &#8220;_&#8221;.<br />
Non-Regex {{*,2}} notation will bring back second group (index &#8220;2&#8221;) of all matches (index &#8220;*&#8221;). Returned matches are separated by \r\n</td>
</tr>
<tr>
<td style="width: 196px">&lt;html&gt;<br />
&lt;img src=&#8221;/img-1.png&#8221; /&gt;<br />
&lt;img src=&#8221;/img-2.png&#8221; /&gt;<br />
&lt;img src=&#8221;/img-3.png&#8221; /&gt;<br />
<span style="font-family: inherit;font-size: inherit">&lt;/html&gt;</span></td>
<td style="width: 223px">&lt;img[^&gt;]+src=&#8221;([^&#8221;&gt;]+)&#8221;{{*,1}}</td>
<td style="width: 163px"><strong>/img-1.png<br />
/img-2.png<br />
/img-3.png<br />
</strong></td>
<td style="width: 752px">Will return image URLs from HTML content. We used {{*,1}} means it will pull all occurrences and for each match it will extract first group (which is just src attribute value).</td>
</tr>
<tr>
<td style="width: 196px">null</td>
<td style="width: 223px">^((?!null\b).)*$</td>
<td style="width: 163px"><strong>&lt;blank&gt;</strong></td>
<td style="width: 752px">Returns blank if null word found (match all except null)</td>
</tr>
<tr>
<td style="width: 196px">black white</td>
<td style="width: 223px">^((?!red|blue|orange).)*$</td>
<td style="width: 163px"><strong>black white</strong></td>
<td style="width: 752px">Returns full string as is if any of those 3 words (i.e. red, blue, orange) not found anywhere in the string</td>
</tr>
<tr>
<td style="width: 196px">black white red</td>
<td style="width: 223px">^((?!red|blue|orange).)*$</td>
<td style="width: 163px"><strong>&lt;blank&gt;</strong></td>
<td style="width: 752px">Returns blank if any of those 3 words (i.e. red, blue, orange) found anywhere in the string</td>
</tr>
</tbody>
</table>
</div>
<h2>Regex Examples (Using SSIS Regular Expression Parser Task)</h2>
<p>Here is an example how Regex <pre class="crayon-plain-tag">(.+)_(.+)_(.+){{1,2}}</pre> works in <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">Regular Expression Parser Task (FREE)</a>:</p>
<div id="attachment_2978" style="width: 742px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2978" class="wp-image-2978 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970.png" alt="Using Regular Expressions in SSIS Regex Parser Task (Extract Groups)" width="732" height="612" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970.png 732w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_parser_task-e1520866478970-300x251.png 300w" sizes="(max-width: 732px) 100vw, 732px" /></a><p id="caption-attachment-2978" class="wp-caption-text">Using Regular Expressions in SSIS Regex Parser Task (Extract Groups)</p></div>
<h2>Using Groups / Occurrence Index</h2>
<p>Some tasks like <a href="https://zappysys.com/products/ssis-powerpack/ssis-regex-parser-task/" target="_blank" rel="noopener">SSIS Regex Parser Task (FREE)</a> supports extracting value from specific occurrence and specific part of matched pattern using special syntax at the end of your pattern (see below).</p><pre class="crayon-plain-tag">Your Regex Pattern Here{{OccuranceIndex,GroupIndex}}</pre><p>
<strong>Where :</strong><br />
OccuranceIndex is 0 based (0=extract first occurrence)<br />
GroupIndex is 0 based (0=extract first matching group from pattern. First group is always entire text. )</p>
<p>See above screenshot in previous section for example.</p>
<h2>Tools</h2>
<p>The best tool we&#8217;ve found to write and test Regex is <a href="http://regexhero.net/tester/" target="_blank" rel="noopener">Regex Hero</a> (will require IE with Silverlight if you want to use it online, in the browser):</p>
<p>Another great site for Regex testing is <a href="https://regex101.com" target="_blank" rel="noopener">https://regex101.com</a> (Works in any browser unlike previous one)</p>
<p>and few more sites as below</p>
<p><a href="http://www.regexr.com/" target="_blank" rel="noopener">http://www.regexr.com/</a><br />
<a href="http://www.regexlib.com/" target="_blank" rel="noopener">http://www.regexlib.com/</a><br />
<a href="http://www.regular-expressions.info/" target="_blank" rel="noopener">http://www.regular-expressions.info/</a></p>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png"><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2972" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png" alt="" width="802" height="483" srcset="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero.png 802w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero-300x181.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/03/ssis_powerpack_regular_expression_task_using_regex_hero-768x463.png 768w" sizes="(max-width: 802px) 100vw, 802px" /></a></p>
<h2>Resources</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/Regular-expressions-quick-reference.pdf">Regular Expressions cheat-sheet to hang on the wall</a></p>
<p><a href="http://www.rexegg.com/regex-quickstart.html" target="_blank" rel="noopener">Regular Expressions quick reference</a></p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/using-regular-expressions-in-ssis/">Using Regular Expressions in 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 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>
		<item>
		<title>Get list of files in SSIS for Looping</title>
		<link>https://zappysys.com/blog/get-list-of-files-and-folders-in-ssis-for-looping/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 15 Feb 2016 23:35:43 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=344</guid>

					<description><![CDATA[<p>Introduction In this post you will learn how to use Advanced File System Task to get list of files and folders into variable. Advanced File System Task is significantly better than native SSIS File System Task How to get list of files in SSIS Most simplest way to get list of files in SSIS is [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/get-list-of-files-and-folders-in-ssis-for-looping/">Get list of files in SSIS for Looping</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="/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> to get list of files and folders into variable. <a href="/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> is significantly better than native <a href="https://msdn.microsoft.com/en-us/library/ms140185.aspx" target="_blank" rel="noopener">SSIS File System Task</a></p>
<h2>How to get list of files in SSIS</h2>
<p>Most simplest way to get list of files in SSIS is use wildcard pattern as below screenshot. You can also use Scan Recursive option to include files inside child folders. For advanced filtering options use <strong>Filter and Sorting Tab</strong></p>
<ol>
<li>Download and install <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here</a></li>
<li>From toolbox of SSIS designer drag <a href="/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a></li>
<li>Double click Advanced File System task to configure it</li>
<li>Select Action as [Get file list as ADO.net DataTable]</li>
<li>Now select files you want to get using wildcard pattern (e.g. c:\ssis\file*.txt)</li>
<li>In the result variable select variable or create new variable with Object datatype. This variable will host file list in the form of ADO.net DataTable</li>
</ol>
<div id="attachment_347" style="width: 586px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-file-list-as-recordset-for-looping.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-347" class="size-full wp-image-347" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-file-list-as-recordset-for-looping.png" alt="SSIS Advanced File System Task - get file list as ADO.net Recordset into variable" width="576" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-file-list-as-recordset-for-looping.png 576w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-file-list-as-recordset-for-looping-300x253.png 300w" sizes="(max-width: 576px) 100vw, 576px" /></a><p id="caption-attachment-347" class="wp-caption-text">SSIS Advanced File System Task &#8211; get file list as ADO.net Recordset into variable</p></div>
<div id="attachment_346" style="width: 635px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-346" class="size-full wp-image-346" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png" alt="Loop through files in SSIS using ForEach Loop Task (use ADO.net Recordset variable)" width="625" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset.png 625w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-300x270.png 300w" sizes="(max-width: 625px) 100vw, 625px" /></a><p id="caption-attachment-346" class="wp-caption-text">Loop through files in SSIS using ForEach Loop Task (use ADO.net Recordset variable)</p></div>
<div id="attachment_345" style="width: 582px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-345" class="size-full wp-image-345" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png" alt="Variable Mappings for ForEach Loop Task - Loop through files in a folder using SSIS" width="572" height="272" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping.png 572w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-looping-through-files-ado-net-recordset-variable-mapping-300x143.png 300w" sizes="(max-width: 572px) 100vw, 572px" /></a><p id="caption-attachment-345" class="wp-caption-text">Variable Mappings for ForEach Loop Task &#8211; Loop through files in a folder using SSIS</p></div>
<h3>Get files modified in last N days</h3>
<p>To get files modified in last N days you can use Advanced File System Task.</p>
<ol>
<li>Download and install <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here</a></li>
<li>From toolbox of SSIS designer drag <a href="/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a></li>
<li>Double click Advanced File System task to configure it</li>
<li>Select Action as [Get file list as ADO.net DataTable]</li>
<li>Now select files you want to get using wildcard pattern (e.g. c:\ssis\file*.txt)</li>
<li>Go to <strong>Filter and Sorting</strong> tab. In the Where Field enter expression <strong>LastEditInDays &lt; 5</strong> This will give you list of files modified in last 5 days. Here are some more examples.<br />
<pre class="crayon-plain-tag">//////////////////////////////
Examples:
//////////////////////////////
AgeInDays &lt; 5  //Get files created in last 5 days
LastEditInDays &gt; 3 //Get files modified before 3 days
AgeInDays &gt; 10 AND LastEditInDays &lt; 3  //Get files created before 10 days and modified in last 3 days
Size &lt; 1024  //Get files where File size is less than 1024 bytes
CreationDate BETWEEN #2015-01-01# AND #2015-01-01#   
Name IN ('File1.txt', 'Download.msi')
FullPath LIKE 'c:\temp\da*')
Extension IN ('.txt','.csv')
LastModifiedDate &gt; #2013-01-01T16:00:00#
IsReadOnly = True
/////////////////////////////////////////
//Supported Columns for expression:
/////////////////////////////////////////
Name, FullPath, Extension, FolderPath, AgeInDays, LastEditInDays, Size, CreationDate, CreationDateUtc, LastModifiedDate, LastModifiedDateUtc, IsReadOnly</pre>
<div id="attachment_354" style="width: 700px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-files-modified-created-in-last-n-days.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-354" class="size-full wp-image-354" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-files-modified-created-in-last-n-days.png" alt="SSIS Advanced File System Task - Get files modified in last N days" width="690" height="551" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-files-modified-created-in-last-n-days.png 690w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-get-files-modified-created-in-last-n-days-300x240.png 300w" sizes="(max-width: 690px) 100vw, 690px" /></a><p id="caption-attachment-354" class="wp-caption-text">SSIS Advanced File System Task &#8211; Get files modified in last N days</p></div></li>
</ol>
<h3>Get files with specific size</h3>
<p>To get files with specific size you can use <strong>Where Expression</strong> on Size attribute (Size is in Bytes)</p>
<ol>
<li>Download and install <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here</a></li>
<li>From toolbox of SSIS designer drag <a href="/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a></li>
<li>Double click Advanced File System task to configure it</li>
<li>Select Action as [Get file list as ADO.net DataTable]</li>
<li>Now select files you want to get using wildcard pattern (e.g. c:\ssis\file*.txt)</li>
<li>Go to <strong>Filter and Sorting</strong> tab. In the Where Field enter expression <strong>Size &lt; 1024</strong> This will give you list of files which are less than 1024 bytes (e.g 1KB).<br />
<pre class="crayon-plain-tag">Size &lt; 1024</pre>
</li>
</ol>
<h3>Get files with Include/Exclude pattern (Use Regular Expression)</h3>
<p>Sometimes you have need to list files with specific name patterns which is hard to get using simple wildcard then use Advanced Regular Expression option. For this use wildcard in Path (e.g. c:\ssis\*.*) and then in the <strong>Filter and Sorting</strong> tab use Include / Exclude Regular Expressions (e.g. RegX) for file name pattern.</p>
<p>For Example if you want to include all files containing *MMDD.* pattern but not *.zip file or *.gz then use below expressions</p><pre class="crayon-plain-tag">Include ==&amp;gt;  ^w+_\d\d\d\d.\w+$   
Exclude ==&amp;gt;  \.zip|\.gz</pre><p>
<h2>How to get list of folders in SSIS (list directories)</h2>
<p>Coming soon</p>
<h2>Loop through files or folders in SSIS using ForEachLoop Task</h2>
<p>Coming soon</p>
<h2>Read Recordset and load into database (e.g. SQL Server Table)</h2>
<p>Coming soon</p>
<h2>Conclusion</h2>
<p>Microsoft native file system task has very limited features and many scenarios require you to write C# / VB.net Script. But using <a href="/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a> you can eliminate need for scripting and use simple drag and drop approach. To use this task <a href="/products/ssis-powerpack/">Download SSIS PowerPack</a></p>
<p>The post <a href="https://zappysys.com/blog/get-list-of-files-and-folders-in-ssis-for-looping/">Get list of files in SSIS for Looping</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Search and replace in files using SSIS &#8211; No Coding</title>
		<link>https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 03 Dec 2015 23:29:37 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[Regular Expression]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=204</guid>

					<description><![CDATA[<p>Introduction Many times you have requirement to search and replace in files (single or multiple file) content using SSIS. If you are not C# or VB.net programmer then you may find yourself at dead end struggling how to achieve this in SSIS. If you have this need then you can use Advanced File System Task [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/">Search and replace in files using SSIS &#8211; No Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Many times you have requirement to search and replace in files (single or multiple file) content using SSIS. If you are not C# or VB.net programmer then you may find yourself at dead end struggling how to achieve this in SSIS. If you have this need then you can use <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a></p>
<h2>Search and replace in files using Simple text search</h2>
<p>In this option you can specify text you want to search and text you want to replace with. You can check ignore text if you dont want case-sensitive search/replace.</p>
<h2>Extended text search (special characters allowed)</h2>
<p>For extended search mode you may use any of the following in your search/replace string</p>
<ul>
<ul>
<li>\n &#8211; for line feed</li>
<li>\r &#8211; for return character</li>
<li>\0 &#8211; for null character</li>
<li>\t &#8211; for tab character</li>
<li>\v &#8211; for vertical tab character</li>
</ul>
</ul>
<p>Example:<br />
Search: &#8220;Hello\r\nWorld&#8221;<br />
Replace: &#8220;Hello World&#8221;</p>
<h2>Regular expression search/replace</h2>
<div id="attachment_205" style="width: 722px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-205" class="size-full wp-image-205" src="//zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png" alt="Search and Replace File Content in SSIS (Find sub string, Search for special character)" width="712" height="491" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis.png 712w, https://zappysys.com/blog/wp-content/uploads/2015/12/file-search-replace-text-in-ssis-300x207.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-205" class="wp-caption-text">Search and Replace File Content in SSIS (Find sub string, Search for special character)</p></div>
<h2>Advanced File System Task</h2>
<p>If you want to perform some other operations then here is the list of few features supported by Advanced File System Task.</p>
<ul>
<li>File operations for single or multiple files using wildcard(e.g. copy, move, rename, delete, write to file, get properties)</li>
<li>Folder operations such as delete folder and create folder</li>
<li>Support for bulk rename (e.g. by specifying {%name%}.{%ext%}.old as new name will rename all selected files to *.old)</li>
<li>Search and Replace in files (Regular expression search supported)</li>
<li>Change file encoding</li>
<li>Get file properties as data table which you can loop easily (Using ForEach Loop – ADO Enumerator)</li>
<li>Option to continue on error (e.g. Copy file only when source file found)</li>
<li>Auto create missing target directory</li>
<li>Use placeholders anywhere in the path, makes it easy to timestamp folders or files (e.g. c:\Archive\{{System::StartTime,yyyMMdd}})</li>
<li>Regular Expression based Include Pattern (e.g. ^(file\d\d).(\w+)$ will include file01.exe,file22.csv …)</li>
<li>Regular Expression based Exclude Pattern (e.g. (.exe|.msi) will exclude files with extension exe or msi)</li>
<li>Sort based on specific property (e.g. Order Size DESC – extract top 10 files by size)</li>
<li>Advanced SQL like filter support (e.g. Size&gt; 1024 AND AgeInDays &gt; 10 AND Extension IN(‘.txt’,’.csv’) will include file greater than 1024 bytes and extension is txt or csv)</li>
<li>Support for Regular Expression based Include Pattern (e.g. ^(Customer\d\d).(\w+)$ )</li>
<li>Support for SQL Server 2005, 2008, 2012, 2014, 2016 (32 bit and 64 bit)</li>
</ul>
<h2>Download FREE SSIS Components</h2>
<p><a href="https://zappysys.com/products/ssis-powerpack/"><img decoding="async" src="//zappysys.com/wp-content/uploads/2016/10/slider-ssis-powerpack-1.png"></a></p>
<h2>Conclusion</h2>
<p>Search and replace in many files can be tricky but using <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> it can be few click. <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Click here </a> to download.</p>
<p>The post <a href="https://zappysys.com/blog/search-and-replace-in-files-using-ssis-no-coding/">Search and replace in files using SSIS &#8211; No Coding</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to change file encoding in SSIS (UTF8, ASCII or UTF16)</title>
		<link>https://zappysys.com/blog/how-to-change-file-encoding-in-ssis-utf8-ascii-or-utf16/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Tue, 01 Dec 2015 20:33:52 +0000</pubDate>
				<category><![CDATA[SSIS Advanced File System Task]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=197</guid>

					<description><![CDATA[<p>Introduction Many times during your ETL process you receive files which are in different encoding than you expect. Example all files are in UTF-16 format but your application expect them to be in UTF-8. Or Sometimes files are in ASCII format and you want to convert to UTF-8. In this post you will see how [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/how-to-change-file-encoding-in-ssis-utf8-ascii-or-utf16/">How to change file encoding in SSIS (UTF8, ASCII or UTF16)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>Many times during your ETL process you receive files which are in different encoding than you expect. Example all files are in UTF-16 format but your application expect them to be in UTF-8. Or Sometimes files are in ASCII format and you want to convert to UTF-8.</p>
<p>In this post you will see how to use <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a> to convert multiple files into desired encoding (e.g. ASCII, UTF-8, UTF-16).</p>
<h2>Steps to Convert file encoding for Multiple Files in SSIS</h2>
<ol>
<li>Download and Install <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack</a></li>
<li>From you SSIS Toolbox drag <a href="//zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">Advanced File System Task</a></li>
<li>Double click task to configure it</li>
<li>Select &#8220;Change Encoding of files&#8221; action from dropdown as below screenshot</li>
<li>Enter path or pattern for source file you want to convert to different encoding</li>
<li>Select desired encoding from Encoding dropdown (e.g. if you files are in ASCII and you want to convert them to UTF-8 .. just select UTF-8)</li>
<li>Execute package and observe SSIS execution log to find out which files are converted to new encoding.</li>
</ol>
<div id="attachment_200" style="width: 578px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-file-encoding-multiple-utf8-unt16-ascii.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-200" class="size-full wp-image-200" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-file-encoding-multiple-utf8-unt16-ascii.png" alt="Change file encoding using SSIS Advanced File System Task" width="568" height="473" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-file-encoding-multiple-utf8-unt16-ascii.png 568w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-file-encoding-multiple-utf8-unt16-ascii-300x250.png 300w" sizes="(max-width: 568px) 100vw, 568px" /></a><p id="caption-attachment-200" class="wp-caption-text">Change file encoding using SSIS Advanced File System Task</p></div>
<div id="attachment_199" style="width: 630px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-ascii-file-to-utf8-encoding.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-199" class="size-full wp-image-199" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-ascii-file-to-utf8-encoding.png" alt="Change file encoding to UTF-8 from ASCII using SSIS Advanced File System Task" width="620" height="458" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-ascii-file-to-utf8-encoding.png 620w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-ascii-file-to-utf8-encoding-300x222.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></a><p id="caption-attachment-199" class="wp-caption-text">Change file encoding to UTF-8 from ASCII using SSIS Advanced File System Task</p></div>
<div id="attachment_198" style="width: 683px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-encoding-for-multiple-files-utf8-ascii-utf16-unicode.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-198" class="size-full wp-image-198" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-encoding-for-multiple-files-utf8-ascii-utf16-unicode.png" alt="SSIS Execution log - Convert  files to UTF-8 using SSIS Advanced File System Task" width="673" height="296" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-encoding-for-multiple-files-utf8-ascii-utf16-unicode.png 673w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-change-encoding-for-multiple-files-utf8-ascii-utf16-unicode-300x132.png 300w" sizes="(max-width: 673px) 100vw, 673px" /></a><p id="caption-attachment-198" class="wp-caption-text">SSIS Execution log &#8211; Convert files to UTF-8 using SSIS Advanced File System Task</p></div>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/how-to-change-file-encoding-in-ssis-utf8-ascii-or-utf16/">How to change file encoding in SSIS (UTF8, ASCII or UTF16)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
