<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ssis salesforce source Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/ssis-salesforce-source/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/ssis-salesforce-source/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Tue, 22 Aug 2023 17:25:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.4</generator>

<image>
	<url>https://zappysys.com/blog/wp-content/uploads/2023/01/cropped-zappysys-symbol-large-32x32.png</url>
	<title>ssis salesforce source Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/ssis-salesforce-source/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to read Salesforce data in SSIS &#8211; Export to SQL Server</title>
		<link>https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 04 Sep 2017 14:09:18 +0000</pubDate>
				<category><![CDATA[REST API Integration]]></category>
		<category><![CDATA[SSIS Components]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[SSIS Salesforce Source]]></category>
		<category><![CDATA[salesforce]]></category>
		<category><![CDATA[salesforce api]]></category>
		<category><![CDATA[salesforce soap api]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis salesforce connection]]></category>
		<category><![CDATA[ssis salesforce source]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=1760</guid>

					<description><![CDATA[<p>Introduction In this tutorial, you will learn how to read data from Salesforce to SQL Server using SSIS Salesforce Source. In this article, we will extract Salesforce contacts and import them into a SQL Server database table. Also, you will learn how to do basic filtering on the contacts and get only a subset of them. Finally, [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">How to read Salesforce data in SSIS &#8211; Export to SQL Server</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="//zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png"><img decoding="async" class="size-full wp-image-1764 alignleft" src="//zappysys.com/blog/wp-content/uploads/2017/09/salesforce-logo-180x180.png" alt="" width="180" height="180" 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: 180px) 100vw, 180px" /></a></p>
<p>In this tutorial, you will learn how to read data from Salesforce to SQL Server using <a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/"><acronym title="SQL Server Integration Services">SSIS</acronym> Salesforce Source</a>.</p>
<p>In this article, we will extract Salesforce contacts and import them into a SQL Server database table. Also, you will learn how to do basic filtering on the contacts and get only a subset of them. Finally, we will briefly touch some additional advanced options of Salesforce Source component. Namely, you will learn how to convert datetime columns to different formats.</p>
<p>To achieve our goal we will use Salesforce Source SSIS component. Under the hood, it uses <a href="https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_quickstart_intro.htm" target="_blank" rel="noopener">Salesforce API</a> to make calls to, but you don&#8217;t have to be concerned about that:</p>
<div class="su-table su-table-alternate">
<table width="276">
<tbody>
<tr class="su-even" style="line-height: 0px">
<td width="50px"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source.png"><img decoding="async" class="alignnone wp-image-1775" src="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source.png" alt="" width="50" height="50" /></a></td>
<td style="vertical-align: middle"><a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/" target="_blank" rel="noopener">Salesforce Source Connector</a></td>
</tr>
</tbody>
</table>
</div>
<h2><span id="Prerequisites">Prerequisites</span></h2>
<ol>
<li>SSIS designer installed. Sometimes it is referred as BIDS or SSDT (<a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" target="_blank" rel="noopener">download it from Microsoft site</a>).</li>
<li>Basic knowledge of SSIS package development using <em>Microsoft SQL Server Integration Services</em>.</li>
<li>A Salesforce account.</li>
<li>Any SQL Server database.</li>
<li><a href="//zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener"><em>ZappySys SSIS PowerPack</em> installed</a>.</li>
</ol>
<h2>Step-by-Step <span id="Step-by-Step_Get_data_from_HubSpot_API_into_SQL_Server_database"><span id="Step-By-StepGet_data_from_HubSpot_REST_API"><span id="Step-By-Step_8211_Call_Amazon_MWS_API_using_SSIS">– Read Salesforce data in SSIS</span></span></span></h2>
<h3>Get Salesforce Security Token</h3>
<p>The first thing you will need to do to sync Salesforce with SQL Server is to get the Salesforce Security Token. You will need it for <em>Salesforce Source Connector</em> to connect to your Salesforce account:</p>
<ol>
<li>Log in to your account using <a href="https://login.salesforce.com" target="_blank" rel="noopener">https://login.salesforce.com</a>.</li>
<li>On the top right corner, press on your profile picture and click <pre class="crayon-plain-tag">Settings</pre>:
<div id="attachment_10101" style="width: 407px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10101" class="wp-image-10101 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg" alt="Getting Salesforce Security Token for use in Salesforce Connection Manager" width="397" height="270" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager.jpg 397w, https://zappysys.com/blog/wp-content/uploads/2017/09/get-salesforce-security-token-for-ssis-salesforce-connection-manager-300x204.jpg 300w" sizes="(max-width: 397px) 100vw, 397px" /></a><p id="caption-attachment-10101" class="wp-caption-text">Getting Salesforce Security Token for use in Salesforce Connection Manager</p></div></li>
<li>On the top left corner, under <em>My Personal Information </em>select <pre class="crayon-plain-tag">Reset My Security Token</pre> menu item:
<div id="attachment_1785" style="width: 259px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1785" class="wp-image-1785 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg" alt="Resetting Salesforce Security Token" width="249" height="426" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager.jpg 249w, https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-175x300.jpg 175w" sizes="(max-width: 249px) 100vw, 249px" /></a><p id="caption-attachment-1785" class="wp-caption-text">Resetting Salesforce Security Token</p></div></li>
<li>In the main window area click <pre class="crayon-plain-tag">Reset Security Token</pre> button:
<div id="attachment_1786" style="width: 772px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1786" class="wp-image-1786 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg" alt="Resetting Salesforce Security Token" width="762" height="305" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2.jpg 762w, https://zappysys.com/blog/wp-content/uploads/2017/09/reset-salesforce-security-token-for-use-in-ssis-salesforce-connection-manager-2-300x120.jpg 300w" sizes="(max-width: 762px) 100vw, 762px" /></a><p id="caption-attachment-1786" class="wp-caption-text">Resetting Salesforce Security Token</p></div></li>
<li>Check your email for a new Security Token:
<div class="wp-caption" style="margin-top: 0;">
<div id="attachment_1789" style="width: 773px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1789" class="wp-image-1789 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg" alt="Getting new Salesforce Security Token" width="763" height="147" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token.jpg 763w, https://zappysys.com/blog/wp-content/uploads/2017/09/check-your-mail-for-new-salesforce-security-token-300x58.jpg 300w" sizes="(max-width: 763px) 100vw, 763px" /></a><p id="caption-attachment-1789" class="wp-caption-text">Getting new Salesforce Security Token</p></div>
</div>
</li>
</ol>
<h3>Import Salesforce data into SQL Server</h3>
<p>Once you have Security Token, you can start getting contacts from Salesforce and load them into SQL Server database table:</p>
<ol>
<li>Open SSIS designer.</li>
<li>Create a new SSIS package and drag a <em>Data Flow Task</em> into the <em>Control Flow</em> from the SSIS Toolbox:
<div id="attachment_1795" style="width: 222px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-control-flow.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1795" class="wp-image-1795 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-control-flow.jpg" alt="Starting to create a SSIS package" width="212" height="122" /></a><p id="caption-attachment-1795" class="wp-caption-text">Starting to create a SSIS package</p></div></li>
<li>Open <em>Data Flow Task</em> and then add <i>Salesforce Source </i>from SSIS toolbox:
<div id="attachment_1818" style="width: 255px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1818" class="wp-image-1818 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-salesforce-source-ssis-component.jpg" alt="Using Salesforce Source to start exporting data" width="245" height="192" /></a><p id="caption-attachment-1818" class="wp-caption-text">Using <em>Salesforce Source</em> to start exporting data</p></div></li>
<li>Start modifying <em>Salesforce Source</em> component and then press <pre class="crayon-plain-tag">New</pre> button to create a new<em> Salesforce Connection</em>:
<div id="attachment_1800" style="width: 765px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1800" class="wp-image-1800 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg" alt="Creating new Salesforce Connection for Salesforce Source" width="755" height="281" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server.jpg 755w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-ssis-salesforce-connection-manager-to-export-data-from-salesforce-to-sql-server-300x112.jpg 300w" sizes="(max-width: 755px) 100vw, 755px" /></a><p id="caption-attachment-1800" class="wp-caption-text">Creating new<em> Salesforce Connection</em> for <em>Salesforce Source</em></p></div></li>
<li>In a new window enter your Salesforce credentials and<em> Security Token</em> you have in your email. In advanced options group, you can select the environment in which the connection will work. Most likely, you want to use <pre class="crayon-plain-tag">Production</pre>, so just select it in <em>Service Type</em> option.<a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg"><br />
</a></p>
<div id="attachment_1804" style="width: 682px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1804" class="wp-image-1804 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg" alt="Salesforce Connection Manager configuration" width="672" height="531" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager.jpg 672w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-salesforce-connection-manager-300x237.jpg 300w" sizes="(max-width: 672px) 100vw, 672px" /></a><p id="caption-attachment-1804" class="wp-caption-text"><em>Salesforce Connection Manager</em> configuration</p></div></li>
<li>Once you finished creating <em>Salesforce Connection</em>, select <pre class="crayon-plain-tag">Contact</pre> as table you want to get data from. Be sure to have <pre class="crayon-plain-tag">Table</pre> option selected in <em>Access Mode</em>. Also, below you can specify the size of the batch and the maximum number of rows (contacts in our case) to retrieve:
<div id="attachment_1807" style="width: 755px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1807" class="wp-image-1807 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg" alt="Choosing Salesforce contacts table to export them to SQL Server" width="745" height="603" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce.jpg 745w, https://zappysys.com/blog/wp-content/uploads/2017/09/ssis-salesforce-source-to-load-data-from-salesforce-300x243.jpg 300w" sizes="(max-width: 745px) 100vw, 745px" /></a><p id="caption-attachment-1807" class="wp-caption-text">Choosing Salesforce contacts table to export them to SQL Server</p></div></li>
<li>Close <em>Salesforce Source</em> configuration and in the <em>Data Flow Task </em>drag <em>OLE DB Destination</em> and connect it to <em>Salesforce Source</em>.
<div id="attachment_1796" style="width: 222px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-data-flow.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1796" class="wp-image-1796 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-data-flow.jpg" alt="Connecting Salesforce Source to OLE DB Destination" width="212" height="200" /></a><p id="caption-attachment-1796" class="wp-caption-text">Connecting Salesforce Source to OLE DB Destination</p></div></li>
<li>Open <em>OLE DB Destination</em> configuration, select or create a new connection; in this example, we are using <em>LocalDB</em> and <em>tempdb</em> database. Then select an existing table or create a new one by pressing <pre class="crayon-plain-tag">New</pre> button. Finally, select <pre class="crayon-plain-tag">Mappings</pre> option to map the columns and close the window:
<div id="attachment_1808" style="width: 834px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1808" class="wp-image-1808 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg" alt="Choosing connection and table in OLE DB Destination" width="824" height="718" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server.jpg 824w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server-300x261.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/09/use-oledb-destination-to-import-salesforce-data-into-sql-server-768x669.jpg 768w" sizes="(max-width: 824px) 100vw, 824px" /></a><p id="caption-attachment-1808" class="wp-caption-text">Choosing connection and table in <em>OLE DB Destination</em></p></div></li>
<li>Run the package. In this example we extract 16 contacts and load them into a SQL table:
<div id="attachment_1809" style="width: 250px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1809" class="wp-image-1809 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-1.jpg" alt="Package execution result" width="240" height="204" /></a><p id="caption-attachment-1809" class="wp-caption-text">Package execution result</p></div></li>
<li>Let&#8217;s open Salesforce page and take a look at the contacts source. We have 16 contacts here as well:
<div id="attachment_10103" style="width: 702px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10103" class="wp-image-10103 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg" alt="Salesforce source contacts" width="692" height="589" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1.jpg 692w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-2-1-1-300x255.jpg 300w" sizes="(max-width: 692px) 100vw, 692px" /></a><p id="caption-attachment-10103" class="wp-caption-text">Salesforce source contacts</p></div></li>
<li>After querying destination table using <a href="https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms" target="_blank" rel="noopener"><acronym title="SQL Server Management Studio">SSMS</acronym></a>, we see that everything worked like it had to:
<div id="attachment_10105" style="width: 607px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10105" class="wp-image-10105 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg" alt="Results: contacts exported from Salesforce into SQL Server" width="597" height="353" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1.jpg 597w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-results-3-1-300x177.jpg 300w" sizes="(max-width: 597px) 100vw, 597px" /></a><p id="caption-attachment-10105" class="wp-caption-text">Results: contacts exported from Salesforce into SQL Server</p></div></li>
<li>You are done!</li>
</ol>
<h3>What if things are more complicated? Queries and Data Filtering</h3>
<p>Instead of accessing data using <pre class="crayon-plain-tag">Table</pre> mode, you can do it in <pre class="crayon-plain-tag">Query</pre> mode. This will let you write T-SQL-like queries where you will be able to filter the data, group it, select the subset of it, etc. Let&#8217;s take the same Salesforce table <pre class="crayon-plain-tag">Contact</pre> and do some basic filtering on it:</p>
<ul>
<li>First of all, let&#8217;s create several variables, which we will use to get specific Salesforce contacts:
<div id="attachment_1829" style="width: 504px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1829" class="wp-image-1829 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg" alt="Variables used to construct a dynamic query" width="494" height="129" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query.jpg 494w, https://zappysys.com/blog/wp-content/uploads/2017/09/export-data-from-salesforce-to-sql-server-using-ssis-variables-for-query-300x78.jpg 300w" sizes="(max-width: 494px) 100vw, 494px" /></a><p id="caption-attachment-1829" class="wp-caption-text">Variables used to construct a dynamic query</p></div>
<p>We will use <pre class="crayon-plain-tag">Domain</pre> to filter contacts that have email with <pre class="crayon-plain-tag">uog.com</pre> domain.<br />
<pre class="crayon-plain-tag">From</pre>  variable will help us filter the contacts based on the date, when they were created.</li>
<li>Set <pre class="crayon-plain-tag">Query</pre> in <em>Access Mode</em> option and input query below:
<div id="attachment_1827" style="width: 836px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1827" class="wp-image-1827 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg" alt="Inputting a SOQL query into a Salesforce Source SSIS component" width="826" height="602" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query.jpg 826w, https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query-300x219.jpg 300w, https://zappysys.com/blog/wp-content/uploads/2017/09/sync-salesforce-with-sql-server-using-ssis-salesforce-source-query-768x560.jpg 768w" sizes="(max-width: 826px) 100vw, 826px" /></a><p id="caption-attachment-1827" class="wp-caption-text">Inputting a SOQL query into a <em>Salesforce Source </em>SSIS component</p></div>
<p>Even this query looks much like T-SQL query, but in reality it is a SOQL query, an acronym for <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql.htm" target="_blank" rel="noopener">Salesforce Object Query Language</a>.<br />
<div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE</strong>:</p>
<ul>
<li>We are inputing <strong>{{User::From}}</strong> straight into a query and do not enclose it with single quotes, unlike in T-SQL.</li>
<li>You can explore more SOQL query examples by pressing <strong>« View Examples »</strong> button.</li>
</ul>
</div></div></li>
<li>Click <pre class="crayon-plain-tag">Preview</pre> and you will see that only contacts that have domain &#8220;uog.com&#8221; were retrieved. Filtering on <em>CreatedDate</em> column was applied as well:
<div id="attachment_10107" style="width: 616px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-10107" class="wp-image-10107 size-full" src="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg" alt="Data preview for a subset of contacts" width="606" height="338" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1.jpg 606w, https://zappysys.com/blog/wp-content/uploads/2017/09/get-data-from-salesforce-and-load-it-into-sql-server-using-ssis-query-results-1-300x167.jpg 300w" sizes="(max-width: 606px) 100vw, 606px" /></a><p id="caption-attachment-10107" class="wp-caption-text">Data preview for a subset of contacts</p></div></li>
</ul>
<p>SOQL has some limitations, so check <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_limits.htm" target="_blank" rel="noopener">SOQL Limits on Objects</a> page as well if you are writing a more complex query.</p>
<h3>Advanced Options: Convert Datetime Columns</h3>
<p>By default, datetime columns are outputted in <pre class="crayon-plain-tag">yyyy-MM-ddThh:mm:ss.fffZ</pre> format. Yet you can change that and output column in other formats:</p>
<ul>
<li><em>Default format</em> (e.g. <pre class="crayon-plain-tag">2017-07-07T14:41:35.000Z</pre>)</li>
<li><em>Local time</em> (depends on your locale settings e.g. <pre class="crayon-plain-tag">5/16/2017 14:41 PM</pre>)</li>
<li><em>UTC time</em> (depends on your locale settings, yet your time zone is taken into account, e.g. <pre class="crayon-plain-tag">5/16/2017 11:41 PM</pre>)</li>
</ul>
<p>Let&#8217;s take <em>CreatedDate</em> column and output it as UTC time:</p>
<ol>
<li>Here is the preview of data, before conversion:
<div id="attachment_1821" style="width: 604px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1821" class="wp-image-1821 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg" alt="Data preview before formatting datetime column" width="594" height="318" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview.jpg 594w, https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-300x161.jpg 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-1821" class="wp-caption-text">Data preview before formatting datetime column</p></div></li>
<li>Now let&#8217;s output the <em>CreatedDate</em> column as UTC time:
<div id="attachment_1822" style="width: 761px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1822" class="wp-image-1822 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg" alt="Salesforce Source Date/Time Handling" width="751" height="579" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc.jpg 751w, https://zappysys.com/blog/wp-content/uploads/2017/09/extract-data-from-salesforce-into-sql-server-using-ssis-datetime-in-utc-300x231.jpg 300w" sizes="(max-width: 751px) 100vw, 751px" /></a><p id="caption-attachment-1822" class="wp-caption-text">Salesforce Source Date/Time Handling</p></div></li>
<li>Let&#8217;s make another data preview. As you see <em>CreatedDate</em> time shifted to match UTC time:
<div id="attachment_1823" style="width: 604px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1823" class="wp-image-1823 size-full" src="//zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg" alt="Data preview after formatting datetime column" width="594" height="357" srcset="https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2.jpg 594w, https://zappysys.com/blog/wp-content/uploads/2017/09/load-data-from-salesforce-into-sql-server-using-ssis-datetime-columns-preview-2-300x180.jpg 300w" sizes="(max-width: 594px) 100vw, 594px" /></a><p id="caption-attachment-1823" class="wp-caption-text">Data preview after formatting datetime column</p></div></li>
</ol>
<p>Similarly, you can format input datetime columns, when you use <pre class="crayon-plain-tag">Query</pre> <em>Access Mode</em> instead of <pre class="crayon-plain-tag">Table</pre>.</p>
<h2>Common Errors</h2>
<div class="content_block" id="custom_post_widget-1887"><h3>Truncation related error</h3>
<p style="text-align: justify;">The most common error you may face when you run an SSIS package is truncation error. During the design time only 300 rows are scanned from a source (a file or a REST API call response) to detect datatypes but at runtime, it is likely you will retrieve far more records. So it is possible that you will get longer strings than initially expected. For detailed instructions on how to fix common metadata related errors read an article "<a href="//zappysys.com/blog/handling-ssis-component-metadata-issues/" target="_blank" rel="noopener">How to handle SSIS errors (truncation, metadata issues)</a>".</p>

<h3>Authentication related error</h3>
Another frequent error you may get is an authentication error, which happens when you deploy/copy a package to another machine and run it there. Check <a href="#Deployment_to_Production">the paragraph below</a> to see why it happens and how to solve this problem.</div>
<h2>Deployment to Production</h2>
<div class="content_block" id="custom_post_widget-1932"><p style="text-align: justify;">In SSIS package <a href="https://docs.microsoft.com/en-us/sql/integration-services/security/access-control-for-sensitive-data-in-packages" target="_blank" rel="noopener">sensitive data such as tokens and passwords are by default encrypted by SSIS</a> with your Windows account which you use to create a package. So SSIS will fail to decrypt tokens/passwords when you run it from another machine using another Windows account. To circumvent this when you are creating an SSIS package which uses authentication components (e.g. an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-oauth-connection-manager.htm" target="_blank" rel="noopener">OAuth Connection Manager</a> or an <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-http-connection-manager.htm" target="_blank" rel="noopener">HTTP Connection Manager</a> with credentials, etc.), consider using parameters/variables to pass tokens/passwords. In this way, you won’t face authentication related errors when a package is deployed to a production server.</p>
<p style="text-align: justify;">Check our article on <a href="https://zappysys.com/blog/how-to-run-an-ssis-package-with-sensitive-data-on-sql-server/" target="_blank" rel="noopener">how to configure packages with sensitive data on your production or development server</a>.</p></div>
<h2>Download Sample Package</h2>
<p>Be sure to download a <a href="//zappysys.com/blog/wp-content/uploads/2017/09/Export-data-from-Salesforce-to-SQL-Server-using-SSIS.zip" rel="noopener">sample SQL Server 2008 SSIS package</a>, in case you want to try it right away (you can upgrade it to a higher version).</p>
<div><div class="su-note"  style="border-color:#e5dd9d;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><div class="su-note-inner su-u-clearfix su-u-trim" style="background-color:#fff7b7;border-color:#ffffff;color:#333333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;"><strong>NOTE</strong>: Once you open the package, you won’t be able to run it immediately, but don’t panic. Just configure <em>OLE DB Source</em> to point to your database and set your Salesforce account credentials in <em>Salesforce Connection Manager</em>.</div></div></div>
<h2>Conclusion</h2>
<p>In this article, you learned how to export data from Salesforce to SQL Server. We used <a href="//zappysys.com/products/ssis-powerpack/ssis-salesforce-source-connector/" target="_blank" rel="noopener">Salesforce Source</a> to extract contacts from Salesforce and import them into a SQL Server database table. We did not have to configure much, just a few clicks and you were done. Also you learned how to use <a href="https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_sosl_intro.htm" target="_blank" rel="noopener">SOQL</a> to write custom queries and filter out the data you don&#8217;t need. Finally, now you know how to convert datetime columns into Local and UTC time to match the format you expect in your database.</p>
<p><strong>Keywords</strong><br />
Salesforce SQL Server Integration | Data loading Salesforce | Salesforce API SQL Server | Get data from Salesforce and load into SQL Server | Read data from Salesforce and write it to SQL Server  | Extract data from Salesforce to SQL Server</p>
<p>The post <a href="https://zappysys.com/blog/export-data-from-salesforce-to-sql-server-using-ssis/">How to read Salesforce data in SSIS &#8211; Export to SQL Server</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
