<?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>upsert Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/upsert/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/upsert/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Thu, 13 Nov 2025 23:55:43 +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>upsert Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/upsert/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>ODBC PowerPack v1.1.4 Released</title>
		<link>https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 11 Sep 2019 19:47:17 +0000</pubDate>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[openquery]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7971</guid>

					<description><![CDATA[<p>What&#8217;s New In this version we focused on many bug fixes. Among them most important bug was limitation of only 2000 characters for SQL Query using OPENQUERY statement. Now you can use up to 8000 characters for OPENQUERY and if that&#8217;s not enough use EXEC AT statement to send query to Data Gateway. We also [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/">ODBC PowerPack v1.1.4 Released</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What&#8217;s New</h2>
<p>In this version we focused on many bug fixes. Among them most important bug was limitation of only 2000 characters for SQL Query using OPENQUERY statement. Now you can use up to 8000 characters for OPENQUERY and if that&#8217;s not enough use EXEC AT statement to send query to Data Gateway. We also made many improvements with our Salesforce Driver so now you can use it along with Data Gateway or any other Reporting / ETL tools.</p>
<h2 class="vertitle">Version 1.1.4.10904 [Sep 11, 2019]</h2>
<h3 class="versubtitle">New Features/Improvements</h3>
<ul>
<li><span class="verAdded">NEW: </span>All Drivers &#8211; New DSN dialogbox should suggest unique DSN name if already exists (Prevent accidental overwrite)</li>
<li><span class="verAdded">NEW: </span>All Drivers &#8211; Add support for named parameters for stored procs (e.g. exec webrequest @uri=&#8217;https://abc.com&#8217; )</li>
<li><span class="verAdded">NEW: </span>Data Gateway &#8211; Give Export / Import Settings option</li>
<li><span class="verAdded">NEW: </span>Data Gateway &#8211; Provide list of database to caller App</li>
<li><span class="verAdded">NEW: </span>General &#8211; Use default log file name if only folder name is supplied</li>
<li><span class="verAdded">NEW: </span>Salesforce Driver &#8211; Add Placeholder Engine Support</li>
</ul>
<h3 class="versubtitle">Bug fixes</h3>
<ul>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; Query builders shows Password and Default Attributes on first time launch</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; RetryInfo not included in Connectionstring or generated SQL</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; URL JOIN may cause error for decimal values &#8211; Query execution error: Input string was not in a correct format.</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; URL on general tab is wiped out when you use save HTTP Connection</li>
<li><span class="verFixed">FIX: </span>All API Drivers &#8211; Field names are wrong StatucFieldxxxxxxx and StatucCheckxxxxxx rather than StatusCheckxxxxxx and StatusFieldxxxxxxx</li>
<li><span class="verFixed">FIX: </span>CSV Driver &#8211; JOIN query fails in CSV driver with invalid format detected</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; MS SQL Server &#8211; Support more than 2000 characters for SQL in OPENROWSET and EXEC &#8211; In old version you may get error &#8211; Data is invalid if text is longer than 2000 characters</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; Query with Caching Option hangs</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; Use of META in WITH clause prevents error in some cases</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; You may get &#8220;The data is invalid&#8221; error when the query is too long</li>
<li><span class="verFixed">FIX: </span>Data Gateway &#8211; You may get Data is invalid error for OAuth Authorization failure</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; When you execute INSERT via Linked Server Query it Inserts row but fails with error at the end</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Load ConnectionString action throws Object reference not set to an instance of an object.</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Click on Generate SQL throws Object reference not set to an instance of an object</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Data is not returned in Excel when you use [From Microsoft Query] option</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; DELETE statement not working</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Escape sequence not supported (e.g. WHERE name =&#8217;Sam\&#8217;s&#8217; )</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; OPENQUERY / EXEC AT doesn&#8217;t work with DELETE / UPDATE / INSERT</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; SSIS Failed to Generate Metadata due to character encoding issue</li>
<li><span class="verFixed">FIX: </span>Salesforce Driver &#8211; Using * in SELECT with WHERE is not working</li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/odbc-powerpack-v1-1-4-released/">ODBC PowerPack v1.1.4 Released</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Merge / Upsert data in Amazon Redshift using SSIS</title>
		<link>https://zappysys.com/blog/ssis-amazon-redshift-upsert-update-insert-delete/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 09:02:51 +0000</pubDate>
				<category><![CDATA[Redshift]]></category>
		<category><![CDATA[SSIS Upsert Destination]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[redshift]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7903</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw how update / insert data into SQL Server using SSIS Upsert Destination. In this post we will look at specific example on Data migration from Access to Amazon Redshift using SSIS Upsert Destination (Insert, Update, Delete), along with few other topics such as how to create table using [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-amazon-redshift-upsert-update-insert-delete/">Merge / Upsert data in Amazon Redshift using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/Access-to-AmazonRedshift.png" target="_blank" rel="noopener"><img decoding="async" class="wp-image-7910 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/09/Access-to-AmazonRedshift-150x150.png" alt="Access-to-AmazonRedshift" width="150" height="150" /></a>In our previous blog we saw <a href="https://zappysys.com/blog/data-migration-access-sql-server/" target="_blank" rel="noopener">how update / insert data into SQL Server using SSIS Upsert Destination</a>. In this post we will look at specific example on <strong>Data migration from Access to Amazon Redshift using SSIS Upsert Destination (Insert, Update, Delete)</strong>, along with few other topics such as how to create table using <a href="https://zappysys.com/products/ssis-powerpack/ssis-upsert-destination/" target="_blank" rel="noopener">Upsert Destination</a>. how to read all Customers data from Ms Access Table and Merge it in the Amazon Redshift.</p>
<p>We will go through the steps to read data from Access and Load into Amazon Redshift.</p>
<p>In nutshell, this post will focus on how to read access table data in SSIS.</p>
<p>So let’s get started.</p>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>Thirdly, do not forget to install ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
<li>Finally, Make sure that Microsoft Access installed.</li>
</ol>
<h2>How to Read MS Access table data and migrate that data in Amazon Redshift table.</h2>
<p>Let´s start with an example. In this article we will see Data migration from Access to Amazon Redshift.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" target="_blank" rel="noopener"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-7934" class="wp-image-7934 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Furthermore, drag and drop the OLE DB Source.
<div id="attachment_7289" style="width: 515px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7289" class="wp-image-7289 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" alt="OLE DB Source - Drag and Drop" width="505" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png 505w, https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop-300x113.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></a><p id="caption-attachment-7289" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div></li>
<li>Double click on OLE DB Source for configure it and click on New Connection and configure connection as below to connect access database and click on OK.
<div id="attachment_7851" style="width: 722px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7851" class="wp-image-7851 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png" alt="OLE DB : Access Connection" width="712" height="618" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png 712w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection-300x260.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-7851" class="wp-caption-text">OLE DB : Access Connection</p></div></li>
<li>Now in OLE DB Source Select the mode as Table or View and select Preview to view the access table data.
<div id="attachment_7852" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7852" class="wp-image-7852 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-768x472.png" alt="OLE DB Source Preview" width="720" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-768x472.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-1024x629.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview.png 1165w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7852" class="wp-caption-text">OLE DB Source Preview</p></div></li>
<li>Now drag and drop Upsert Destination (Insert, Update, Delete) and create connection with Amazon Redshift Database.
<div id="attachment_8093" style="width: 690px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-aws-redshift-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8093" class="size-full wp-image-8093" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-aws-redshift-connection.png" alt="Upsert Destination : Amazon Redshift Connection" width="680" height="762" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-aws-redshift-connection.png 680w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-aws-redshift-connection-268x300.png 268w" sizes="(max-width: 680px) 100vw, 680px" /></a><p id="caption-attachment-8093" class="wp-caption-text">Upsert Destination : Amazon Redshift Connection</p></div></li>
<li>Now select Action as Sync and check all the checkboxes Insert, Update and Delete from target if not found in source. Select the table and Map all the columns and select the Key field(s) and click on OK.
<div id="attachment_7901" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7901" class="wp-image-7901 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-768x572.png" alt="Upsert Destination Configuration" width="720" height="536" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-768x572.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-300x224.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key.png 950w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7901" class="wp-caption-text">Upsert Destination Configuration</p></div></li>
<li>That&#8217;s it we are ready to migrate MS access table data into Amazon Redshift Table. Execute the package and it will migrate the data.
<div id="attachment_7860" style="width: 420px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7860" class="wp-image-7860 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png" alt="Upsert Destination (Insert, Update, Delete)" width="410" height="225" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png 410w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination-300x165.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></a><p id="caption-attachment-7860" class="wp-caption-text">Upsert Destination (Insert, Update, Delete)</p></div></li>
</ol>
<h2>Bulk Update data in Amazon Redshift</h2>
<p>So in previous example we saw bulk update or insert (Upsert) in Redshift Table. Now let&#8217;s look at how to update data in target table if record exists.</p>
<p>Here is how you can perform bulk update in Amazon Redshift using Upsert Destination.</p>
<ol>
<li>Double click on Upsert Destination for configure it.</li>
<li>Set Action Bulk Update =&gt; based on matching records on target. Select Connection and Target Table. Click on Map All to Mappings all columns and check on Only Primary Key columns.<br />
<img decoding="async" class="figureimage" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/upsert-destination/ssis-bulk-update.png" alt="SSIS Bulk Update rows in SQL Table" /></li>
<li>Thats all, Click on OK to save Upsert Destination settings UI.</li>
</ol>
<h2>Bulk Delete data in Amazon Redshift</h2>
<p>Here is how you can bulk delete data in Amazon Redshift.</p>
<ol>
<li>Double click on Upsert Destination for configure it.</li>
<li>Set Action Bulk Delete =&gt; based on matching records on target. Select Connection and Target Table. Click on Map All to Mappings all columns and check on Only Primary Key columns.<br />
<img decoding="async" class="figureimage" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/upsert-destination/ssis-bulk-delete.png" alt="SSIS Bulk delete rows in SQL Table" /></li>
<li>Thats all, Click on OK to save Upsert Destination settings UI.</li>
</ol>
<p>&nbsp;</p>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this article, we show how to read MS Access table data and migrate the data in Amazon Redshift table using SSIS. We show how to do connect access MS Access using OLE DB Source. Also, we show how to write Sync Insert, Update and Delete in target if not found in Source Using <a href="https://zappysys.com/products/ssis-powerpack/ssis-upsert-destination/" target="_blank" rel="noopener">ZS Upsert Destination</a>. If you liked this article and you want to try, you can download the <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys SSIS installer.</a></li>
<li><strong>Help File: </strong><a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-upsert-destination.htm" target="_blank" rel="noopener">Upsert Destination</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/ssis-amazon-redshift-upsert-update-insert-delete/">Merge / Upsert data in Amazon Redshift using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load data into PostgreSQL &#8211; Upsert using SSIS (Bulk Update, Insert, Delete)</title>
		<link>https://zappysys.com/blog/postgresql-upsert-using-ssis-destination-update-insert-delete/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 06 Sep 2019 07:08:07 +0000</pubDate>
				<category><![CDATA[SSIS PostgreSql Connection]]></category>
		<category><![CDATA[SSIS Upsert Destination]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7894</guid>

					<description><![CDATA[<p>Introduction In our previous blog we saw How to perform Upsert (Update or Insert) for SQL Server Table. In this post we will look at specific example on How to Load data into PostgreSQL &#8211; Upsert using SSIS Upsert Destination (Insert, Update, Delete), along with few other topics such as how to create target table using [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/postgresql-upsert-using-ssis-destination-update-insert-delete/">Load data into PostgreSQL &#8211; Upsert using SSIS (Bulk Update, Insert, Delete)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/Access-to-PostgreSQL.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="wp-image-7898 size-thumbnail alignleft" src="https://zappysys.com/blog/wp-content/uploads/2019/09/Access-to-PostgreSQL-150x150.png" alt="Access to PostgreSQL" width="150" height="150" /></a>In our previous blog we saw <a href="https://zappysys.com/blog/data-migration-access-sql-server/" target="_blank" rel="noopener">How to perform Upsert (Update or Insert) for SQL Server Table</a>. In this post we will look at specific example on <b>How to Load data into PostgreSQL &#8211; Upsert using SSIS Upsert Destination (Insert, Update, Delete)</b>, along with few other topics such as how to create target table using Upsert Destination, how to read data from Ms Access Table and <strong>Merge into PostgreSQL using SSIS</strong>.</p>
<p>We will go through the steps to read data from Access and Load into PostgreSQL &#8211; Upsert in SSIS.</p>
<p>In nutshell, this post will focus on how to read access table data in SSIS.</p>
<p>So let’s get started.</p>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>Thirdly, do not forget to install ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
<li>Finally, Make sure that Microsoft Access installed.</li>
</ol>
<h2>Read MS Access data and Upsert into PostgreSQL table</h2>
<p>Let´s start with an example. In this article we will see Data migration from Access to PostgreSQL.</p>
<ol>
<li>First of All, Drag and drop Data Flow Task from SSIS Toolbox and double click it to edit.
<div id="attachment_7934" style="width: 470px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7934" class="size-full wp-image-7934" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png" alt="Drag and Drop SSIS Data Flow Task from SSIS Toolbox" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /></a><p id="caption-attachment-7934" class="wp-caption-text">Drag and Drop : SSIS Data Flow Task from SSIS Toolbox</p></div></li>
<li>Furthermore, drag and drop the OLE DB Source.
<div id="attachment_7289" style="width: 515px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7289" class="wp-image-7289 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png" alt="OLE DB Source - Drag and Drop" width="505" height="190" srcset="https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop.png 505w, https://zappysys.com/blog/wp-content/uploads/2019/06/oledb-source-drag-and-drop-300x113.png 300w" sizes="(max-width: 505px) 100vw, 505px" /></a><p id="caption-attachment-7289" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div></li>
<li>Double click on OLE DB Source for configure it and click on New Connection and configure connection as below to connect access database and click on OK.
<div id="attachment_7851" style="width: 722px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7851" class="wp-image-7851 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png" alt="OLE DB : Access Connection" width="712" height="618" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection.png 712w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-access-connection-300x260.png 300w" sizes="(max-width: 712px) 100vw, 712px" /></a><p id="caption-attachment-7851" class="wp-caption-text">OLE DB : Access Connection</p></div></li>
<li>Now in OLE DB Source Select the mode as Table or View and select Preview to view the access table data.
<div id="attachment_7852" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7852" class="wp-image-7852 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-768x472.png" alt="OLE DB Source Preview" width="720" height="443" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-768x472.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-300x184.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview-1024x629.png 1024w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-ole-db-source-preview.png 1165w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7852" class="wp-caption-text">OLE DB Source Preview</p></div></li>
<li>Now drag and drop Upsert Destination (Insert, Update, Delete) and create connection with PostgreSQL Database.
<div id="attachment_7912" style="width: 730px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-postgresql.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-7912" class="wp-image-7912 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-postgresql.png" alt="Setup SSIS Upsert Destination for PostgreSQL data load (Bulk Update, Insert, Delete)" width="720" height="766" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-postgresql.png 720w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-postgresql-282x300.png 282w" sizes="(max-width: 720px) 100vw, 720px" /></a><p id="caption-attachment-7912" class="wp-caption-text">Setup SSIS Upsert Destination for PostgreSQL data load (Bulk Update, Insert, Delete)</p></div></li>
<li>Now select Action as Sync and check all the checkboxes Insert, Update and Delete from target if not found in source. Select the table and Map all the columns and select the Key field(s) and click on OK.<a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" width="768" height="572" class="wp-image-7901 size-medium_large" src="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-768x572.png" alt="&quot;&lt;yoastmark" srcset="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-768x572.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key-300x224.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-upsert-destination-select-table-and-key.png 950w" sizes="(max-width: 768px) 100vw, 768px" /></a></li>
<li>That&#8217;s it we are ready to migrate MS access table data into PostgreSQL Table. Execute the package and it will migrate the data.<a href="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" width="410" height="225" class="wp-image-7860 size-full" src="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png" alt="&quot;&lt;yoastmark" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination.png 410w, https://zappysys.com/blog/wp-content/uploads/2019/08/ssis-oledb-source-and-upsert-destination-300x165.png 300w" sizes="(max-width: 410px) 100vw, 410px" /></a></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this article, we show how to read MS Access table data and migrate the data in PostgreSQL table using SSIS Upsert Destination. We show how to do connect access MS Access using OLE DB Source. Also, we show how to write Sync Insert, Update and Delete in target if not found in Source Using <a href="https://zappysys.com/products/ssis-powerpack/ssis-upsert-destination/" target="_blank" rel="noopener">ZS Upsert Destination</a>. If you liked this article and you want to try, you can download the <a href="https://zappysys.com/products/ssis-powerpack/">SSIS PowerPack from here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys SSIS installer.</a></li>
<li><strong>Help File: </strong><a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-upsert-destination.htm" target="_blank" rel="noopener">Upsert Destination</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/postgresql-upsert-using-ssis-destination-update-insert-delete/">Load data into PostgreSQL &#8211; Upsert using SSIS (Bulk Update, Insert, Delete)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Data migration from Access to SQL Server using SSIS Upsert Destination</title>
		<link>https://zappysys.com/blog/data-migration-access-sql-server/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 31 Aug 2019 08:52:43 +0000</pubDate>
				<category><![CDATA[SSIS Upsert Destination]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=7847</guid>

					<description><![CDATA[<p>Introduction In our previous blog, we saw how to export a REST API to MS Access using a VBA Command Button. In this post, we will look at a specific example of data migration from Access to SQL Server using the SSIS Upsert Destination (Insert, Update, Delete), along with a few other topics, such as how to create a [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/data-migration-access-sql-server/">Data migration from Access to SQL Server using SSIS Upsert Destination</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><span id="Introduction">Introduction</span></h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Access-to-SQLServer.png" target="_blank" rel="noopener"><img loading="lazy" decoding="async" class="alignleft wp-image-7848 size-thumbnail" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Access-to-SQLServer-150x150.png" alt="Access to SQL Server" width="150" height="150" /></a><span style="box-sizing: border-box; margin: 0px; padding: 0px;">In our previous blog, we saw <a href="https://zappysys.com/blog/export-rest-api-ms-access-using-vba-command-button/" target="_blank" rel="noopener">how to export a REST API to MS Access using a VBA Command Button</a>.</span> <span style="box-sizing: border-box; margin: 0px; padding: 0px;">In this post, we will look at a specific example <span style="box-sizing: border-box; margin: 0px; padding: 0px;">of <strong>data migration from Access to SQL Server using the SSIS Upsert Destination (Insert, Update, Delete)</strong>, along with a few other topics, such as how to create a table using the </span>Upsert Destination.</span> How to read all the customer data from the MS Access Table and merge it into the SQL Server.</p>
<p>We will go through the steps to read data from Access and load it into SQL Server.</p>
<p>In a nutshell, this post explains how to read data from an Access table in SSIS.</p>
<p>So let’s get started.</p>
<h2><span id="Requirements">Requirements</span></h2>
<ol>
<li>First, you will need to have SSIS installed</li>
<li>Secondly, make sure to have SSDT</li>
<li>Thirdly, do not forget to install ZappySys <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a></li>
<li>Finally, make sure that Microsoft Access is installed.</li>
</ol>
<h2>How to read MS Access table data and migrate that data to a SQL Server table.</h2>
<p>Let´s start with an example. In this article, we will see Data migration from Access to SQL Server.</p>
<ol>
<li>First of all, drag and drop the Data Flow Task from the SSIS Toolbox and double-click it to edit.
<div class="mceTemp"></div>
<div id="attachment_11622" style="width: 472px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11622" class="size-full wp-image-11622" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png" alt="" width="462" height="157" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox.png 462w, https://zappysys.com/blog/wp-content/uploads/2019/08/Drag-and-Drop-SSIS-Data-Flow-Task-from-SSIS-Toolbox-300x102.png 300w" sizes="(max-width: 462px) 100vw, 462px" /></a><p id="caption-attachment-11622" class="wp-caption-text">Drag and Drop SSIS Data Flow Task from SSIS Toolbox</p></div>
<div class="mceTemp"></div>
</li>
<li>Furthermore, drag and drop the OLE DB Source.
<div id="attachment_11624" style="width: 517px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11624" class="size-full wp-image-11624" src="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png" alt="" width="507" height="192" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop.png 507w, https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Drag-and-Drop-300x114.png 300w" sizes="(max-width: 507px) 100vw, 507px" /></a><p id="caption-attachment-11624" class="wp-caption-text">OLE DB Source &#8211; Drag and Drop</p></div>
<div class="mceTemp"></div>
</li>
<li>Double-click the OLE DB Source to configure it. Click New Connection, configure the connection as shown below to connect to the Access database, and click OK.
<div id="attachment_11623" style="width: 724px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Access-Connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11623" class="size-full wp-image-11623" src="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Access-Connection.png" alt="" width="714" height="620" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Access-Connection.png 714w, https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Access-Connection-300x261.png 300w" sizes="(max-width: 714px) 100vw, 714px" /></a><p id="caption-attachment-11623" class="wp-caption-text">OLE DB Access Connection</p></div>
<div class="mceTemp"></div>
</li>
<li>Now, in the OLE DB Source, set the mode to Table or View, and select Preview to view the table data.
<div id="attachment_11625" style="width: 780px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Preview.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11625" class="size-full wp-image-11625" src="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Preview.png" alt="" width="770" height="474" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Preview.png 770w, https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Preview-300x185.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/OLE-DB-Source-Preview-768x473.png 768w" sizes="(max-width: 770px) 100vw, 770px" /></a><p id="caption-attachment-11625" class="wp-caption-text">OLE DB Source Preview</p></div>
<div class="mceTemp"></div>
</li>
<li>Now drag and drop Upsert Destination (Insert, Update, Delete), and create a connection to a SQL Server Database.
<div id="attachment_11627" style="width: 968px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-SQL-Server-Connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11627" class="size-full wp-image-11627" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-SQL-Server-Connection.png" alt="" width="958" height="800" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-SQL-Server-Connection.png 958w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-SQL-Server-Connection-300x251.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-SQL-Server-Connection-768x641.png 768w" sizes="(max-width: 958px) 100vw, 958px" /></a><p id="caption-attachment-11627" class="wp-caption-text">Upsert Destination SQL Server Connection</p></div>
<div class="mceTemp"></div>
</li>
<li>Click the New Table button in the Target Table, change the table name, and click OK to create the table in SQL Server.
<div id="attachment_11628" style="width: 968px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Create-Table.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11628" class="size-full wp-image-11628" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Create-Table.png" alt="" width="958" height="685" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Create-Table.png 958w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Create-Table-300x215.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Create-Table-768x549.png 768w" sizes="(max-width: 958px) 100vw, 958px" /></a><p id="caption-attachment-11628" class="wp-caption-text">Upsert Destination Create Table</p></div>
<div class="mceTemp"></div>
</li>
<li>Now select Action as Sync and check all the checkboxes: Insert, Update, and Delete from the target if not found in the source. Map all the columns and select the Key field(s) and click on OK.
<div id="attachment_11626" style="width: 968px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11626" class="size-full wp-image-11626" src="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration.png" alt="" width="958" height="645" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration.png 958w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration-300x202.png 300w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration-768x517.png 768w, https://zappysys.com/blog/wp-content/uploads/2019/08/Upsert-Destination-Configuration-272x182.png 272w" sizes="(max-width: 958px) 100vw, 958px" /></a><p id="caption-attachment-11626" class="wp-caption-text">Upsert Destination Configuration</p></div>
<div class="mceTemp"></div>
</li>
<li>That&#8217;s it, we are ready to migrate the MS Access table data into the SQL Server Table. Execute the package, and it will migrate the data.
<div class="mceTemp"></div>
<div id="attachment_11621" style="width: 412px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2019/08/2025-11-13_19-34-22.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-11621" class="size-full wp-image-11621" src="https://zappysys.com/blog/wp-content/uploads/2019/08/2025-11-13_19-34-22.png" alt="" width="402" height="226" srcset="https://zappysys.com/blog/wp-content/uploads/2019/08/2025-11-13_19-34-22.png 402w, https://zappysys.com/blog/wp-content/uploads/2019/08/2025-11-13_19-34-22-300x169.png 300w" sizes="(max-width: 402px) 100vw, 402px" /></a><p id="caption-attachment-11621" class="wp-caption-text">Upsert Destination (Insert, Update, Delete)</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this article, we show how to read data from an MS Access table and migrate it to a SQL Server table using SSIS. We show how to connect to MS Access using an OLE DB Source. <span style="box-sizing: border-box; margin: 0px; padding: 0px;">Also, we show how to write Sync Insert, Update, and Delete in the target if not found in the Source Using <a href="https://zappysys.com/products/ssis-powerpack/ssis-upsert-destination/" target="_blank" rel="noopener">ZS Upsert Destination</a>.</span> If you liked this article and <span style="box-sizing: border-box; margin: 0px; padding: 0px;">want to try it, you can download the <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack </a></span><a href="https://zappysys.com/products/ssis-powerpack/">here (includes 70+ Components)</a>.</p>
<h2><span id="References">References</span></h2>
<ul>
<li><a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">ZappySys SSIS installer.</a></li>
<li><strong>Help File: </strong><a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=ssis-upsert-destination.htm" target="_blank" rel="noopener">Upsert Destination</a></li>
</ul>
<p>The post <a href="https://zappysys.com/blog/data-migration-access-sql-server/">Data migration from Access to SQL Server using SSIS Upsert Destination</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS PowerPack v2.9.2 released (Maintenance Release)</title>
		<link>https://zappysys.com/blog/ssis-powerpack-v2-9-2/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 25 Mar 2019 20:00:28 +0000</pubDate>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[SSIS Excel Source]]></category>
		<category><![CDATA[SSIS Upsert Destination]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6641</guid>

					<description><![CDATA[<p>What&#8217;s New In this release we focused on mainly focused on fixing high priority bugs related to Upsert Destination. We also added High DPI Monitor Support with Auto Scale UI option (4K Resolution now supported) Full Notes: https://zappysys.com/onlinehelp/ssis-powerpack/scr/release-notes.htm Version 2.9.2.10321 [Mar 21, 2019] New Features/Improvements NEW: Excel Source &#8211; Add Option to read first sheet and [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-powerpack-v2-9-2/">SSIS PowerPack v2.9.2 released (Maintenance Release)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>What&#8217;s New</h2>
<p>In this release we focused on mainly focused on fixing high priority bugs related to <a href="https://zappysys.com/products/ssis-powerpack/ssis-upsert-destination/" target="_blank" rel="noopener">Upsert Destination</a>. We also added High DPI Monitor Support with Auto Scale UI option (4K Resolution now supported)</p>
<p>Full Notes: <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/release-notes.htm" target="_blank" rel="noopener">https://zappysys.com/onlinehelp/ssis-powerpack/scr/release-notes.htm</a></p>
<h2 class="vertitle">Version 2.9.2.10321 [Mar 21, 2019]</h2>
<h3 class="versubtitle">New Features/Improvements</h3>
<ul>
<li><span class="verAdded">NEW: </span>Excel Source &#8211; Add Option to read first sheet and last sheet rather than fixed name ( $last_sheet$ and $first_sheet$ )</li>
<li><span class="verAdded">NEW: </span>General &#8211; Support for UI Auto Scaling when High DPI / Font Scaling Enabled on your OS (e.g. Win10) &#8211; 4K Monitors or High Resolution Display now supported</li>
<li><span class="verAdded">NEW: </span>Generator Tarnsforms / Export Tasks for JSON, XML, CSV &#8211; Add Option to set Date Format at column level rather than global option</li>
<li><span class="verAdded">NEW: </span>Upsert Destination &#8211; Add Create Table Option based on Upstream Metadata</li>
<li><span class="verAdded">NEW: </span>Upsert Destination &#8211; Add option to preview exising data from selected table</li>
<li><span class="verAdded">NEW: </span>Upsert Destination &#8211; Add option to show source and target column datatypes</li>
</ul>
<h3 class="versubtitle">Bug fixes</h3>
<ul>
<li><span class="verFixed">FIX: </span>All Source Components &#8211; After Sorting Available Columns you may lose Output column renames in the columns grid, also output columns sorted in reverse order</li>
<li><span class="verFixed">FIX: </span>All Source Components &#8211; After Sorting Columns you cannot remove or add columns from the grid</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; Mapped Column status icon is not refreshing after column is mapped</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; varchar, char, text datatypes detected as DT_WSTR / DT_NTEXT rather than DT_STR / DT_TEXT</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; When you have zero rows in source you may get error &#8211; Invalid object name #zappysys_xxxxxx_yyyyyyyy</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; When you map to column with scale=zero (e.g. numeric(N, 0)) you may get error on save</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; You may get error when you change source column after save &#8211; An item with the same key has already been added</li>
<li><span class="verFixed">FIX: </span>Upsert Destination &#8211; You may get object reference not set error in advanced edit</li>
</ul>
<p>The post <a href="https://zappysys.com/blog/ssis-powerpack-v2-9-2/">SSIS PowerPack v2.9.2 released (Maintenance Release)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Update or Insert &#8211; Upsert MongoDB Array Items using SSIS</title>
		<link>https://zappysys.com/blog/update-insert-upsert-mongodb-array-items-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 13 Feb 2019 15:36:07 +0000</pubDate>
				<category><![CDATA[SSIS MongoDB Destination]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6346</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to update / delete mongodb array item. Now let&#8217;s look at how to Upsert MongoDB Array Items (i.e. Insert Item if not found in Array else Update existing record). Upsert into nested MongoDB Array requires two step process, unfortunately there is no easy way to do [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/update-insert-upsert-mongodb-array-items-ssis/">Update or Insert &#8211; Upsert MongoDB Array Items using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p>In our previous blog post we saw how to <a href="https://zappysys.com/blog/update-mongodb-array-items-using-ssis/" target="_blank" rel="noopener">update / delete mongodb array item</a>. Now let&#8217;s look at how to Upsert MongoDB Array Items (i.e. Insert Item if not found in Array else Update existing record). Upsert into nested MongoDB Array requires two step process, unfortunately there is no easy way to do in a single step. You may see in below screenshot that first we will do Update Step for Existing MongoDB Array Items and then we will insert missing Records in second step. So let&#8217;s get started.</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>MongoDB Array Upsert &#8211; Update / Insert using Custom JOIN condition (such as $ne )</h2>
<p>By default SSIS Mongodb Destination performs Lookup using $eq condition (Match rows using Equal operator). However there will be a time when you like to lookup and update target rows using custom join criteria (e.g. Use Not Equal condition &#8211; $ne ). V2.7.6  and later introduced new property called  <pre class="crayon-plain-tag">EnableCustomLookupQuery</pre> . When you enable this setting, you can supply a document which contains Data and Condition. You can map this XML formatted document to   __DOCUMENT__  (see below)</p>
<p>Here is the description how to use custom Join using this new property.</p><pre class="crayon-plain-tag">Enables use of custom lookup query for Update / Upsert or Delete Operation. 
By default JOIN condition for target record match is generated automatically based on columns you supply in ColumnsForLookup property. 
However in some cases you need to supply custom condition for lookup to perform complex operations, in such case enable this option. 
When you enable this option you must supply map __DOCUMENT__ input column. String you supply to this column should be in this format 

&lt;command&gt;
  &lt;query&gt;YOUR_LOOKUP_QUERY&lt;/query&gt;
  &lt;document&gt;YOUR_JSON_DOC&lt;/document&gt;
&lt;/command&gt;. 

Lookup query in &lt;query&gt; tag can be either Mongo JSON format (e.g. { \"CustomerID\" : \"AAA\", \"Orders.OrderID\" : { \"$ne\" : \"1000\" } }) 
OR
you can use ZappySys SQL query (e.g. select * from mytable where CustomerID='AAA' and [Orders.$.OrderID] != '1000' )</pre><p>
Now lets look at step by step. In below example we have a table called CustomerTest. We will load it with 2 records (With No orders). Then Update array using custom lookup condition, and later step we will insert record in array using custom lookup condition.</p>
<div id="attachment_6299" style="width: 498px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-upsert-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6299" class="size-full wp-image-6299" src="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-upsert-example.png" alt="SSIS MongoDB Array Upsert Example (Update / Insert Array Items based on custom lookup condition)" width="488" height="346" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-upsert-example.png 488w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-upsert-example-300x213.png 300w" sizes="(max-width: 488px) 100vw, 488px" /></a><p id="caption-attachment-6299" class="wp-caption-text">SSIS MongoDB Array Upsert Example (Update / Insert Array Items based on custom lookup condition)</p></div>
<h3>Update Array using Custom Lookup Condition</h3>
<ol>
<li>Lets create few sample rows in MongoDB Collection. You can use following command in SSIS MongoDB Execute SQL Task<br />
<pre class="crayon-plain-tag">{
 scope: 'database',
 db: 'Northwind',
 command: 'eval',
 args: 
 {
 code: 'db.CustomerTest.insert( [ {CustomerID:"AAA", Orders:[]}, {CustomerID:"BBB", Orders:[]}, {CustomerID:"CCC", Orders:[{OrderID:"1004","OrderDate" : "2008-02-05","Qty" : "5"} ]} ] )' 
 
 } 
}</pre>
</li>
<li>Now drag Data flow.</li>
<li>Drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">ZS CSV Source</a> or any other source. For example purpose we will configure CSV Source using Direct Value option with following Sample data. In the first run of package it will update only orders for CCC customer because only that customer will have records after table creation. one row. But in 2nd run all rows updated.<br />
<pre class="crayon-plain-tag">CustomerID,Company,OrderID,OrderDate,Qty,Address
AAA,Anthony Inc,1000,2008-01-01,90,Po Box 111\4612
AAA,Anthony Inc,1001,2010-02-01,91,Po Box 111 / 4612
BBB,Bob Inc,1002,2008-02-01,92,Po Box 222 / 4612
BBB,Bob Inc,1003,2010-01-01,93,Po Box 222 / 4612
CCC,Cindy Inc,1004,2010-01-07,2,Po Box 555 / 2345</pre>
&nbsp;</li>
<li>Click OK to save Source UI</li>
<li>Now drag ZS Template Transform to build XML document (Data + Query). Connect Source to Template transform. You can also use ZS XML Generator Transform but for simplicity we will use Template Transform.</li>
<li>Double click to open Template Transform and enter text as below. Notice how we have entered MongoDB Query and Data in two separate XML nodes. First node is custom query for lookup. Second node is Operation we like to perform (e.g. $set in our case to update existing data). You can use Insert Variable and then select Columns option to insert placeholders. Also in some fields we used JSONENCODE function to make sure we escape double quote and slash correctly.<br />
<pre class="crayon-plain-tag">&lt;command&gt;
	&lt;query&gt;&lt;![CDATA[
{
	"CustomerID": "&lt;%CustomerID%&gt;", 
	"Orders.OrderID": { "$eq" : "&lt;%OrderID%&gt;"}
}
]]&gt;&lt;/query&gt;
	&lt;document&gt;&lt;![CDATA[
{
  $set :
   { "CompanyName":"&lt;%Company,JSONENCODE%&gt;", 
     "Address":"&lt;%Address,JSONENCODE%&gt;", 
     "Orders.$.OrderID": "&lt;%OrderID%&gt;", 
     "Orders.$.OrderDate": "&lt;%OrderDate%&gt;", 
     "Orders.$.Qty": "&lt;%Qty%&gt;" 
    } 
  }
}
]]&gt;&lt;/document&gt;
&lt;/command&gt;</pre>
<div id="attachment_6300" style="width: 851px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-lookup-template-transform.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6300" class="size-full wp-image-6300" src="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-lookup-template-transform.png" alt="Using ZS Template Transform to specify custom JOIN condition for MongoDB Update (Array Items)" width="841" height="697" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-lookup-template-transform.png 841w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-lookup-template-transform-300x249.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-lookup-template-transform-768x636.png 768w" sizes="(max-width: 841px) 100vw, 841px" /></a><p id="caption-attachment-6300" class="wp-caption-text">Using ZS Template Transform to specify custom JOIN condition for MongoDB Update (Array Items)</p></div></li>
<li>Click OK to save Template Transform</li>
<li>Drag ZS MongoDB Destination. Connect Template Transform to Destination</li>
<li>Double click MongoDB Destination to edit. Set Connection, Table name, Operation=Update, <strong>EnableCustomLookupQuery</strong>=True
<div id="attachment_6301" style="width: 638px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-condition-setting.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6301" class="size-full wp-image-6301" src="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-condition-setting.png" alt="Configure MongoDB Destination for Custom Join Condition (EnableCustomLookupQuery Setting)" width="628" height="613" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-condition-setting.png 628w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-custom-condition-setting-300x293.png 300w" sizes="(max-width: 628px) 100vw, 628px" /></a><p id="caption-attachment-6301" class="wp-caption-text">Configure MongoDB Destination for Custom Join Condition (EnableCustomLookupQuery Setting)</p></div></li>
<li>Goto Mappings Tab and attach TemplateOutput to __DOCUMENT__
<div id="attachment_6302" style="width: 717px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-custom-join-mapping.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6302" class="size-full wp-image-6302" src="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-custom-join-mapping.png" alt="MongoDB Mappings - Loading Document for Array Update (Custom Join Criteria)" width="707" height="584" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-custom-join-mapping.png 707w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-custom-join-mapping-300x248.png 300w" sizes="(max-width: 707px) 100vw, 707px" /></a><p id="caption-attachment-6302" class="wp-caption-text">MongoDB Mappings &#8211; Loading Document for Array Update (Custom Join Criteria)</p></div></li>
<li>Click OK to Save</li>
</ol>
<p>&nbsp;</p>
<h3>Insert into Array using Custom Lookup Condition</h3>
<p>Now let&#8217;s look at slightly modified steps to Insert into Array for new records. In this example we will insert Source records if CustomerID found but OrderID is not found. (See Template Transform Step). We will use <strong>Not Equal Condition</strong> this time.</p>
<ol>
<li>Now drag Data flow rename it to something like <strong>[Add records to array]</strong></li>
<li>Drag ZS CSV Source or any other source. For example purpose we will configure CSV Source using Direct Value option with following Sample data<br />
<pre class="crayon-plain-tag">CustomerID,Company,OrderID,OrderDate,Qty
AAA,Anthony Inc,1000,2008-01-01,30
AAA,Anthony Inc,1001,2010-02-01,4
BBB,Bob Inc,1002,2008-02-01,30
BBB,Bob Inc,1003,2010-01-01,4</pre>
&nbsp;</li>
<li>Click OK to save Source UI</li>
<li>Now drag ZS Template Transform to build XML document (Data + Query). Connect Source to Template transform. You can also use ZS XML Generator Transform but for simplicity we will use Template Transform.</li>
<li>Double click to open Template Transform and enter text as below. Notice how we have entered MongoDB Query and Data in two separate XML nodes. First node is custom query for lookup. Second node is Operation we like to perform (e.g. $addToSet in our case to insert into array )<br />
<pre class="crayon-plain-tag">&lt;command&gt;
&lt;query&gt;
{"CustomerID": "&lt;%CustomerID%&gt;", "Orders.OrderID":{ "$ne" : "&lt;%OrderID%&gt;"}}
&lt;/query&gt;
&lt;document&gt;{
  $addToSet :
   { Orders : {"OrderID": "&lt;%OrderID%&gt;", "OrderDate": "&lt;%OrderDate%&gt;", "Qty": "&lt;%Qty%&gt;" } }    
 }
&lt;/document&gt;
&lt;/command&gt;</pre>
</li>
<li>Click OK to save Template Transform</li>
<li>Drag ZS MongoDB Destination. Connect Template Transform to Destination</li>
<li>Double click MongoDB Destination to edit. Set Connection, Table name, Operation=Update, <strong>EnableCustomLookupQuery</strong>=True</li>
<li>Goto Mappings Tab and attach TemplateOutput to __DOCUMENT__</li>
<li>Click OK to Save</li>
</ol>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2017/01/MongoDB_Upsert_ArrayItem.zip">Download Sample SSIS Package (2012 format) &#8211; MongoDB_Upsert_ArrayItem</a></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>MongoDB integration can be challenging if you are new to NoSQL world. If you are using SSIS as your primary ETL tool then not to worry because <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> can give super power needed to complete your project on time with drag and drop high performance connectors.</p>
<p>Keywords: ssis mongodb upsert array item | ssis mongodb update array item | ssis mongodb update array elements | mongodb update array documents | MongoDB $set operator | MongoDB $addToSet operator | MongoDB update sub document items | MongoDB CRUD operations | MongoDB Bulk Updates | MongoDB bulk updates to array items</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/update-insert-upsert-mongodb-array-items-ssis/">Update or Insert &#8211; Upsert MongoDB Array Items using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</title>
		<link>https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 07 Dec 2018 18:09:59 +0000</pubDate>
				<category><![CDATA[SSIS Salesforce Destination]]></category>
		<category><![CDATA[crm]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=5539</guid>

					<description><![CDATA[<p>Introduction In this article we&#8217;re going to focus on load data in Salesforce using SSIS (Bulk Insert, Update, Delete and Upsert). If you like to know how to read from Salesforce then refer to previous post here. For Demo purpose we will use AdventuresWorks sample database as our source but you can use your own [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/">Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</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/2017/09/salesforce-logo-180x180.png"><img loading="lazy" decoding="async" class="wp-image-1764 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="158" height="158" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png 180w, https://zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180-150x150.png 150w" sizes="(max-width: 158px) 100vw, 158px" /></a>In this article we&#8217;re going to focus on load data in Salesforce using SSIS (Bulk Insert, Update, Delete and Upsert). If you like to know how to read from Salesforce then refer to <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">previous post here</a>. For Demo purpose we will use AdventuresWorks sample database as our source but you can use your own Database for testing.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="content_block" id="custom_post_widget-2523"><h2><span id="Prerequisites">Prerequisites</span></h2>
Before we perform the steps listed in this article, you will need to make sure the following prerequisites are met:
<ol style="margin-left: 1.5em;">
 	<li><abbr title="SQL Server Integration Services">SSIS</abbr> designer installed. Sometimes it is referred to as <abbr title="Business Intelligence Development Studio">BIDS</abbr> or <abbr title="SQL Server Data Tools">SSDT</abbr> (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from the Microsoft site</a>).</li>
 	<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
 	<li>Make sure <span style="text-decoration: underline;"><a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a></span> is installed (<a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">download it</a>, if you haven't already).</li>
 	<li>(<em>Optional step</em>)<em>.</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360035974593" target="_blank" rel="noopener">Read this article</a>, if you are planning to deploy packages to a server and schedule their execution later.</li>
</ol></div>
<h2>Salesforce developer account</h2>
<p>To develop ETLs in Salesforce using SSIS you&#8217;ll need a Salesforce developer account. If you don&#8217;t have one, don&#8217;t worry, you can create a limited version FREE developer account. Click here to Sign up for <a href="https://developer.salesforce.com/signup" target="_blank" rel="noopener">FREE developer</a> account.</p>
<h2>Video Tutorial – Salesforce Insert, Upsert, Delete, Update</h2>
<a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FulQLMIaSdJQ%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Getting Started</h2>
<p>In this section, we will see how to perform bulk insert, update delete and upsert operations using <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></p>
<h3>Configure Salesforce Connection</h3>
<p>First, we&#8217;ll need setup a connection to read or write Salesforce data is to make sure we have a working connection in SSIS.</p>
<ol>
<li>Create new or open existing SSIS Project in Visual Studio.</li>
<li>Open SSIS Package and Go to SSIS designer.</li>
<li>Right click in the connection manager panel and click <strong>New connection</strong>
<div id="attachment_3560" style="width: 756px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3560" class="wp-image-3560 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg" alt="SSIS create a new connection CRM Dynamics" width="746" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg 746w, https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection-300x162.jpg 300w" sizes="(max-width: 746px) 100vw, 746px" /><p id="caption-attachment-3560" class="wp-caption-text">Create a new SSIS Salesforce Connection</p></div></li>
<li>In the connection type selection, Select the <strong>ZS-SALESFORCE </strong>Connection.</li>
<li>We&#8217;ll use this information: Username, Password, Security Token (<em>click the link learn how to obtain</em> <a href="https://zappysys.zendesk.com/hc/en-us/articles/360000220714-How-to-obtain-alesforce-Security-Token" target="_blank" rel="noopener">Salesforce Security Token</a> )</li>
<li>Click OK to add the connection.
<div id="attachment_5979" style="width: 682px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5979" class="size-full wp-image-5979" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection.png" alt="Salesforce using SSIS, Salesforce connection" width="672" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection.png 672w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-connection-300x237.png 300w" sizes="(max-width: 672px) 100vw, 672px" /><p id="caption-attachment-5979" class="wp-caption-text">Salesforce using SSIS, Salesforce connection</p></div></li>
<li>Save all changes</li>
</ol>
<h2>Bulk Insert &#8211; Import data into Salesforce using SSIS</h2>
<p>Let&#8217;s start with the a bulk insert in Salesforce using SSIS. On this section, we&#8217;re going to generate retrieve data from and OLEDB Source and proceed to Insert the records into Salesforce using <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a>.</p>
<h3>Configure SQL Server Source (OLEDB)</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Go to data flow designer. Drag and drop an OLE DB Source</li>
<li>Open the OLE DB Source and configure as follow:
<div id="attachment_5964" style="width: 512px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5964" class="size-full wp-image-5964" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1.png" alt="salesforce-using-ssis-insert-source-oledb" width="502" height="399" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1.png 502w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-source-oledb-1-300x238.png 300w" sizes="(max-width: 502px) 100vw, 502px" /><p id="caption-attachment-5964" class="wp-caption-text">Configure SQL Server Source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Insert</h3>
<p>Once SQL Server source is configure. Now let&#8217;s configure Salesforce Destination for Bulk Insert like below.</p>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the destination component</li>
<li>Connection Manager
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="size-full wp-image-5972" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, upsert destination connection manager</p></div></li>
<li>Component Properties
<div id="attachment_5966" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5966" class="size-full wp-image-5966" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1.png" alt="salesforce-using-ssis-insert-properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-properties-1-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5966" class="wp-caption-text">salesforce-using-ssis-insert-properties</p></div></li>
<li>Column Mappings
<div id="attachment_5967" style="width: 762px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5967" class="size-full wp-image-5967" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping.png" alt="salesforce-using-ssis-insert-mapping" width="752" height="379" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping.png 752w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-mapping-300x151.png 300w" sizes="(max-width: 752px) 100vw, 752px" /><p id="caption-attachment-5967" class="wp-caption-text">salesforce-using-ssis-insert-mapping</p></div></li>
<li>Click OK</li>
<li>Drag and drop two <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
<li>Connect ZS Salesforce Destination for: New records Output and Error Output</li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5968" style="width: 864px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5968" class="size-full wp-image-5968" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results.png" alt="salesforce-using-ssis-insert-results" width="854" height="280" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results.png 854w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results-300x98.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-insert-results-768x252.png 768w" sizes="(max-width: 854px) 100vw, 854px" /><p id="caption-attachment-5968" class="wp-caption-text">salesforce-using-ssis-insert-results</p></div></li>
</ol>
<h2>Bulk Update &#8211; Modify data in Salesforce using SSIS</h2>
<p>In this section we&#8217;re going to perform a bulk update on Salesforce using SSIS. We&#8217;re going to list some information from our source, list all our Salesforce Account data, merge it and only update the data we match. In below example what we will do is Find out matching records in Salesforce and our Source System based on some External Key field (e.g. AccountNumber in our case). And then obtain Salesforce Record <strong>Id</strong> for matching AccountNumber and use it to Update target record.</p>
<div class="su-note"  style="border-color:#e5de9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">If you are storing Salesforce Id fields part of your Source System then you don&#8217;t need to use Merge Transform to lookup by External ID field (e.g. AccountNumber in our case). Simply Attach Source with Salesforce Destination and map Id field along with other fields you like to Update. </div></div>
<h3>Configure SQL Server Source (OLEDB Source)</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox</li>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DB Source and configure
<div id="attachment_5981" style="width: 486px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5981" class="size-full wp-image-5981" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source.png" alt="Salesforce using SSIS, Update OLEDB source" width="476" height="402" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source.png 476w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-source-300x253.png 300w" sizes="(max-width: 476px) 100vw, 476px" /><p id="caption-attachment-5981" class="wp-caption-text">Salesforce using SSIS, Update OLEDB source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Source</h3>
<ol>
<li>Now lets Drag and drop <strong>ZS Salesforce Source</strong></li>
<li>Open the ZS Salesforce and configure. You can select <strong>Query Mode</strong> and enter query like this because we only care about two fields for now. Use query mode whenever possible because it transfers less data.<br />
<pre class="crayon-plain-tag">select Id,AccountNumber from account</pre>
<div id="attachment_5982" style="width: 896px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5982" class="size-full wp-image-5982" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source.png" alt="Salesforce using SSIS, Update Salesforce source" width="886" height="508" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source.png 886w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source-300x172.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-source-768x440.png 768w" sizes="(max-width: 886px) 100vw, 886px" /><p id="caption-attachment-5982" class="wp-caption-text">Salesforce using SSIS, Update Salesforce source</p></div></li>
</ol>
<h3>Configure Sort Transforms</h3>
<p>Now lets sort both previous datasets using Sort Transforms. This is needed to JOIN dataset using Merge Transform (See next section)</p>
<ol>
<li>Drag and drop: 2 Sort and 1 Merge Join components</li>
<li>Connect the OLE DB Source to the <strong>first</strong> Sort component, and configure
<div id="attachment_5983" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5983" class="size-full wp-image-5983" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png" alt="Salesforce using SSIS, Update OLEBD sort" width="709" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png 709w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort-300x140.png 300w" sizes="(max-width: 709px) 100vw, 709px" /><p id="caption-attachment-5983" class="wp-caption-text">Salesforce using SSIS, Update OLEBD sort</p></div></li>
<li>Connect the Salesforce Source to the <strong>second</strong> Sort component, and configure
<div id="attachment_5984" style="width: 720px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5984" class="size-full wp-image-5984" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png" alt="Salesforce using SSIS,update Salesforce sort" width="710" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png 710w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort-300x140.png 300w" sizes="(max-width: 710px) 100vw, 710px" /><p id="caption-attachment-5984" class="wp-caption-text">Salesforce using SSIS,update Salesforce sort</p></div></li>
</ol>
<h3>Configure Merge Transforms</h3>
<p>No next step would be to join previous datasets based on AccountNumber and then we will output Id from Salesforce which is needed for later step.</p>
<ol>
<li>Drag and Drop Merge Transform from SSIS Toolbox like below.
<div id="attachment_6267" style="width: 448px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6267" class="size-full wp-image-6267" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png" alt="Drag SSIS Merge Join Transform from Toolbox" width="438" height="340" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png 438w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item-300x233.png 300w" sizes="(max-width: 438px) 100vw, 438px" /></a><p id="caption-attachment-6267" class="wp-caption-text">Drag SSIS Merge Join Transform from Toolbox</p></div></li>
<li>Connect Sorts to the Merge component (<em>sort from OLEDB Source most be on the left</em>)</li>
<li>Configure the Merge component
<div id="attachment_5985" style="width: 771px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5985" class="size-full wp-image-5985" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge.png" alt="Salesforce using SSIS, update merge" width="761" height="714" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge.png 761w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-merge-300x281.png 300w" sizes="(max-width: 761px) 100vw, 761px" /><p id="caption-attachment-5985" class="wp-caption-text">Salesforce using SSIS, update merge</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Update</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the ZS Salesforce Destination and configure</li>
<li>Connection Manager tab
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="wp-image-5972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, update destination connection manager</p></div></li>
<li>Component Properties tab
<div id="attachment_5986" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5986" class="size-full wp-image-5986" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties.png" alt="Salesforce using SSIS, update destination component properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5986" class="wp-caption-text">Salesforce using SSIS, update destination component properties</p></div></li>
<li><div class="su-note"  style="border-color:#e5ae9d;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:#ffc8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For Update purposes, Salesforce Destinations needs to map the ID from the Account object. For more information, please use the following link <a href="https://zappysys.zendesk.com/hc/en-us/articles/360008228693-SSIS-Salesforce-Destination-Update-Insert-with-Lookup-Fields-Text-to-Id-">SSIS Salesforce Destination &#8211; Update / Insert with Lookup Fields (Text to Id)</a> </div></div></li>
<li>Column Mapping
<div id="attachment_5987" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5987" class="size-full wp-image-5987" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings.png" alt="salesforce using SSIS, update destination column mappings" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-destination-column-mappings-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5987" class="wp-caption-text">salesforce using SSIS, update destination column mappings</p></div></li>
<li>Click OK</li>
<li>Drag and drop three <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
<li>Create two connections from ZS Salesforce Destination as follows: <strong>Update records and Error Output</strong></li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5988" style="width: 951px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5988" class="size-full wp-image-5988" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results.png" alt="Salesforce using SSIS, update results" width="941" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results.png 941w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results-300x155.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-results-768x396.png 768w" sizes="(max-width: 941px) 100vw, 941px" /><p id="caption-attachment-5988" class="wp-caption-text">Salesforce using SSIS, update results</p></div></li>
</ol>
<h2>Bulk Upsert &#8211; Import/Modify data in Salesforce using SSIS</h2>
<p>In this section we&#8217;re going to perform a bulk upsert of 25 record&#8217;s on Salesforce using SSIS. Upsert is an operation that combines both insert an update.</p>
<p><a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a> allows Upserts operations. You&#8217;ll need to select the Upsert as an action and indicate the Key value for the comparison.</p>
<h3>Creating External ID field for Salesforce Upsert</h3>
<p>For the Upsert action we have to use an Upsert Keyfield (i.e. External ID field). For more information read here <a href="https://help.salesforce.com/articleView?id=000005395&amp;language=en_US&amp;type=1">External ID</a>. Follow these steps to add a External ID field on Salesforce Accounts object:</p>
<ol>
<li>Login to your Salesforce account.</li>
<li>Click on the configuration icon and select &#8220;Service Setup&#8221;
<div id="attachment_6090" style="width: 382px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6090" class="wp-image-6090" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-upsert-keyfield-1.png" alt="salesforce-using-ssis-salesforce-edit-object" width="372" height="404" /><p id="caption-attachment-6090" class="wp-caption-text">Salesforce using SSIS, Salesforce edit object</p></div></li>
<li>On the new Tab, look for USER INTERFACE -&gt; Objects And Fields -&gt; Object Manager</li>
<li>Select Account object</li>
<li>Select Fields &amp; Relationships</li>
<li>Click New, to create a field
<div id="attachment_6091" style="width: 683px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6091" class="wp-image-6091 " src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration.png" alt="salesforce-using-ssis-salesforce-fieldsandconfiguration" width="673" height="241" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration.png 627w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-salesforce-fieldsandconfiguration-300x108.png 300w" sizes="(max-width: 673px) 100vw, 673px" /><p id="caption-attachment-6091" class="wp-caption-text">Salesforce using SSIS, Salesforce Fields &amp; Configuration</p></div></li>
<li>For the field type, choose Number and click next</li>
<li>For Field Label and Field Name, type TableID. Check Unique and External ID boxes and click next</li>
<li>Leave field-level security as default, click next</li>
<li>Leave page layouts as default, click next.</li>
<li>After finishing the configuration, the field should appear in the Fields &amp; Relationships page</li>
</ol>
<h3>Configure SQL Server Source</h3>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DEB Source and configure as follow
<div id="attachment_5971" style="width: 489px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5971" class="size-full wp-image-5971" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source.png" alt="Salesforce using SSIS, Upsert OLE DB source" width="479" height="408" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source.png 479w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-oledb-source-300x256.png 300w" sizes="(max-width: 479px) 100vw, 479px" /><p id="caption-attachment-5971" class="wp-caption-text">Salesforce using SSIS, Upsert OLE DB source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Upsert</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Open the ZS Salesforce and configure</li>
<li>Connection Manager
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="size-full wp-image-5972" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, upsert destination connection manager</p></div></li>
<li>Component Properties
<div id="attachment_5973" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5973" class="size-full wp-image-5973" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties.png" alt="Salesforce using SSIS, upsert destination component properties" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5973" class="wp-caption-text">Salesforce using SSIS, upsert destination component properties</p></div></li>
<li>Column Mapping
<div id="attachment_5974" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5974" class="size-full wp-image-5974" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping.png" alt="salesforce using SSIS, upsert destination column mapping" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-column-mapping-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5974" class="wp-caption-text">salesforce using SSIS, upsert destination column mapping</p></div></li>
<li>Click OK</li>
<li>Drag and drop three <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> components</li>
</ol>
<h3>Configure Error Handling, Outputs for New, Updated, Failed Records</h3>
<p>If you like to capture which rows are inserted and which rows are updated then you can drag Blue arrows coming from Salesforce destination component. You can also connect Red arrow to detect failed records and reason for error.</p>
<ol>
<li>Connect ZS Salesforce Destination for: New records Output, Updated Records Output and Error Output</li>
<li>Right click on the joining arrows and enable data viewers on all previous connections</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_5975" style="width: 1131px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5975" class="size-full wp-image-5975" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results.png" alt="Salesforce using SSIS, upsert results" width="1121" height="485" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results.png 1121w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-300x130.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-768x332.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-results-1024x443.png 1024w" sizes="(max-width: 1121px) 100vw, 1121px" /><p id="caption-attachment-5975" class="wp-caption-text">Salesforce using SSIS, upsert results</p></div></li>
</ol>
<h2>Bulk Delete &#8211; Delete data in Salesforce using SSIS</h2>
<p>In this section, we&#8217;re going to perform a bulk delete on Salesforce using SSIS <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a>. In this example we&#8217;re going to list all our source customers (from previous sections), merge it wit the Salesforce Account object, retrieve the Salesforce Account Id and delete the rows. Delete Operation also requires to map Id field so we will use similar technique we used for Update.</p>
<h3>Configure SQL Server Source (OLEDB Source)</h3>
<ol>
<li>Go to data flow designer. Drag and drop OLE DB Source</li>
<li>Open the OLE DEB Source and configure as follow
<div id="attachment_6020" style="width: 516px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6020" class="size-full wp-image-6020" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source.png" alt="" width="506" height="406" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source.png 506w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-oledb-source-300x241.png 300w" sizes="(max-width: 506px) 100vw, 506px" /><p id="caption-attachment-6020" class="wp-caption-text">salesforce-using-ssis-delete-oledb-source</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Source</h3>
<ol>
<li>Drag and drop <strong>ZS Salesforce Source</strong></li>
<li>Open the ZS Salesforce and configure.</li>
<li>You can select <strong>Query Mode</strong> and enter query like this because we only care about two fields for now. Use query mode whenever possible because it transfers less data.<br />
<pre class="crayon-plain-tag">select Id,AccountNumber from account</pre>
</li>
</ol>
<h3>Configure Sort Transforms</h3>
<p>Now lets sort both previous datasets using Sort Transforms. This is needed to JOIN dataset using Merge Transform (See next section)</p>
<ol>
<li>Drag and drop: 2 Sort and 1 Merge Join components</li>
<li>Connect the OLE DB Source to the <strong>first</strong> Sort component, and configure
<div id="attachment_5983" style="width: 719px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5983" class="size-full wp-image-5983" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png" alt="Salesforce using SSIS, Update OLEBD sort" width="709" height="330" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort.png 709w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-oledb-sort-300x140.png 300w" sizes="(max-width: 709px) 100vw, 709px" /><p id="caption-attachment-5983" class="wp-caption-text">Salesforce using SSIS, Update OLEBD sort</p></div></li>
<li>Connect the Salesforce Source to the <strong>second</strong> Sort component, and configure
<div id="attachment_5984" style="width: 720px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5984" class="size-full wp-image-5984" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png" alt="Salesforce using SSIS,update Salesforce sort" width="710" height="332" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort.png 710w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-update-salesforce-sort-300x140.png 300w" sizes="(max-width: 710px) 100vw, 710px" /><p id="caption-attachment-5984" class="wp-caption-text">Salesforce using SSIS,update Salesforce sort</p></div></li>
</ol>
<h3>Configure Merge Transforms</h3>
<p>No next step would be to join previous datasets based on AccountNumber and then we will output Id from Salesforce which is needed for later step.</p>
<ol>
<li>Now drag Merge Transform from SSIS toolbox
<div id="attachment_6267" style="width: 448px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6267" class="size-full wp-image-6267" src="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png" alt="Drag SSIS Merge Join Transform from Toolbox" width="438" height="340" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item.png 438w, https://zappysys.com/blog/wp-content/uploads/2018/12/ssis-merge-join-transform-toolbox-item-300x233.png 300w" sizes="(max-width: 438px) 100vw, 438px" /></a><p id="caption-attachment-6267" class="wp-caption-text">Drag SSIS Merge Join Transform from Toolbox</p></div></li>
<li>Connect both Sort to the Merge component (<em>sort from OLEDB Source most be on the left</em>)</li>
<li>Configure the Merge component
<div id="attachment_6021" style="width: 749px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6021" class="size-full wp-image-6021" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge.png" alt="" width="739" height="375" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge.png 739w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-merge-300x152.png 300w" sizes="(max-width: 739px) 100vw, 739px" /><p id="caption-attachment-6021" class="wp-caption-text">salesforce-using-ssis-delete-merge</p></div></li>
</ol>
<h3>Configure SSIS Salesforce Destination for Bulk Delete</h3>
<ol>
<li>Drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a></li>
<li>Connect the Merge and <a href="https://zappysys.com/products/ssis-powerpack/ssis-salesforce-destination-connector/" target="_blank" rel="noopener">ZS Salesforce Destination</a> components. Right click the arrow and enable data viewer</li>
<li>Connection Manager tab
<div id="attachment_5972" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5972" class="wp-image-5972 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-upsert-destination-connection-manager-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-5972" class="wp-caption-text">Salesforce using SSIS, delete destination connection manager</p></div></li>
<li>Component Properties tab
<div id="attachment_6022" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6022" class="wp-image-6022 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-component-properties-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-6022" class="wp-caption-text">Salesforce using SSIS, delete destination component properties</p></div></li>
<li><div class="su-note"  style="border-color:#e5ae9d;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:#ffc8b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">For Delete purposes, Salesforce Destinations needs to map the ID from the Account object.For more information, please use the following link <a href="https://zappysys.zendesk.com/hc/en-us/articles/360008228693-SSIS-Salesforce-Destination-Update-Insert-with-Lookup-Fields-Text-to-Id-">SSIS Salesforce Destination &#8211; Update / Insert with Lookup Fields (Text to Id)</a> </div></div></li>
<li>Column Mapping
<div id="attachment_6025" style="width: 768px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6025" class="size-full wp-image-6025" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping.png" alt="" width="758" height="563" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping.png 758w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-destination-column-mapping-300x223.png 300w" sizes="(max-width: 758px) 100vw, 758px" /><p id="caption-attachment-6025" class="wp-caption-text">salesforce-using-ssis-delete-destination-column-mapping</p></div></li>
<li>Click OK</li>
<li>Save all changes</li>
<li>Right click in the data flow designer, click Execute Task
<div id="attachment_6023" style="width: 908px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-6023" class="size-full wp-image-6023" src="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results.png" alt="" width="898" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results.png 898w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results-300x163.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/12/salesforce-using-ssis-delete-results-768x416.png 768w" sizes="(max-width: 898px) 100vw, 898px" /><p id="caption-attachment-6023" class="wp-caption-text">salesforce-using-ssis-delete-results</p></div></li>
</ol>
<h2>Error Handling</h2>
<p>When working on Salesforce with SSIS, we recommend <a href="https://zappysys.com/onlinehelp/ssis-powerpack/index.htm#page=trash-destination.htm" target="_blank" rel="noopener">Trash Destination</a> component to help debugging outputs without performing DML on destinations.</p>
<p>Main benefits of usage:</p>
<ol>
<li>Enable data viewers and get live feedback of the data</li>
<li>Save the results on different formats (<em>XML, JSON, plain text files</em>).</li>
</ol>
<h2>Conclusion</h2>
<p>In this article, We have seen how easy it is to integrate Salesforce using SSIS. Using drag and drop connector you can perform Bulk insert, update, delete and Upsert operations.</p>
<p>Download <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> to learn more about other possible scenarios which are not discussed in this article.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/loading-data-salesforce-using-ssis-bulk-insert-update-delete/">Load data in Salesforce using SSIS  – Insert, Upsert, Delete, Update</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Load data into Dynamics CRM using SSIS &#8211; Insert, Upsert, Delete, Update</title>
		<link>https://zappysys.com/blog/load-dynamics-crm-using-ssis-insert-upsert-delete-update/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Thu, 05 Jul 2018 19:20:32 +0000</pubDate>
				<category><![CDATA[SSIS Dynamics CRM Destination]]></category>
		<category><![CDATA[dynamics crm]]></category>
		<category><![CDATA[office 365]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=4318</guid>

					<description><![CDATA[<p>Introduction In our previous article, we talked about how to read from Dynamics CRM / Dataverse (Dynamics 365 / On-Premises CRM / PowerApp). Now let&#8217;s look at how to Load data into Dynamics CRM / Dataverse (Dynamics 365 / On-Premises CRM / PowerApp) using SSIS. We will see a few important aspects of loading data into Dynamics [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/load-dynamics-crm-using-ssis-insert-upsert-delete-update/">Load data into Dynamics CRM using SSIS &#8211; Insert, Upsert, Delete, Update</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/05/dynamics-crm-365-logo-300x300.png"><img loading="lazy" decoding="async" class=" wp-image-3577 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/05/dynamics-crm-365-logo-300x300.png" alt="" width="104" height="94" /></a>In our previous article, we talked about how to <a href="https://zappysys.com/blog/ssis-dynamics-crm-read-import-crm-365-onpremises/" target="_blank" rel="noopener">read from Dynamics CRM / Dataverse (Dynamics 365 / On-Premises CRM / PowerApp)</a>. Now let&#8217;s look at how to Load data into Dynamics CRM / Dataverse (Dynamics 365 / On-Premises CRM / PowerApp) using SSIS. We will see a few important aspects of loading data into Dynamics CRM / Dataverse Online (i.e. Dynamics 365) and On-premises / IFD (Internet facing hosted instance).</p>
<p>We will show you how to use <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamics-crm-destination-connector/" target="_blank" rel="noopener">SSIS Dynamics CRM Destination</a> connector for Bulk Insert, Update, Delete and Upsert Operations. This article uses Dynamics 365 Online for CRM Integration Examples but concepts are same for other types of installation (e.g. IFD or On-Premises)</p>
<h2>Requirements</h2>
<ol>
<li>Make sure you have SSIS Designer installed (i.e. <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt?view=sql-server-2017" target="_blank" rel="noopener">SSDT-BI</a>)</li>
<li>Download and Installed <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> which includes an SSIS Dynamics CRM Connectors.</li>
<li>Finally, make sure you have Microsoft Dynamics CRM / Dataverse credentials handy.</li>
</ol>
<p>That&#8217;s it. So let&#8217;s get started.</p>
<h2>Video Tutorial &#8211; CRM Insert, Upsert, Delete, Update</h2>
<a href="https://zappysys.com/blog/load-dynamics-crm-using-ssis-insert-upsert-delete-update/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FfBbRzTcd3fk%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>&nbsp;</p>
<h2>Getting Started</h2>
<p>In this section, we will see how to perform bulk insert, update delete and upsert operations using  <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamics-crm-destination-connector/" target="_blank" rel="noopener">SSIS Dynamics CRM Destination</a></p>
<h3>Configure SSIS Dynamics CRM / Dataverse Connection</h3>
<p>The first step to read or write Dynamics CRM / Dataverse data is to make sure we have working Dynamics CRM connection in SSIS.</p>
<ol>
<li>Create new or open existing SSIS Project in Visual Studio.</li>
<li>Open SSIS Package and Go to SSIS designer.</li>
<li>
        Right click in the connection manager panel and click <strong>New connection</strong>:</p>
<p>        <div id="attachment_3560" style="width: 756px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3560" class="size-full wp-image-3560" src="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg" alt="SSIS create a new connection CRM Dynamics" width="746" height="403" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection.jpg 746w, https://zappysys.com/blog/wp-content/uploads/2018/05/create-a-new-connection-300x162.jpg 300w" sizes="(max-width: 746px) 100vw, 746px" /></a><p id="caption-attachment-3560" class="wp-caption-text">Create a new SSIS Dynamics CRM / Dataverse Connection</p></div>
    </li>
<li>In the connection type selection, Select the <strong>ZS-DYNAMICS-CRM</strong> Connection.</li>
<li>
        We will use a <strong>CRM Online</strong> (Office 365) connection, <strong>region</strong>, a <strong>username</strong> and a <strong>password</strong> and select <strong>organization</strong> from the dropdown as below and then click <strong>Test connection</strong>:</p>
<p>        <div id="attachment_3559" style="width: 775px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-credentials-zs.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-3559" class="size-full wp-image-3559" src="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-credentials-zs.jpg" alt="SSIS Dynamics CRM / Dataverse credentials" width="765" height="633" srcset="https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-credentials-zs.jpg 765w, https://zappysys.com/blog/wp-content/uploads/2018/05/ssis-credentials-zs-300x248.jpg 300w" sizes="(max-width: 765px) 100vw, 765px" /></a><p id="caption-attachment-3559" class="wp-caption-text">Configure Dynamics CRM / Dataverse Connection in SSIS</p></div>
    </li>
</ol>
<h3></h3>
<h3>Bulk Insert &#8211; SQL Server data Import into Dynamics CRM / Dataverse using SSIS</h3>
<p>Now, let&#8217;s see steps to do SQL Server data Import into Dynamics CRM / Dataverse using SSIS. Below steps assume you already have sample data in some SQL Server Table which will be used to create new CRM accounts. You can enter few account names you like to create in the CRM.</p>
<ol>
<li>Open SSIS Package and drag Data Flow task from Control Flow SSIS Toolbox</li>
<li>Go to data flow designer. Drag and drop OLEDB Source</li>
<li>
        Configure OLEDB Source to read from some sample data table (e.g. dbo.Accounts). If you want to be lazy and just test quickly you can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-csv-file-source-flat-file-web-api/" target="_blank" rel="noopener">ZS CSV Source</a> (Direct Value Mode) instead of OLEDB Source.<strong>Sample Data May be like below</strong><br />
<pre class="crayon-plain-tag">name,address1_city,address1_country
Flipkart,Bengaluru,India
Microsoft,seattle,USA
Nokia,Espoo,Finland</pre>
        Once you configure Source (Connection, Table Name etc.) click OK to save it.</p>
<p>        <div id="attachment_4351" style="width: 785px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-insert-accounts-to-dynamics-crm-online-365.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4351" class="size-full wp-image-4351" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-insert-accounts-to-dynamics-crm-online-365.png" alt="CSV Source - Sample Accounts for CRM Insert Demo" width="775" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-insert-accounts-to-dynamics-crm-online-365.png 775w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-insert-accounts-to-dynamics-crm-online-365-300x233.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-insert-accounts-to-dynamics-crm-online-365-768x597.png 768w" sizes="(max-width: 775px) 100vw, 775px" /></a><p id="caption-attachment-4351" class="wp-caption-text">CSV Source &#8211; Sample Accounts for CRM Insert Demo</p></div>
    </li>
<li>Drag and drop  <a href="https://zappysys.com/products/ssis-powerpack/ssis-dynamics-crm-destination-connector/" target="_blank" rel="noopener">ZS Dynamics CRM Destination</a> from the toolbox.</li>
<li>Connect Source to your Destination component.</li>
<li>Double click CRM destination to configure it.</li>
<li>
        On the Connection Managers tab, Select Dynamics CRM / Dataverse connection we created in the previous section.</p>
<p>        <div id="attachment_4353" style="width: 526px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-select-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4353" class="size-full wp-image-4353" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-select-connection.png" alt="Select Connection for Dynamics CRM / Dataverse Destination" width="516" height="286" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-select-connection.png 516w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-select-connection-300x166.png 300w" sizes="(max-width: 516px) 100vw, 516px" /></a><p id="caption-attachment-4353" class="wp-caption-text">Select Connection for Dynamics CRM / Dataverse Destination</p></div>
    </li>
<li>
        On the Component Properties Tab Select <strong>Table Name</strong>.</p>
<p>        <div id="attachment_4354" style="width: 807px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-insert-records-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4354" class="size-full wp-image-4354" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-insert-records-settings.png" alt="Select Target Table for Dynamics CRM / Dataverse Insert" width="797" height="429" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-insert-records-settings.png 797w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-insert-records-settings-300x161.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-insert-records-settings-768x413.png 768w" sizes="(max-width: 797px) 100vw, 797px" /></a><p id="caption-attachment-4354" class="wp-caption-text">Select Target Table for Dynamics CRM / Dataverse Insert</p></div>
    </li>
<li>
        On the Mapping Tab map few columns (e.g.  <strong>name</strong>, <strong>address1_city, </strong>and <strong><strong><strong>address1_country)</strong></strong></strong></p>
<p>        <div id="attachment_4355" style="width: 792px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4355" class="size-full wp-image-4355" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings.png" alt="Configure Target Column Mapping for CRM Data Load" width="782" height="519" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings.png 782w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings-300x199.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings-768x510.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-target-column-mappings-272x182.png 272w" sizes="(max-width: 782px) 100vw, 782px" /></a><p id="caption-attachment-4355" class="wp-caption-text">Configure Target Column Mapping for CRM Data Load</p></div>
    </li>
<li>Click OK to save CRM destination.</li>
<li>
        Right click in the data flow designer, click Execute Task</p>
<p>        <div id="attachment_4356" style="width: 519px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-loading-data-into-dynamics-crm-online.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4356" class="wp-image-4356 size-full" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-loading-data-into-dynamics-crm-online.png" alt="Execute SSIS Package - Import into Dynamics CRM / Dataverse using SSIS " width="509" height="224" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-loading-data-into-dynamics-crm-online.png 509w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-loading-data-into-dynamics-crm-online-300x132.png 300w" sizes="(max-width: 509px) 100vw, 509px" /></a><p id="caption-attachment-4356" class="wp-caption-text">Execute SSIS Package &#8211; Loading Data into Dynamics CRM / Dataverse from CSV / SQL Server</p></div>
    </li>
</ol>
<h3>Bulk Upsert &#8211; Update or Insert Dynamics CRM / Dataverse Records in SSIS</h3>
<p>In the previous section we saw how to Insert New records. However sometimes you want to Upsert (Insert or Update). So if record already exists Update else Insert. In order to achieve this you have to set two additional attributes. For CRM Upsert you have to perform few changes to previous steps</p>
<h4>Create Alternate Key for CRM Upsert</h4>
<p>To perform Upsert operation you can map Table&#8217;s Primary Key or Alternate Key. Primary Key usually starts with table name and ends with &#8220;id&#8221; (e.g. for account table its accountid ).</p>
<p>Many times Source system don&#8217;t have CRM Table Primary Key. In such case you may use Alternate Key in the mapping (JOIN Key). To use Alternate key for Upsert you have first define Alternate Key in CRM Portal. <a href="https://technet.microsoft.com/library/29e53691-0b18-4fde-a1d0-7490aa227898.aspx" target="_blank" rel="noopener">Check this link for exact steps</a>.</p>
<div id="attachment_4359" style="width: 1056px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4359" class="size-full wp-image-4359" src="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data.png" alt="Create Alternate Key for Dynamics CRM / Dataverse Online Table (Useful for Update or Upsert Operation)" width="1046" height="522" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data.png 1046w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data-300x150.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data-768x383.png 768w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data-1024x511.png 1024w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-365-create-alternate-key-upsert-records-update-insert-data-960x480.png 960w" sizes="(max-width: 1046px) 100vw, 1046px" /></a><p id="caption-attachment-4359" class="wp-caption-text">Create Alternate Key for Dynamics CRM / Dataverse Online Table (Useful for Update or Upsert Operation)</p></div>
<h4>Configure SSIS CRM Destination for Upsert</h4>
<ol>
<li>Double click CRM destination. On the Component Properties Tab, Change Operation to <strong>UpdateOrInsert</strong></li>
<li>
        Specify <strong>UpsertKeyField</strong> to either Table&#8217;s Primary Key Column Name or Alternate Key Name.</p>
<p>        <div id="attachment_4360" style="width: 932px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-update-insert-use-alternate-key-field.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4360" class="size-full wp-image-4360" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-update-insert-use-alternate-key-field.png" alt="Dynamics CRM / Dataverse Upsert using SSIS CRM Destination (Specify Alternate Key / Primary Key)" width="922" height="740" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-update-insert-use-alternate-key-field.png 922w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-update-insert-use-alternate-key-field-300x241.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-update-insert-use-alternate-key-field-768x616.png 768w" sizes="(max-width: 922px) 100vw, 922px" /></a><p id="caption-attachment-4360" class="wp-caption-text">Dynamics CRM / Dataverse Upsert Records using SSIS CRM Destination (Specify Alternate Key / Primary Key)</p></div>
    </li>
<li>
        Now go to Mappings tab and confirm Key field is mapped.</p>
<p>        <div id="attachment_4361" style="width: 866px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-mappings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4361" class="size-full wp-image-4361" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-mappings.png" alt="Configure Dynamics CRM / Dataverse Mapping for Upsert in SSIS" width="856" height="642" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-mappings.png 856w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-mappings-300x225.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-upsert-mappings-768x576.png 768w" sizes="(max-width: 856px) 100vw, 856px" /></a><p id="caption-attachment-4361" class="wp-caption-text">Configure Dynamics CRM / Dataverse Mapping for Upsert in SSIS</p></div>
    </li>
<li>Click OK and Run Package to test CRM Upsert Operation.</li>
</ol>
<p>&nbsp;</p>
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#FFF7B7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;">If you want to use primary key for Upsert or Update Operation and not sure correct column name then you may use <a href="//zappysys.com/products/ssis-powerpack/ssis-dynamics-crm-source-connector/" target="_blank" rel="noopener">ZappySys Dynamics CRM / Dataverse Source</a> FetchXml Query Mode and check Object Browser (Table Info Tab &gt;&gt; <strong>PrimaryIdAttribute</strong> in the grid).</p>
<p>Primary Key name usually starts with table name and ends with &#8220;id&#8221; (e.g. for account table its <strong>accountid</strong> ).</p>
<div id="attachment_4358" style="width: 602px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-find-primarykey-column.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4358" class=" wp-image-4358" src="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-find-primarykey-column.png" alt="Find Primary Key for Dynamics CRM / Dataverse Table" width="592" height="424" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-find-primarykey-column.png 792w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-find-primarykey-column-300x215.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/dynamics-crm-find-primarykey-column-768x550.png 768w" sizes="(max-width: 592px) 100vw, 592px" /></a><p id="caption-attachment-4358" class="wp-caption-text">Find Primary Key for Dynamics CRM / Dataverse Table</p></div>
</div></div>
<h4>Handling Inserted / Updated Records Output</h4>
<p>Now lets look at how to detect which records got inserted and which records got Update? In Upsert Mode each record can be directed to one of the following three Outputs.</p>
<ul>
<li>Inserted Records [Blue Arrow]</li>
<li>Updated Records [Blue Arrow]</li>
<li>Records with Error [Red Arrow]</li>
</ul>
<p>You can select Red or Blue arrow coming out from CRM Destination component. Drag and drop output arrow on any down stream component.</p>
<h3>Bulk Update &#8211; Modify Dynamics CRM / Dataverse Records in SSIS</h3>
<p>If you want to do bulk Update its very same steps as Upsert Operation except you have to set <strong>Operation = Update</strong> in the properties grid. For Key field you have to set primary key or Alternate Key.</p>
<div id="attachment_4362" style="width: 482px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-update-records.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4362" class="size-full wp-image-4362" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-update-records.png" alt="Dynamics CRM / Dataverse Update in SSIS" width="472" height="474" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-update-records.png 472w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-update-records-150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-update-records-300x300.png 300w" sizes="(max-width: 472px) 100vw, 472px" /></a><p id="caption-attachment-4362" class="wp-caption-text">Dynamics CRM / Dataverse Update in SSIS</p></div>
<h3>Bulk Delete &#8211; Delete Dynamics CRM / Dataverse Records in SSIS</h3>
<p>Bulk delete doesn&#8217;t require many settings. All you have to change is <strong>Operation = Delete</strong> on Component Properties Screen. On the Mapping Screen Map only one column (Primary Key). If you are not sure which one is primary key please refer to the previous section (Upsert Operation).</p>
<div id="attachment_4363" style="width: 687px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-delete.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4363" class="size-full wp-image-4363" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-delete.png" alt="Delete records from Dynamics CRM / Dataverse Online using SSIS (Primary Key mapping for CRM Bulk Delete)" width="677" height="483" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-delete.png 677w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-delete-300x214.png 300w" sizes="(max-width: 677px) 100vw, 677px" /></a><p id="caption-attachment-4363" class="wp-caption-text">Delete records from Dynamics CRM / Dataverse Online using SSIS (Primary Key mapping for CRM Bulk Delete)</p></div>
<p>Some times you may get below errors. If you get this error make sure you delete all child records first before deleting parent. For example if you are deleting account then make sure you have to delete leads / contacts for that account or update leads / contacts so they don&#8217;t refer to account being deleted.</p><pre class="crayon-plain-tag">Error: 0xC0047062 at Dynamics CRM / Dataverse Bulk Delete, Delete Accounts [2]: System.Exception: Exception: The object you tried to delete is associated with another object and cannot be deleted.
Error Details: 
ApiExceptionSourceKey=Plugin/Microsoft.Crm.Common.ObjectModel.AccountService</pre><p>
<h2>Error Handling</h2>
<p>Many times you want to ignore bad records and continue processing good records. In such case you can use Dynamics CRM / Dataverse Error Output. Just grad Red arrow from CRM Destination and Drop on target component. Select Redirect Option for Error , Truncation both and Click OK.</p>
<p>Once you set Error Handling your component will continue to run without failing whole data flow. Later you can review errors (if you saving to destination).</p>
<div id="attachment_4364" style="width: 863px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-configure-error-output.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4364" class="size-full wp-image-4364" src="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-configure-error-output.png" alt="Configure Error Handling in SSIS Dynamics CRM / Dataverse Destination" width="853" height="801" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-configure-error-output.png 853w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-configure-error-output-300x282.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/ssis-dynamics-crm-destination-configure-error-output-768x721.png 768w" sizes="(max-width: 853px) 100vw, 853px" /></a><p id="caption-attachment-4364" class="wp-caption-text">Configure Error Handling in SSIS Dynamics CRM / Dataverse Destination</p></div>
<p>&nbsp;</p>
<div id="attachment_4365" style="width: 853px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/07/insert-dynamics-crm-records-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4365" class="size-full wp-image-4365" src="https://zappysys.com/blog/wp-content/uploads/2018/07/insert-dynamics-crm-records-ssis.png" alt="Loading records into Dynamics CRM / Dataverse Table using SSIS . Redirect Bad rows to Error Output." width="843" height="422" srcset="https://zappysys.com/blog/wp-content/uploads/2018/07/insert-dynamics-crm-records-ssis.png 843w, https://zappysys.com/blog/wp-content/uploads/2018/07/insert-dynamics-crm-records-ssis-300x150.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/07/insert-dynamics-crm-records-ssis-768x384.png 768w" sizes="(max-width: 843px) 100vw, 843px" /></a><p id="caption-attachment-4365" class="wp-caption-text">Loading records into Dynamics CRM / Dataverse Table using SSIS . Redirect Bad rows to Error Output.</p></div>
<h2>Handling Special Data Types (PartyList, Lookup, PickList)</h2>
<p>Certain datatypes in CRM requires special handling. <a href="https://zappysys.zendesk.com/hc/en-us/articles/360004361833-How-to-handle-Dynamics-CRM-PartyList-Lookup-and-PickList-datatypes-in-SSIS" target="_blank" rel="noopener">Check this article</a> to learn more about how to insert data into columns with <strong>PartyList</strong>, <strong>Lookup</strong> or <strong>PickList</strong> field.</p>
<h2>Conclusion</h2>
<p>In this article, We have seen how easy it is to integrate SQL Server data with Dynamics CRM / Dataverse. Using drag and drop connector you can perform Bulk insert, update, delete and Upsert operations. Download <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">ZappySys SSIS PowerPack</a> to learn more about other possible scenarios which are not discussed in this article.</p>
<p>The post <a href="https://zappysys.com/blog/load-dynamics-crm-using-ssis-insert-upsert-delete-update/">Load data into Dynamics CRM using SSIS &#8211; Insert, Upsert, Delete, Update</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Update MongoDB Array Items using SSIS</title>
		<link>https://zappysys.com/blog/update-mongodb-array-items-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 21 Jan 2017 23:00:55 +0000</pubDate>
				<category><![CDATA[SSIS MongoDB Destination]]></category>
		<category><![CDATA[SSIS MongoDB ExecuteSQL]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[ssis json source]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=952</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to perform Read and Write operations in MongoDB using SSIS (i.e. Bulk Update, Delete, Upsert, Insert). In this post we specifically focus on how to update MongoDB Array items / elements using SSIS. To make things simple to follow we have used JSON Source to produce [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/update-mongodb-array-items-using-ssis/">Update MongoDB Array Items using 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/2017/08/mongodb-logo.png"><img loading="lazy" decoding="async" class="size-full wp-image-2115 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/08/mongodb-logo.png" alt="" width="88" height="88" /></a>In <a href="https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/" target="_blank" rel="noopener">our previous blog post</a> we saw how to perform Read and Write operations in MongoDB using SSIS (i.e. Bulk Update, Delete, Upsert, Insert). In this post we specifically focus on <em>how to update MongoDB Array items / elements using SSIS</em>.</p>
<p>To make things simple to follow we have used <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a> to produce sample JSON documents for MongoDB update (NOTE: Output as Document option is checked for JSON Source). However in real world you may have to use <a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a> to produce input documents for MongoDB. To learn more about generating JSON documents for MongoDB Load process <a href="//zappysys.com/blog/create-mongodb-documents-ssis-json-bson-load-update-insert-upsert-collection/" target="_blank" rel="noopener">check this blog post</a> or watch video found <a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">on this page</a>.</p>
<h2>Video Tutorial &#8211; Example of insert/update documents inside MongoDB Array (Use $set, $push operator)</h2>
<a href="https://zappysys.com/blog/update-mongodb-array-items-using-ssis/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FcaiLHfF-pzg%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>Basic Concepts: Performing MongoDB CRUD operations using SSIS</h2>
<p>If you never heard term called CRUD stands for Create, Read, Update, Delete. These are the most common operations you have to do with any data source. <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> comes with many MongoDB Components to help you with CRUD operations. You can use one or more following components to achieve drag and drop MongoDB CRUD operations in SSIS. When you use SSIS PowerPack for MongoDB all operations will be Bulk Operations by default which means it will provide very high throughput.</p>
<ul>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-source/" target="_blank" rel="noopener">SSIS MongoDB Source</a></li>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-destination/" target="_blank" rel="noopener">SSIS MongoDB Destination</a></li>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-executesql-task/" target="_blank" rel="noopener">SSIS MongoDB ExecuteSQL Task</a></li>
</ul>
<h2>Download Example SSIS Package</h2>
<p>Here is the link to <a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-array-update-sample-package.zip">download Sample SSIS Package</a></p>
<div id="attachment_958" style="width: 711px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-update-mongodb-array-items-delete-insert-set-push-pull.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-958" class="size-full wp-image-958" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-update-mongodb-array-items-delete-insert-set-push-pull.png" alt="SSIS Example : Update MongoDB Array Items / Elements (Update, Delete, Insert - Using $set, $pull, $push)" width="701" height="487" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-update-mongodb-array-items-delete-insert-set-push-pull.png 701w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-update-mongodb-array-items-delete-insert-set-push-pull-300x208.png 300w" sizes="(max-width: 701px) 100vw, 701px" /></a><p id="caption-attachment-958" class="wp-caption-text">SSIS Example : Update MongoDB Array Items / Elements (Update, Delete, Insert &#8211; Using $set, $pull, $push)</p></div>
<p>&nbsp;</p>
<h2>Update MongoDB Array Items ($set operator)</h2>
<p>In next couple of sections we will see how to perform Update, Insert and Delete operations with MongoDB Array Items using various <a href="https://docs.mongodb.com/manual/reference/operator/update/" target="_blank" rel="noopener">update operators</a> and <a href="https://docs.mongodb.com/manual/reference/operator/update-array/" target="_blank" rel="noopener">array operators</a>. Consider the following Sample JSON documents for MongoDB. First we will see how to use MongoDB Shell commands to perform CRUD operations on MongoDB Array items.</p><pre class="crayon-plain-tag">{
    "_id" : ObjectId("5883ebe669e0f22ba890b49b"),
    "CustomerID" : "BOLID",
    "Name" : "Some name",
    "Orders" : [ 
        {
            "OrderID" : 200,
            "ShipCountry" : "USA",
            "City" : "Atlanta"
        }, 
        {
            "OrderID" : 201,
            "ShipCountry" : "USA",
            "City" : "New York"
        }
    ]
}</pre><p>
<h3>Update Array element using Shell command</h3>
<p>Assume you want to update ShipCountry attribute of one of the Orders (OrderID=200) and for CustomerID=&#8221;BOLID&#8221; in above sample document.</p>
<h4>Shell Command for Update Array Item</h4>
<p>Use below shell command in your favorite MongoDB Client Tool (e.g. RoboMongo). Notice two things in below command because we will apply same concepts when we take this approach to SSIS. In below command Actual JSON document is wrapped inside. This is MongoDB Update operator. <a href="https://docs.mongodb.com/manual/reference/operator/update/set/" target="_blank" rel="noopener">Click here to learn more about $set</a>. Also notice that rather than nested Array syntax we used Orders.$.ShipCountry to update ShipCountry which is part of Array element. MongoDB provides special way to navigate array elements using   <a href="https://docs.mongodb.com/manual/reference/operator/update/positional/" target="_blank" rel="noopener">$ Operator (MongoDB Positional Update) </a></p><pre class="crayon-plain-tag">db.MyCollection.update(
	{ "CustomerID" : "BOLID", "Orders.OrderID" : 200 }, 
	{ $set : { "Orders.$.ShipCountry" : "Test1"} } , 
	{ upsert: false, multi: false}
)</pre><p>
<h4>After Update (MongoDB Document)</h4>
<p>After you run above shell command notice all other attributes remain there in Array document and only ShipCountry is changed. This is because we used <a href="https://docs.mongodb.com/manual/reference/operator/update/positional/" target="_blank" rel="noopener">$ Operator (MongoDB Positional Update) </a>rather than supplying Raw JSON for Array document (i.e. Orders : [ { &#8230; } ] ).</p><pre class="crayon-plain-tag">{
    "_id" : ObjectId("5883ebe669e0f22ba890b49b"),
    "CustomerID" : "BOLID",
    "Name" : "Some name",
    "Orders" : [ 
        {
            "OrderID" : 200,
            "ShipCountry" : "Test1",
            "City" : "Atlanta"
        }, 
        {
            "OrderID" : 201,
            "ShipCountry" : "USA",
            "City" : "New York"
        }
    ]
}</pre><p>
The issue with this approach its not Bulk operation. Assume that you have 100,000 records to update in various documents and its nested array items then row by row operation is not effective. To solve this issue we will use SSIS MongoDB Destination which performs Bulk operations (e.g. Bulk Update, Delete, Insert and Upsert).</p>
<h3>Update MongoDB Array Items using SSIS</h3>
<p>Now lets implement above scenario using SSIS. Assume that you have sample MongoDB document (as per above example &#8211; Before Update). We want to update ShipCountry for OrderID=200 for Customer BOLID. To do that perform following steps in SSIS. If you are updating Second level array (i.e. Root &gt;&gt; Orders &gt;&gt; OrderItems)  then you have follow slight different process. Check next section in this article about updating second level array (Insert items)</p>
<ol>
<li>Download and <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">Install SSIS PowerPack</a></li>
<li>Create new SSIS Project with one data flow task
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-8028" class="size-full wp-image-8028" src="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png" alt="" width="460" height="155" srcset="https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task.png 460w, https://zappysys.com/blog/wp-content/uploads/2019/02/drag-and-drop-data-flow-task-300x101.png 300w" sizes="(max-width: 460px) 100vw, 460px" /><p id="caption-attachment-8028" class="wp-caption-text">Dragging and dropping Data Flow Task into Control Flow</p></div></li>
<li>Drag ZS JSON Source and check Output as Document option (as below sceenshot). You can use JSON Source is your JSON is stored inside file or Variable or coming from Some API call which eventually go into MongoDB. You can also use JSON Source for quick testing where you Hardcode JSON to feed to MongoDB.</li>
<li>Enter the following JSON in the text area. Click OK to save.<br />
<pre class="crayon-plain-tag">{"CustomerID":"BOLID", "Orders.$.OrderID":201, "Orders.$.ShipCountry": "Test1"}
{"CustomerID":"BOLID", "Orders.$.OrderID":202, "Orders.$.ShipCountry": "Test2"}
/**Below is extra record not found in destination - will be ignored in Update**/
{"CustomerID":"BOLID", "Orders.$.OrderID":203, "Orders.$.ShipCountry": "Test3"}</pre>
</li>
<li>Right click in Connections area and Create new ZS-MONGODB connection. Specify credentials and click Test before you hit OK to save.</li>
<li>Now drag ZS MongoDB Destination from SSIS Toolbox.</li>
<li>Select Runtime connection.</li>
<li>On the properties tab edit following properties
<ol>
<li>Set ColumnsForLookup property as below (Notice how we use 2 columns for JOIN. Also used AS keywords for 2nd Column so we have <em>&lt;column-from-input-doc&gt; AS &lt;column-for-server-side-find&gt;</em><br />
<strong><em>CustomerID,Orders.$.OrderID AS Orders.OrderID</em></strong></li>
<li>Set LoadOptions as below (Op is <a href="https://docs.mongodb.com/manual/reference/operator/update" target="_blank" rel="noopener">Update Operator</a> you like to use. In our case its <a href="https://docs.mongodb.com/manual/reference/operator/update/set/" target="_blank" rel="noopener">$set</a>, Multi=True means if multiple match found then all matching documents will be updated). If you want to use multiple update operators then you have to supply that from Input document and use <strong>op=none</strong> option rather <strong>op=$set</strong>.<br />
<strong><em>op=$set;multi=true</em></strong></li>
<li>Set Operation property to Update</li>
</ol>
</li>
<li>On the Mappings tab Map __DOCUMENT__ from upstream (In our case you will see same name column from JSON Source if you checked Output as Document option)</li>
<li>Click OK to save MongoDB Destination UI</li>
<li>Run package. You will notice after execution two orders of CustomerID=BOLID will be updated.</li>
</ol>
<div id="attachment_961" style="width: 853px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-read-raw-json-documents.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-961" class="size-full wp-image-961" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-read-raw-json-documents.png" alt="SSIS JSON Source - Read JSON (Raw Documents)" width="843" height="507" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-read-raw-json-documents.png 843w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-read-raw-json-documents-300x180.png 300w" sizes="(max-width: 843px) 100vw, 843px" /></a><p id="caption-attachment-961" class="wp-caption-text">SSIS JSON Source &#8211; Read JSON (Raw Documents)</p></div>
<h2></h2>
<div id="attachment_962" style="width: 749px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-update-mongodb-item-set-operator.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-962" class="size-full wp-image-962" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-update-mongodb-item-set-operator.png" alt="SSIS MongoDB Destination - Update MongoDB Array Item using $set update operator" width="739" height="469" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-update-mongodb-item-set-operator.png 739w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-update-mongodb-item-set-operator-300x190.png 300w" sizes="(max-width: 739px) 100vw, 739px" /></a><p id="caption-attachment-962" class="wp-caption-text">SSIS MongoDB Destination &#8211; Update MongoDB Array Item using $set update operator</p></div>
<h2>Insert MongoDB Array Item ($push / $addToSet Operator)</h2>
<p>Now lets look at how to insert new item into existing Array. Lets say we already have two orders for a customer and now we want to add new order. For this you can either use  <a href="https://docs.mongodb.com/manual/reference/operator/update/push/" target="_blank" rel="noopener">$push operator</a> or <a href="https://docs.mongodb.com/manual/reference/operator/update/addToSet/" target="_blank" rel="noopener">$addToSet operator</a>. $push operator doesn&#8217;t check for duplicate item so its little faster. If you wish to skip append if item already exists (by matching all attributes) then use $addToSet operator.</p>
<h3>Using Shell Command : Insert MongoDB Array Item (Append to array)</h3>
<p>Here is the shell command which will push new item to the array</p><pre class="crayon-plain-tag">db.MyCollection.update(
	{CustomerID:"BOLID"},
	{$push:{Orders: {"OrderID":202,"ShipCountry":"USA","ShipCity":"Atlanta" } }},
	{upsert: false,multi: false}
)</pre><p>
&nbsp;</p>
<h3>Using Shell Command : Insert MongoDB Array Item at second level</h3>
<p>Here is the shell command which will push new item to the array which is stored at second level e.g. { Orders :  [ { Items : [ insert-here ] } ] }</p><pre class="crayon-plain-tag">db.MyCollection.update(
	{CustomerID:"BOLID", "Orders.OrderID" : 202 },
	{$push:{ "Orders.$.Items" : {"ProductID":1001,"Quantity":3} } },
	{upsert: false,multi: false}
)</pre><p>
<h3>Using SSIS : Insert MongoDB Array Item at Second Level</h3>
<p>Now lets look at some example how to Insert Items inside Orders array. Since it requires two JOIN columns to perform second level array insert you may need to add metadata for join.</p>
<p>First step is create documents for update. There are atleast 4 ways you can create input documents for MongoDB Destination.</p>
<ol>
<li>You can use <a href="//zappysys.com/blog/create-mongodb-documents-ssis-json-bson-load-update-insert-upsert-collection/" target="_blank" rel="noopener">JSON generator Transform to create documents for load process</a></li>
<li>You can use <a href="//zappysys.com/blog/export-json-from-sql-server-using-ssis/" target="_blank" rel="noopener">Export JSON Task to generate input documents</a> file and then use JSON Source to Read Documents (Check Output as Document option on JSON Source to read as RAW JSON)</li>
<li>You can use JSON Source to feed direct JSON (This approach is demonstrated in the below example sceenshot)</li>
<li>You can also use SQL query to output JSON Strings along with columns used for JOIN condition<br />
<pre class="crayon-plain-tag">select CustomerID, OrderID as 'Orders.$.OrderID', DOC = '{Orders.$.Items : {ItemID: 1, Qty: 5} }'</pre>
</li>
</ol>
<p>To make it simple lets use #3 approach from above list. We will create few documents and insert New orders Items</p>
<h4>Sample Document for MongoDB Collection</h4>
<p>For testing purpose you can create MongoDB collection called test with following one document. As you see Items array is empty for both orders but once you run sample each will have 2 items.</p><pre class="crayon-plain-tag">{
    "_id" : ObjectId("58c01bee0610fea8ddda04b9"),
    "CustomerID" : "ALFKI",
    "Orders" : [ 
        {
            "OrderID" : 100,
            "Items" : [ ]
        }, 
        {
            "OrderID" : 101,
            "Items" : [ ]
        }
    ]
}</pre><p>
Now lets look at how to configure SSIS package</p>
<p>&nbsp;</p>
<h4>Step-1 : Create JSON Documents for Array Insert</h4>
<p>Lets use JSON Source like below. Use following Sample JSON</p><pre class="crayon-plain-tag">/*Insert new items into order#100*/
{CustomerID:"ALFKI","Orders.$.OrderID" : 100, Doc: "{ \"Orders.$.Items\" : {ItemID: 1, Qty: 10} }" }
{CustomerID:"ALFKI","Orders.$.OrderID" : 100, Doc: "{ \"Orders.$.Items\" : {ItemID: 2, Qty: 11} }" }

/*Insert new items into order#101*/
{CustomerID:"ALFKI","Orders.$.OrderID" : 101, Doc: "{ \"Orders.$.Items\" : {ItemID: 1, Qty: 20} }" }
{CustomerID:"ALFKI","Orders.$.OrderID" : 101, Doc: "{ \"Orders.$.Items\" : {ItemID: 2, Qty: 21} }" }</pre><p>
&nbsp;</p>
<p>&nbsp;</p>
<div id="attachment_1064" style="width: 990px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-second-level-array-update-push-insert-items-2nd.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1064" class="size-full wp-image-1064" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-second-level-array-update-push-insert-items-2nd.png" alt="Create Sample JSON Documents for MongoDB Array Update (2nd level array)" width="980" height="744" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-second-level-array-update-push-insert-items-2nd.png 980w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-second-level-array-update-push-insert-items-2nd-300x228.png 300w" sizes="(max-width: 980px) 100vw, 980px" /></a><p id="caption-attachment-1064" class="wp-caption-text">Create Sample JSON Documents for MongoDB Array Update (2nd level array)</p></div>
<h4>Step-2 : Configure MongoDB Destination for $push operation on Second level Array</h4>
<p>Now lets connect source to Destination and configure MongoDB Destination. Select connection on first tab. Then On second tab change properties like below.</p>
<p>&nbsp;</p>
<div id="attachment_1065" style="width: 620px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-second-level-array-update-push-.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1065" class="size-full wp-image-1065" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-second-level-array-update-push-.png" alt="Configure MongoDB Destination for second level array update (Insert item using $push update operator)" width="610" height="608" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-second-level-array-update-push-.png 610w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-second-level-array-update-push--150x150.png 150w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-second-level-array-update-push--300x300.png 300w" sizes="(max-width: 610px) 100vw, 610px" /></a><p id="caption-attachment-1065" class="wp-caption-text">Configure MongoDB Destination for second level array update (Insert item using $push update operator)</p></div>
<h4>Step-3 : Add missing JOIN column for Mapping</h4>
<p>When you click on Mappings tab you will notice only root level columns are listed there for mapping but if you are JOINing based on Nested column found inside array then you have to add missing mapping column by hand like below screenshot.  In our case we Join by CustomerID and OrderID where OrderID is found in Orders array which is missing on mappings tab. So lets add it. Just make sure name new column using $ positional operator&#8230; e.g. Orders.$.OrderID  this will tell MongoDB that our OrderID column must be lookup under Array called Orders: [  ]
<div id="attachment_1066" style="width: 696px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-add-missing-columns-metadata-edit.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1066" class="size-full wp-image-1066" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-add-missing-columns-metadata-edit.png" alt="MongoDB Destination - Add missing metadata column for JOIN " width="686" height="694" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-add-missing-columns-metadata-edit.png 686w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-add-missing-columns-metadata-edit-297x300.png 297w" sizes="(max-width: 686px) 100vw, 686px" /></a><p id="caption-attachment-1066" class="wp-caption-text">MongoDB Destination &#8211; Add missing metadata column for JOIN</p></div>
<h4>Step-4 : Map JOIN columns and Input DOCUMENT</h4>
<p>Now finally map all columns</p>
<div id="attachment_1067" style="width: 641px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-mappings-second-level-array-update-push.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1067" class="size-full wp-image-1067" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-mappings-second-level-array-update-push.png" alt="SSIS MongoDB Destination - Column Mappings" width="631" height="742" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-mappings-second-level-array-update-push.png 631w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-configure-mappings-second-level-array-update-push-255x300.png 255w" sizes="(max-width: 631px) 100vw, 631px" /></a><p id="caption-attachment-1067" class="wp-caption-text">SSIS MongoDB Destination &#8211; Column Mappings</p></div>
<h3>Using SSIS : Insert MongoDB Array Item (Append to array)</h3>
<p>Now lets look at how to perform same operation to insert array item in SSIS using $push operator. In this case we will do little different than Update Item example ($set operator). First we have not included CustomerID as part of Input columns and we mapped it on Mapping Screen rather than supplying columns names in ColumnsForLookup property (On Component Properties Tab of Destination UI). If you are using JSON Generator Transform to generate your JSON then you have option to Hide/Include certain columns part of your flow. Check Include column to downstream option if you want to use for JOIN column.</p>
<p>Set following settings</p>
<ul>
<li>Set LoadOptions as below<br />
<strong>op=$push;multi=true</strong></li>
<li>Set Operation=Update</li>
<li>Leave ColumnsForLookup as empty</li>
<li>On the mappings tab map __DOCUMENT__ and CustomerID in the Target. If you don&#8217;t see CustomerID column in the mapping create atleast one sample doc in MongoDB Collection so metadata is detected.</li>
</ul>
<p>Download Sample for more detail.</p>
<div id="attachment_966" style="width: 958px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-generate-json-for-mongodb-array-item-insert.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-966" class="size-full wp-image-966" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-generate-json-for-mongodb-array-item-insert.png" alt="SSIS JSON Source - generate JSON for MongoDB Array Insert" width="948" height="516" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-generate-json-for-mongodb-array-item-insert.png 948w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-json-source-generate-json-for-mongodb-array-item-insert-300x163.png 300w" sizes="(max-width: 948px) 100vw, 948px" /></a><p id="caption-attachment-966" class="wp-caption-text">SSIS JSON Source &#8211; generate JSON for MongoDB Array Insert</p></div>
<div id="attachment_968" style="width: 684px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-insert-array-item-push-addtoset-operator.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-968" class="size-full wp-image-968" src="//zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-insert-array-item-push-addtoset-operator.png" alt="SSIS MongoDB Destination - Insert MongoDB Array Item (Use $push, or $addToSet operator)" width="674" height="436" srcset="https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-insert-array-item-push-addtoset-operator.png 674w, https://zappysys.com/blog/wp-content/uploads/2017/01/ssis-mongodb-destination-insert-array-item-push-addtoset-operator-300x194.png 300w" sizes="(max-width: 674px) 100vw, 674px" /></a><p id="caption-attachment-968" class="wp-caption-text">SSIS MongoDB Destination &#8211; Insert MongoDB Array Item (Use $push, or $addToSet operator)</p></div>
<h2>Delete MongoDB Array Item ($pull operator)</h2>
<p>If you wish to remove array item then you can use <a href="https://docs.mongodb.com/manual/reference/operator/update/pull/" target="_blank" rel="noopener">$pull operator</a>. Only difference is rather than specifying two conditions in first argument&#8230; you just specify JOIN columns without array column (i.e. OrderID). To specify Array item condition you have to set inside $pull : { &#8230; }</p>
<h3>Using Shell Command for MongoDB Delete Array Item (Remove by condition)</h3>
<p>Below example shows how to remove OrderID=201 from Orders array for CustomerID=BOLID.</p><pre class="crayon-plain-tag">db.MyCollection.update(
	{CustomerID:"BOLID"},
	{$pull:{Orders: {"OrderID":201} }},
	{upsert: false,multi: false}
)</pre><p>
&nbsp;</p>
<h3>Using SSIS for MongoDB Delete Array Item</h3>
<p>Now lets look at how to implement Delete logic for MongoDB Array Item in SSIS. As you see in below screenshots You have to modify following things</p>
<ul>
<li>Set ColumnsForLookup property to CustomerID (no need to add OrderID here because its part of input document)</li>
<li>Set LoadOptions property to op=none;multi=false. op=none means we are supplying Update operator part of input document.</li>
</ul>
<p>Assume you have doc like below in MongoDB  and you like to remove Order#101 from array</p><pre class="crayon-plain-tag">{
    "_id" : ObjectId("58c01bee0610fea8ddda04b9"),
    "ParentID" : 1,
    "Orders" : [ 
        100, 
        101, 
        102
    ]
}</pre><p>
For this supply 2 columns from upstream<br />
col1  = ParentID<br />
col2  = DOCUMENT</p>
<p>Document column should look like below<br />
{Orders: 101}</p>
<ol>
<li>On MongoDB destination change LoadOptions property to  op=$pull;multi=true</li>
<li>Change Operation to Update</li>
<li>Map ParentID and DOCUMENT columns on Mapping screen</li>
<li>Run the package &#8230; It will remove Order# 101 from array</li>
</ol>
<h2>Array Upsert &#8211; Update / Insert using Custom JOIN condition (such as $ne )</h2>
<p>If you like to perform Upsert Operation on MongoDB Array Items then refer to below blog post.</p>
<blockquote class="wp-embedded-content" data-secret="kVibThe8Ux"><p><a href="https://zappysys.com/blog/update-insert-upsert-mongodb-array-items-ssis/">Update or Insert &#8211; Upsert MongoDB Array Items using SSIS</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted" src="https://zappysys.com/blog/update-insert-upsert-mongodb-array-items-ssis/embed/#?secret=kVibThe8Ux" data-secret="kVibThe8Ux" width="600" height="338" title="&#8220;Update or Insert &#8211; Upsert MongoDB Array Items using SSIS&#8221; &#8212; ZappySys Blog" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>MongoDB integration can be challenging if you are new to NoSQL world. If you are using SSIS as your primary ETL tool then not to worry because <a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> can give super power needed to complete your project on time with drag and drop high performance connectors.</p>
<p>Keywords: mongodb update array item | mongodb update array elements | mongodb update array documents | MongoDB $ operator | MongoDB update sub document items | MongoDB CRUD operations | MongoDB Bulk Updates | MongoDB bulk updates to array items</p>
<p>The post <a href="https://zappysys.com/blog/update-mongodb-array-items-using-ssis/">Update MongoDB Array Items using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SSIS &#8211; Loading data into MongoDB (Upsert, Delete, Update)</title>
		<link>https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Fri, 26 Feb 2016 22:03:21 +0000</pubDate>
				<category><![CDATA[SSIS MongoDB Destination]]></category>
		<category><![CDATA[export json task]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[MongoDB]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis connectors]]></category>
		<category><![CDATA[SSIS Dummy Data Source]]></category>
		<category><![CDATA[SSIS Export JSON Task]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS MongoDB ExecuteSQL Task]]></category>
		<category><![CDATA[SSIS MongoDB Source]]></category>
		<category><![CDATA[ssis tasks]]></category>
		<category><![CDATA[upsert]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=374</guid>

					<description><![CDATA[<p>Introduction MongoDB is one of the most poplar NoSQL database out there. In this article you will learn how to use ZappySys MongoDB Destination Connector to perform various bulk operations on MongoDB such as Insert, Update, Delete and Upsert. If you wish to learn how to Update MongoDB Array items then check this blog post instread. [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/">SSIS &#8211; Loading data into MongoDB (Upsert, Delete, Update)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img loading="lazy" decoding="async" class="size-full wp-image-2115 alignleft" src="https://zappysys.com/blog/wp-content/uploads/2017/08/mongodb-logo.png" alt="" width="88" height="88" />MongoDB is one of the most poplar <strong>NoSQL database</strong> out there. In this article you will learn how to use <a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-destination/">ZappySys MongoDB Destination Connector</a> to perform various bulk operations on MongoDB such as Insert, Update, Delete and Upsert. If you wish to learn <a href="//zappysys.com/blog/update-mongodb-array-items-using-ssis/" target="_blank" rel="noopener">how to Update MongoDB Array items then check this blog post instread</a>.</p>
<p>&nbsp;</p>
<h2>MongoDB data read/write Example SSIS Package</h2>
<p>Before we talk more about loading data into MongoDB lets look at screenshot and steps involved in our sample package for this tutorial. Below sample SSIS package uses 4 <strong>Custom SSIS Tasks</strong></p>
<ol>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-source/">SSIS MongoDB Source Connector</a> (Used to read data from MongoDB Collection)</li>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-destination/">SSIS MongoDB Destination Connector</a> (Used to write data into MongoDB Collection also you can do other bulk operations such as MongoDB update, MongoDB upsert and MongoDB delete)</li>
<li><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-executesql-task/">SSIS MongoDB ExecuteSQL Task</a> (Used to call any MongoDB Shell commands including MongoDB DDL or DML type operations such as CREATE/DROP, Insert, Update, Delete, Read, you can also call server side JavaScript)</li>
<li><a href="//zappysys.com/products/ssis-powerpack/dummy-data-source-free/">Dummy Data Source</a> (Used to generate sample JSON Documents which can be loaded in MongoDB)</li>
</ol>
<h2>MongoDB Examples</h2>
<p>Here is the list of various MongoDB examples included in attached sample package (see at the end for download links)</p>
<ul>
<li>MongoDB example &#8211; How to <em>read data from MongoDB</em> collection using SQL query language</li>
<li>MongoDB example &#8211; How to <em>load raw JSON document</em> into MongoDB Collection (<strong>Bulk Insert with Reload</strong>)</li>
<li>MongoDB example &#8211; How to do <em>MongoDB Upsert</em> (<strong>Bulk Update</strong> or Insert) for specific fields or entire document</li>
<li>MongoDB example &#8211; How to perform MongoDB Delete ( <strong>Bulk Delete</strong> based on Matching Rows)</li>
<li>MongoDB example &#8211; How to <strong>create new MongoDB collection</strong> (Only if not exist &#8211; Use safe option)</li>
<li>MongoDB example &#8211; How to fetch MongoDB collection <strong>record count</strong> and save to SSIS variable</li>
<li>MongoDB example &#8211; How to fetch MongoDB <strong>collection size</strong> and save to SSIS variable</li>
<li>MongoDB example &#8211; How to <strong>get collection names</strong> and loop through them using ForEach Loop Task</li>
<li>MongoDB example &#8211; How to <strong>save query output</strong> into Recordset variable and loop though records using ForEach Loop Task</li>
</ul>
<h2>Video Tutorial &#8211; Update/Delete/Write/Bulk Load data into MongoDB from SQL Server/ORACLE</h2>
<p>In below video tutorial you will see how easy it is to load data into MongoDB from any Datasource such as SQL Server, Oracle, MySQL, Flatfile etc. You will also learn how to product nested JSON from multiple tables using <a href="//zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON Generator Transform</a>. You can also use <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/" target="_blank" rel="noopener">JSON Source</a> with Output as Document Mode to load raw JSON data.</p>
<div><a href="https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FFkQjUahzMJQ%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></div>
<h2>Video Tutorial &#8211; Read data from MongoDB</h2>
<p>In the following video tutorial you will learn how to consume data from MongoDB Collection using <a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-source/" target="_blank" rel="noopener">SSIS MongoDB Source Connector</a>. You will notice that it uses <strong>SQL query syntax</strong> rather than MongoDB specific native query syntax (JSON query). This makes it super easy to query data without any learning curve. Data stored in MongoDB is in JSON document format but Data coming out from <strong>MongoDB Source Connector</strong> is Flat table structure (It de-normalize nested nodes). You can also Query inner Hierarchy using <strong>JSON Path expression</strong> (e.g. query Orders from Customer Document using <strong>$.Customer.Orders[*]</strong> ) .</p>
<div><a href="https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FksvCA8FxOzI%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></div>
<div id="attachment_388" style="width: 362px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-loading-data-into-mongodb-read-from-mongodb-upsert-delete-insert-example.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-388" class="size-full wp-image-388" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-loading-data-into-mongodb-read-from-mongodb-upsert-delete-insert-example.png" alt="SSIS Example - Loading data into MongoDB, Read from MongoDB, Upsert, Upsert, Delete Insert JSON Documents, Execute Shell Commands" width="352" height="482" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-loading-data-into-mongodb-read-from-mongodb-upsert-delete-insert-example.png 352w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-loading-data-into-mongodb-read-from-mongodb-upsert-delete-insert-example-219x300.png 219w" sizes="(max-width: 352px) 100vw, 352px" /></a><p id="caption-attachment-388" class="wp-caption-text">SSIS Example &#8211; Loading data into MongoDB, Read from MongoDB, Upsert, Upsert, Delete Insert JSON Documents, Execute Shell Commands</p></div>
<h2>MongoDB Insert &#8211; Bulk Loading data into MongoDB</h2>
<p>Using MongoDB Destination Connector you can easily Insert JSON documents in Bulk. There are two input modes for inserting records into MongoDB.</p>
<h3>Simple Mode &#8211; Loading data in simple mode (array not allowed)</h3>
<p>In simple loading mode you can map source columns to target column in MongoDB destination. If you Insert data using this mode then you cant load complex documents with array.</p>
<h3>Document Mode &#8211; Loading JSON documents into MongoDB</h3>
<p>In this mode you can insert/update/delete documents by mapping inbuilt __DOCUMENT__ input column which appears on mapping tab (Target columns). When you perform Insert you have two options (Insert (i.e. Append) and Reload (Truncate + Insert). When you select Operation=Reload in that case Collection is first Truncated and then new records are loaded.</p>
<p>In JSON document load mode if you don&#8217;t supply _id column part of your input JSON then new _id is automatically generated by MongoDB for newly inserted document.</p>
<div id="attachment_392" style="width: 589px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-load-json-documents-into-mongodb-collection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-392" class="size-full wp-image-392" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-load-json-documents-into-mongodb-collection.png" alt="Loading JSON Documents into MongoDB Collection (Map Raw Document Column)" width="579" height="669" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-load-json-documents-into-mongodb-collection.png 579w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-load-json-documents-into-mongodb-collection-260x300.png 260w" sizes="(max-width: 579px) 100vw, 579px" /></a><p id="caption-attachment-392" class="wp-caption-text">Loading JSON Documents into MongoDB Collection (Map Raw Document Column)</p></div>
<h3>Loading JSON files into MongoDB</h3>
<p>Another scenario could be loading JSON files into MongoDB. You can load JSON Files into MongoDB two ways.</p>
<ul>
<li>Use Flat File Source with just one column with DT_NTEXT datatype (use this method when you each JSON documents in one line and they are separated by new line as below screenshot)</li>
<li>Use <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> with Output as Document option checked. You can map __DOCUMENT__ source column to Target MongoDB collection as below. Advantage of this method is you extract JSON from array too and specify many other advanced options.
<div id="attachment_393" style="width: 733px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-extract-raw-json-documents-from-json-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-393" class="size-full wp-image-393" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-extract-raw-json-documents-from-json-file.png" alt="SSIS Extract JSON Documents or Sub Documents from JSON file or JSON Array" width="723" height="605" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-extract-raw-json-documents-from-json-file.png 723w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-extract-raw-json-documents-from-json-file-300x251.png 300w" sizes="(max-width: 723px) 100vw, 723px" /></a><p id="caption-attachment-393" class="wp-caption-text">SSIS Extract JSON Documents or Sub Documents from JSON file or JSON Array</p></div></li>
</ul>
<h2>Specifying LoadOptions</h2>
<p><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-destination/">MongoDB Destination Connector</a> supports following <strong>LoadOptions</strong> property (see Component Properties Tab on UI) which controls how target data gets modified. <strong>LoadOptions</strong> property is ignored for <strong>Reload</strong> and <strong>Insert</strong> operations.</p>
<ul>
<li><strong>op</strong> : this option specify update operators (Valid for <strong>Update, Replace</strong> and <strong>Upsert</strong> operation (i.e. <strong>UpdateOrInsert</strong>) ).  See <a href="https://docs.mongodb.org/manual/reference/operator/update/" target="_blank" rel="noopener">this link</a> for more information on various Update operators available in MongoDB. Most common operators listed below. Refer official MongoDB <a href="https://docs.mongodb.org/manual/reference/operator/update/" target="_blank" rel="noopener">help</a> for more information.
<ul>
<li><strong>op=none</strong> : Replace entire document</li>
<li><strong>op=$set</strong>  : Update only those fields specified in mapping. If Specified mapping field not available in target then its added to target document.</li>
<li><strong>op=$push</strong> : Adds new item to destination array. See following examples (How to insert single or multiple documents into MongoDB Array by supplying JSON into  __DOCUMENT__ column<br />
<pre class="crayon-plain-tag">/* Insert single item into array - Construct input JSON as below */
{YourArrayField : 111 }

/* Insert multiple items into array - Construct document as below */
{YourArrayField : { $each: [ 111, 222, 333 ] } }

/* Insert multiple documents into array */
{YourArrayField : { $each: [ {OrderID:1, Total:20.00}, {OrderID:2, Total:12.00} ] } }</pre>
</li>
</ul>
</li>
<li><strong>multi</strong> : This option controls if you want to Update or Delete multiple records for matching condition for each upstream input record.  For example if you joining by Country and City columns for update and target system finds 5 records then by default they all will be updated if <strong>multi=true</strong> is set in <strong>LoadOptions</strong> property. If you don&#8217;t want to update multiple records</li>
</ul>
<h2>MongoDB Update</h2>
<p>MongoDB Destination Connector supports Batch Update and Batch Upsert Operations. There are few things to remember how Update operation works with MongoDB Destination Connector.</p>
<ul>
<li>To perform Update operation you have to specify Join Criteria for record lookup on target (see <strong>ColumnsForLookup</strong> property).</li>
<li>Specify JOIN columns in <strong>ColumnsForLookup</strong> property. Use comma to specify multiple columns (e.g. CustomerID,OrderID). If you dont specify columns in this property then any columns mapped other than __DOCUMENT__ will be considered as JOIN column.</li>
<li>With MongoDB destination you can only specify simple Update condition by mapping JOIN input columns. Behind the scene it will construct search query for update. For example if you Map 3 input columns (__DOCUMENT__ , Country, State) and you specify <strong>LoadOptions :</strong> <strong>op=$set;multi=true</strong> then its similar as below SQL Statement.<br />
<pre class="crayon-plain-tag">UPDATE MyCollection
SET [properties specified in __DOCUMENT__]
WHERE Country=[input value] AND State=[input value]</pre>
</li>
<li>Join columns can be individually mapped or can be supplied as part of JSON document mapped to __DOCUMENT__ column.</li>
<li>If __DOCUMENT__ column is not mapped then you must specify at least one column name in ColumnsForLookup property to identify search column.</li>
<li>If __DOCUMENT__ column is mapped and column name is not specified in <strong>ColumnsForLookup</strong> property then you must map at least one more input column which can treated as JOIN column</li>
</ul>
<h2>Update specific fields  ($set operator)</h2>
<p>To update specific fields in target MongoDB collection you can map JOIN column(s) and then map fields you want to update or map __DOCUMENT__ if you suppling JSON document with fields you want to update.</p>
<p>See below screenshot where its updating Customers record with new coordinates  based on City and Country information.</p>
<div id="attachment_397" style="width: 758px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-update-json-document-specified-fields-set-operator.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-397" class="size-full wp-image-397" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-update-json-document-specified-fields-set-operator.png" alt="SSIS MongoDB Update Bulk - $set update operator - Update specific fields - Update single or multiple documents" width="748" height="527" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-update-json-document-specified-fields-set-operator.png 748w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-update-json-document-specified-fields-set-operator-300x211.png 300w" sizes="(max-width: 748px) 100vw, 748px" /></a><p id="caption-attachment-397" class="wp-caption-text">SSIS MongoDB Update Bulk &#8211; $set update operator &#8211; Update specific fields &#8211; Update single or multiple documents</p></div>
<h3>Update single or multiple target records for single input row</h3>
<p>If you want to update all matching records in target then set <strong>LoadOptions</strong> property to <strong>op=$set,multi=true</strong><br />
If you want to update only one record per matching criteria in target then set <strong>LoadOptions</strong> property to <strong>op=$set,multi=false</strong></p>
<h3>Update entire document (i.e. Overwrite/Replace documents)</h3>
<p>If you like to replace entire target document then you can do two ways. Few things you have to change for MongoDB Destination.</p>
<p><strong>Approach#1 </strong></p>
<ol>
<li>Select <strong>Operation</strong>=Replace (Rather than Update or Upsert)</li>
<li>Specify Join column in <strong>ColumnsForLookup</strong></li>
<li>On the mapping tab Map __DOCUMENT__ (Assuming you have Raw JSON coming from Upstream)</li>
</ol>
<p><strong>Approach#2</strong></p>
<p>Another approach is use $set operator in LoadOptions property then it will only update specified fields in mappings. But if you want to overwrite entire document (Replace document) then set <strong>LoadOptions</strong> property to <strong>op=none,multi=true</strong> or <strong>op=none,multi=false</strong> (If you want to update one record for matching condition)</p>
<h3>Insert single item into MongoDB Array using $push operator</h3>
<p>If you want to insert new items into array then set <strong>LoadOptions</strong> property to <strong>op=$push,multi=true</strong> or <strong>op=$push,multi=false</strong> (If you want to update one record for matching condition). You have to map __DOCUMENT__ column on target mappings tab to supply item(s) or document(s) you want to insert into target array.</p><pre class="crayon-plain-tag">/* Insert single number or string into MongoDB array - Construct input JSON as below */
{YourArrayField : 111 }

/* Insert single document into MongoDB array - Construct input JSON as below */
{YourArrayField : {OrderID:1, Total:20.00} }</pre><p>
<h3>Insert multiple items into MongoDB Array using $push operator along with $each</h3>
<p>Inserting multiple items into array requires use of <strong>$each</strong> modifier as below. Use above instructions except input document (e.g. data passed to __DOCUMENT__ column) will look like below (see how $each used).</p><pre class="crayon-plain-tag">/* Insert multiple items into MongoDB array - Construct document as below */
{YourArrayField : { $each: [ 111, 222, 333 ] } }

/* Insert multiple documents into MongoDB array */
{YourArrayField : { $each: [ {OrderID:1, Total:20.00}, {OrderID:2, Total:12.00} ] } }</pre><p>
<h3>Other MongoDB Update Operators</h3>
<p>So far we have seen <strong>$set</strong> and <strong>$push</strong> update operators. To learn more about other operators see <a href="https://docs.mongodb.org/manual/reference/operator/update/" target="_blank" rel="noopener">this link</a></p>
<h2>MongoDB Update Array Items ($pull, $push, $addToSet)</h2>
<p>If you wish to update items found inside nested array of document then <a href="//zappysys.com/blog/update-mongodb-array-items-using-ssis/" target="_blank" rel="noopener">Check this full length article</a></p>
<h2>MongoDB Upsert &#8211; Bulk Update or Insert JSON documents</h2>
<p>If you wish to perform Bulk Upsert using MongoDB Destination connector then select Upsert Action from dropdown (Action=UpdateOrInsert). In Upset if document is not found for matching criteria then new document is inserted in MongoDB Collection. If document is found then Update operation occurs. To set specific fields use <strong>op=$set</strong> in LoadOptions   and if you wish to overwrite entire document then use <strong>$op=none</strong> in <strong>LoadOptions </strong></p>
<div id="attachment_400" style="width: 488px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-upsert-json-document-update-or-insert-bulk.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-400" class="size-full wp-image-400" src="//zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-upsert-json-document-update-or-insert-bulk.png" alt="SSIS MongoDB Upsert - Bulk Update or Insert JSON documents" width="478" height="605" srcset="https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-upsert-json-document-update-or-insert-bulk.png 478w, https://zappysys.com/blog/wp-content/uploads/2016/02/ssis-mongodb-upsert-json-document-update-or-insert-bulk-237x300.png 237w" sizes="(max-width: 478px) 100vw, 478px" /></a><p id="caption-attachment-400" class="wp-caption-text">SSIS MongoDB Upsert &#8211; Bulk Update or Insert JSON documents</p></div>
<h2>MongoDB Delete &#8211; Bulk delete MongoDB JSON documents</h2>
<p>To delete documents from collection you can set operation=Delete on Component properties page. For delete you can simply map _id column on target or just supply columns based on you want to search records you want to delete.</p>
<p>To delete maximum one record for each input row set <strong>LoadOptions</strong> property to <strong>op=none,multi=false</strong> or set <strong>op=none,multi=false</strong> if you want to delete more than one record for matching condition.</p>
<h2>MongoDB Collection Reload &#8211; Remove All (Truncate collection)</h2>
<p>To reload collection set operation to Reload on Component properties page. <strong>Reload</strong> operation first clears target collection and perform <strong>bulk Insert</strong> operation</p>
<h2>Generate JSON for MongoDB data load</h2>
<p>Now lets talk about different ways to produce simple or complex JSON using ZappySys components.  There are 3 ways you can produce JSON which can be loaded into MongoDB Collection. Following section will describe each approach and you can select which one best suited for you.</p>
<h3>Generate JSON &#8211; Using Export JSON Task</h3>
<p>Export JSON Task can export JSON to File or variable which you can consume via <a href="//zappysys.com/products/ssis-powerpack/ssis-json-file-source/">JSON Source Connector</a> (Check Output as Document option) and supply to MongoDB Destination Connector (map to __DOCUMEN__).</p>
<p>Check this link for more info :  <a href="//zappysys.com/blog/export-json-from-sql-server-using-ssis/" target="_blank" rel="noopener">Export Json from sql server using ssis</a></p>
<h3>Generate JSON &#8211; Using JSON Generator Transform</h3>
<p>JSON generator transform is useful when you want to Produce JSON inside pipeline from single or multiple input.</p>
<p>Check this link for more info :  <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">JSON generator Transform (Watch Video on this page)</a></p>
<div style="width: 600px" class="wp-caption alignnone"><img decoding="async" title="JSON Generator Transform - Generate JSON and Load into MongoDB" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-generator-transform/ssis-json-generator-load-documents-mongodb.png" alt="JSON Generator Transform - Test JSON Path Settings" width="590" /><p class="wp-caption-text">JSON Generator Transform &#8211; Generate JSON documents and load into MongoDB</p></div>
<h3>Generate JSON &#8211; Using Dummy Data Source (Fake JSON for Testing)</h3>
<p>If you need to produce JSON for testing purpose then use <a href="//zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">Dummy Data Source</a> (Select JsonDocuments Template from dropdown and click ok)</p>
<h2>Query/Read data from MongoDB</h2>
<p>Visit following links to learn more about reading data from MongoDB.</p>
<p><a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-source/">SSIS MongoDB Source Homepage</a><br />
<a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/mongodb-source.htm#A_QueryLanguage">MongoDB SQL Query Reference</a><br />
<a href="//zappysys.com/blog/read-mongodb-data-from-array-extract-nested-sub-documents/">MongoDB data extract &#8211; from nested sub documents and array</a></p>
<h2>Execute MongoDB Shell commands in SSIS (e.g. Create/Drop collection)</h2>
<p>MongoDB SOurce and Destination Connectors are great for read/write data. But what if you want to issue ad-hoc MongoDB shell command such as create collection/drop collection ? No worry.. <a href="//zappysys.com/products/ssis-powerpack/">SSIS PowerPack v2.0</a> released new Task called <a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-executesql-task/">SSIS MongoDB ExecuteSQL Task</a> This task comes with many examples listed on the UI itself (Look for Examples dropdown menu on UI). You can use <a href="//zappysys.com/products/ssis-powerpack/ssis-mongodb-executesql-task/">SSIS MongoDB ExecuteSQL Task</a> to perform many operations such as</p>
<ul>
<li>Create/Drop MongoDB collections</li>
<li>Get collection list as ADO.net recordset so you can loop through using ForEachLoop task</li>
<li>Call serverside JavaScript</li>
<li>Fetch data as ADO.net recordset and store in SSIS variable so you can loop using ForEachLoop task</li>
<li>Drop database</li>
<li>Call many shell commands</li>
</ul>
<h2>Download MongoDB Example Files used in this tutorial</h2>
<p>To test this package you first need to <a href="//zappysys.com/products/ssis-powerpack/">download SSIS PowerPack</a><br />
Once SSIS PowerPack installed you can download following SSIS sample project file(s).</p>
<p><a title="MongoDB Examples - Loading data into MongoDB - SSIS 2008" href="//zappysys.com/downloads/files/ssis/MongoDB_Load_Demo_2008.zip">Download sample files &#8211; SSIS 2008</a><br />
<a title="MongoDB Examples - Loading data into MongoDB - SSIS 2012" href="//zappysys.com/downloads/files/ssis/MongoDB_Load_Demo_2012.zip">Download sample files &#8211; SSIS 2012</a><br />
<a title="MongoDB Examples - Loading data into MongoDB - SSIS 2014" href="//zappysys.com/downloads/files/ssis/MongoDB_Load_Demo_2014.zip">Download sample files &#8211; SSIS 2014</a><br />
<a title="MongoDB Examples - Loading data into MongoDB - SSIS 2016" href="//zappysys.com/downloads/files/ssis/MongoDB_Load_Demo_2016.zip">Download sample files &#8211; SSIS 2016</a></p>
<h2>Conclusion</h2>
<p>MongoDB makes it super easy to store <strong>JSON documents</strong> and gives you whole new way of manipulating documents with ease of use. ZappySys SSIS Connectors and Tasks for MongoDB makes it possible to implement various data integration scenarios with MongoDB. <a href="//zappysys.com/products/ssis-powerpack/">Click here to Download SSIS PowerPack</a> and try it your self.</p>
<p><b>Keywords:</b><br />
<em>Loading data into MongoDB</em> | <em>mongodb upsert array</em> | <em>mongodb upsert example</em> | <em>mongodb insert or update</em> | <em>mongo insert or update</em> | <em>mongo upsert</em> | <em>mongo insert JSON</em> | <em>mongo upsert JSON | update data into MongoDB</em></p>
<p>The post <a href="https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/">SSIS &#8211; Loading data into MongoDB (Upsert, Delete, Update)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
