<?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 export xml task Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/tag/ssis-export-xml-task/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/tag/ssis-export-xml-task/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Fri, 27 Sep 2019 14:30:07 +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 export xml task Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/tag/ssis-export-xml-task/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to generate XML with namespace / prefix in SSIS</title>
		<link>https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 18 Oct 2017 17:39:37 +0000</pubDate>
				<category><![CDATA[SSIS XML Export Task]]></category>
		<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis export xml task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis xml generator transform]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=2191</guid>

					<description><![CDATA[<p>Introduction In this post you will see how to generate XML which has namespace and prefix for elements. We will use SSIS XML Generator Transform for this purpose. Common pattern would be generate XML SOAP message using XML Generator Transform and send to Web service using SSIS Web API Destination. For full tutorial on how [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/">How to generate XML with namespace / prefix in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><img decoding="async" class="alignleft wp-image-2206" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform.png" alt="" width="90" height="90" />In this post you will see how to generate XML which has namespace and prefix for elements. We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML Generator Transform</a> for this purpose. Common pattern would be generate XML SOAP message using XML Generator Transform and send to Web service using <a href="https://zappysys.com/products/ssis-powerpack/ssis-web-api-destination-connector/" target="_blank" rel="noopener">SSIS Web API Destination</a>. For full tutorial on how to export XML using SSIS <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/" target="_blank" rel="noopener">check this link</a>.</p>
<p>&nbsp;</p>
<h2>Understanding XML Namespace and Prefix</h2>
<p>Just like how many programming languages offer concept called namespace to avoid similar name conflict for classes, XML also has <a href="https://en.wikipedia.org/wiki/XML_namespace" target="_blank" rel="noopener">namespace</a> concept.</p>
<p><strong>Sample XML with namespace and prefix</strong></p><pre class="crayon-plain-tag">&lt;?xml version="1.0"?&gt;
&lt;soapenv:Envelope xmlns:p1="http://someurl-1" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
	&lt;soapenv:Body&gt;
		&lt;p1:CustomerID&gt;CID1&lt;/p1:CustomerID&gt;
		&lt;p1:CompanyName&gt;some company name&lt;/p1:CompanyName&gt;
	&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre><p>
If you notice in above XML there are two important things. Under &lt;<strong>soapenv:Envelope&gt;</strong> element you have <strong>xmlns:p1</strong> and <strong>xmlns:soapenv</strong> attributes. Basically these are two namespace declarations and they both use different prefix (i.e. p1 and soapenv). Once you define namespace prefix you can use in the declaring element or any child element under that node.</p>
<p><strong>Syntax for XML Namespace declaration:</strong></p><pre class="crayon-plain-tag">xmlns:yourprefix=&quot;url or unique identifier&quot;</pre><p>
<h2>Example &#8211; Using SSIS XML Generator Transform</h2>
<p>Now lets look at how to generate XML using SSIS XML Generator Transform. This same technique can be used by SSIS Export XML Task.</p>
<ol>
<li>Download and Install SSIS PowerPack <a href="https://zappysys.com/products/ssis-powerpack/download/" target="_blank" rel="noopener">from here</a> (Skip this if you already did)</li>
<li>Open Visual Studio and create new SSIS Package</li>
<li>Drag Data Flow Task from Control Flow Toolbox
<div id="attachment_8028" style="width: 470px" class="wp-caption alignnone"><img fetchpriority="high" 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 <a href="https://zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">ZS Dummy Data Source</a> (You can use any source you like. e.g. OLEDB Source)</li>
<li>Change Template to Customer to create fake customer data. Click OK to save.</li>
<li>Now drag and drop <a href="https://zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">ZS XML Generator Transform</a></li>
<li>Connect Source to XML Generator</li>
<li>Double click XML Generator to configure.</li>
<li>Go to Options tab and change following setting
<ol>
<li>under Namespaces define two namespaces as below (Change p1 to desired prefix)<br />
p1=http://someurl, soapenv=http://schemas.xmlsoap.org/soap/envelope/</li>
<li>Change Root element name to Envelope</li>
<li>Change Root Element Prefix to soapenv
<div id="attachment_2192" style="width: 989px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2192" class="size-full wp-image-2192" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png" alt="Configure SSIS XML Generator Transform - Define namespace and prefix , root element" width="979" height="510" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings.png 979w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings-300x156.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-namespace-prefix-settings-768x400.png 768w" sizes="(max-width: 979px) 100vw, 979px" /></a><p id="caption-attachment-2192" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Define namespace and prefix , root element</p></div></li>
</ol>
</li>
<li>Now go to layout tab and select dataset and click Edit</li>
<li>Change default Row element name to Body and prefix to soapenv as below. Click OK to save
<div id="attachment_2193" style="width: 820px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2193" class="size-full wp-image-2193" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png" alt="Configure SSIS XML Generator Transform - Change Row element name and prefix " width="810" height="543" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix.png 810w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-300x201.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-768x515.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-edit-dataset-root-element-with-prefix-272x182.png 272w" sizes="(max-width: 810px) 100vw, 810px" /></a><p id="caption-attachment-2193" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Change Row element name and prefix</p></div></li>
<li>Now right click on Mappings folder and Click &#8220;Add Elements&#8221; or click in the toolbar icon.</li>
<li>On the Add Elements dialog
<ol>
<li>select Add multiple option.</li>
<li>Change Prefix to p1 (or whatever you entered before on Options tab)</li>
<li>Select columns you want to output in XML
<div id="attachment_2194" style="width: 832px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2194" class="size-full wp-image-2194" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png" alt="Configure SSIS XML Generator Transform - Add elements with prefix " width="822" height="676" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix.png 822w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix-300x247.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-export-xml-using-xml-generator-transform-add-element-attributes-with-prefix-768x632.png 768w" sizes="(max-width: 822px) 100vw, 822px" /></a><p id="caption-attachment-2194" class="wp-caption-text">Configure SSIS XML Generator Transform &#8211; Add elements with prefix</p></div></li>
</ol>
</li>
<li>Now you will see preview update for your XML layout as below
<div id="attachment_2195" style="width: 1109px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2195" class="size-full wp-image-2195" src="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png" alt="SSIS XML Generator Transform - Preview of complex XML using namespace and prefix" width="1099" height="668" srcset="https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix.png 1099w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-300x182.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-768x467.png 768w, https://zappysys.com/blog/wp-content/uploads/2017/10/ssis-xml-generator-transform-preview-with-namespace-prefix-1024x622.png 1024w" sizes="(max-width: 1099px) 100vw, 1099px" /></a><p id="caption-attachment-2195" class="wp-caption-text">SSIS XML Generator Transform &#8211; Preview of complex XML using namespace and prefix</p></div></li>
<li>Now attach your XML Generator Transform to some downstream component such as ZS Trash Destination and run the package</li>
</ol>
<p>&nbsp;</p>
<h2>Conclusion</h2>
<p>Using SSIS PowerPack you can generate complex XML in few clicks. <a href="https://zappysys.com/products/ssis-powerpack/">Download SSIS PowerPack</a> for FREE Trial and discover many more features.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/">How to generate XML with namespace / prefix in SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to export XML from SQL Server using SSIS</title>
		<link>https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Wed, 26 Apr 2017 14:14:11 +0000</pubDate>
				<category><![CDATA[SSIS XML Generator Transform]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis export xml task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<category><![CDATA[ssis xml generator transform]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[xml]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=1115</guid>

					<description><![CDATA[<p>Introduction In our previous blog post we saw how to import xml into SQL server using SSIS. In this post we will see how to generate xml in SSIS. If you wish to export JSON rather than XML then check this article To produce complex nested XML you can use following two task/components. Video Tutorial &#8211; Create XML [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/">How to export XML from SQL Server 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 <a href="https://zappysys.com/blog/ssis-import-xml-file-sql-server-parse-xml/" target="_blank" rel="noopener">how to import xml into SQL server using SSIS</a>. In this post we will see how to generate xml in SSIS. If you wish to <a href="//zappysys.com/blog/export-json-from-sql-server-using-ssis/" target="_blank" rel="noopener">export JSON rather than XML then check this article</a></p>
<p>To produce complex nested XML you can use following two task/components.</p>
<div class="su-table su-table-alternate">
<table>
<tbody>
<tr>
<td width="36"><img decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task.png" alt="Custom SSIS Tasks - Export XML File Task" width="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML File Task</a></td>
</tr>
<tr>
<td width="36"><img loading="lazy" decoding="async" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-transform.png" alt="SSIS XML Generator Transform" width="32" height="32" /></td>
<td><a href="//zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">XML Generator Transform</a></td>
</tr>
</tbody>
</table>
</div>
<h2>Video Tutorial &#8211; Create XML in SSIS</h2>
<p>Below video tutorial will show you how to produce complex XML from single or multiple input datasets using SSIS.</p>
<p>Techniques illustrated in below video is almost identical for SSIS Export XML File Task and SSIS XML Generator Transform&#8230; but for demonstration we will use XML Generator Transform. If you wish to use Export XML File task then dataset will be Table or Query rather than Data flow Input.<br />
<a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FPLfIxLdaf-p3kZkPonLYlPuKf_78XhAY7_%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<p>Here is another video </p>
<a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/"><img decoding="async" src="https://zappysys.com/blog/wp-content/plugins/wp-youtube-lyte/lyteCache.php?origThumbUrl=%2F%2Fi.ytimg.com%2Fvi%2FDlWwhXwJRhU%2Fhqdefault.jpg" alt="YouTube Video"></a><br /><br /></p>
<h2>SSIS XML Generator Transform</h2>
<p>Use <a href="//zappysys.com/products/ssis-powerpack/ssis-xml-generator-transform/" target="_blank" rel="noopener">SSIS XML generator Transform</a> when you want to produce XML inside data flow and feed to downstream system or save to XML file (You can use Flat File destination). If you have need for more flexible approach or save XML into SSIS Variable so you can <a href="https://zappysys.com/blog/http-post-in-ssis-send-data-to-web-api-url-json-xml/" target="_blank" rel="noopener">POST XML data to Web API or SOAP webservice call</a> then use Export XML File Task.</p>
<h3>SSIS XML Generator Transform &#8211; Generate XML and save to file</h3>
<div id="attachment_1126" style="width: 536px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-1126" class="size-full wp-image-1126" src="//zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png" alt="SSIS XML generator transform - Create XML Output inside Data flow" width="526" height="410" srcset="https://zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file.png 526w, https://zappysys.com/blog/wp-content/uploads/2017/04/ssis-create-xml-output-export-file-300x234.png 300w" sizes="(max-width: 526px) 100vw, 526px" /></a><p id="caption-attachment-1126" class="wp-caption-text">SSIS XML generator transform &#8211; Create XML Output inside Data flow</p></div>
<h2>SSIS Export XML File Task</h2>
<p>When you have need to generate XML from multiple SQL query / tables and save into XML File or SSIS Variable then you can consider Export XML File Task. Few options available in Export File Task which are not found in XML Generator Transform such as Compression, Splitting options, Simple export without Layout.</p>
<h3>SSIS Export XML File Task &#8211; Select Source Tables, Queries, Connection</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Select Source Tables, Queries, Connection" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-source-tables.png" alt="SSIS ExportXML File Task - Select Source Tables, Queries, Connection" /></p>
<h3>SSIS Export XML File Task &#8211; Split file options (Split by Size, Row count and Group by column</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Split file options (Split by Size, Row count and Group by column" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-split-file-options.png" alt="SSIS ExportXML File Task - Split file options (Split by Size, Row count and Group by column" /></p>
<h3>SSIS Export XML File Task &#8211; Split file options (Split by Size, Row count and Group by column</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Split file options (Split by Size, Row count and Group by column" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-split-file-options.png" alt="SSIS ExportXML File Task - Split file options (Split by Size, Row count and Group by column" /></p>
<h2>Create Input Datasets</h2>
<p>First step to product XML is define input datasets. If you have no parent child relation (e.g. Customer and Orders) then most likely you will need one dataset. If you are using XML Generator Transform then any attached inputs to your transform becomes datasets. First dataset is automatically set to Root dataset.</p>
<p>For Export XML File task you have to define datasets manually. You need to pick connection manager and then select Table or Query. To make query dynamic you can use Variable Placeholder</p><pre class="crayon-plain-tag">select * from MyTable Where Month='{{User::varMonthName}}'</pre><p>
<h3>SSIS Export XML File Task &#8211; Layout Editor (Define nested elements and Parent-Child relation)</h3>
<h2><img decoding="async" title="SSIS Export XML File Task - Layout Editor (Define nested elements and Parent-Child relation)" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-define-shape-nested-xml.png" alt="SSIS ExportXML File Task - Layout Editor (Define nested elements and Parent-Child relation)" /></h2>
<div>
<h3>SSIS Export XML File Task &#8211; Add/Edit input Dataset</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Add/Edit Dataset" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-task-add-edit-input-dataset.png" alt="SSIS ExportXML File Task - Add/Edit input Dataset" /></p>
</div>
<h2>Create XML Elements /Attributes</h2>
<p>XML Element has start and end tags (end tag is optional if no children elements found). To add column as Element you can click on Add Element option.</p>
<p>Example of Elements</p><pre class="crayon-plain-tag">&lt;rootelement&gt;
  &lt;rowelement&gt;&lt;prop1element&gt;AAA&lt;/prop1element&gt;&lt;/rowelement&gt;
  &lt;rowelement&gt;&lt;prop1element /&gt;&lt;/rowelement&gt;
  &lt;rowelement&gt;&lt;prop1element&gt;CCC&lt;/prop1element&gt;&lt;/rowelement&gt;
&lt;/rootelement&gt;</pre><p>
<h3>SSIS Export XML File Task &#8211; Layout Editor Right Click Menu</h3>
<h2><img decoding="async" title="SSIS Export XML File Task - Layout Editor Right Click Menu" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-layout-editor-right-click-menu.png" alt="SSIS ExportXML File Task - Layout Editor Right Click Menu" /></h2>
<div>
<h3>SSIS Export XML File Task &#8211; Add/Edit Attribute</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Add/Edit Attribute" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-add-edit-attributes.png" alt="SSIS ExportXML File Task - Add/Edit Attribute" /></p>
</div>
<h2>Create nested XML elements (indentation)</h2>
<p>When you need nested element (e.g. &lt;LocationInfo&gt;&lt;ZipCode&gt;xxxxxx&lt;/ZipCode&gt;&lt;/LocationInfo&gt; ) then Add element and check Unbound option on the UI (e.g. add LocationInfo as Unbound).</p>
<h2>Setting Advanced Option</h2>
<p>In this section you will learn how to set many advanced options for XML generation.</p>
<h3>SSIS Export XML File Task &#8211; Select XML Format Options</h3>
<p><img decoding="async" title="SSIS Export XML File Task - Select XML Format Options" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-xml-file-task/ssis-export-xml-file-task-target-format-options.png" alt="SSIS ExportXML File Task - Select XML Format Options" /></p>
<h3>Handling NULL in XML output</h3>
<p>By default NULL attributes or elements not included in output because its hard to identify Blank string vs NULL string. If you wish to explicitly flag NULL items in output then you may uncheck Do not include NULL option. By doing so you will notice two changes. In your root node xmlns:xsi attribute is added to add standard namespace and when element is NULL you will see xsi:nil=&#8221;true&#8221; in the self closing element tag. This indicates that column data is NULL. If you see self closing tab without xsi:nil=&#8221;true&#8221; then its Blank value rather than NULL.</p>
<h3>Define XML Namespace (Prefix)</h3>
<p>By default no XML namespace is defined in the XML output. But if you wish to include any attribute or element with prefix then it requires namespace declaration. For more information on how to create XML with namespace <a href="https://zappysys.com/blog/ssis-generate-xml-namespace-prefix/" rel="noopener" target="_blank">check this article</a>.</p>
<p>Consider the following example. It has some prefix called ns1 for element and ns2 for attribute. To achieve such format make sure you define two namespaces on XML Options tab (e.g. ns1=http://someurl1,ns2=http://someurl2 ). Once you do this ns1 and ns2 can be used as prefix for any element or attribute.</p>
<p>Example of Namespace/Prefix use</p><pre class="crayon-plain-tag">&lt;data xmlns:ns1="http://someurl1" xmlns:ns2="http://someurl2" &gt;
  &lt;ns1:row ns2:id="111"&gt;&lt;prop1&gt;AAA&lt;/prop1&gt;&lt;/ns1:row&gt;
&lt;/data&gt;</pre><p>
&nbsp;</p>
<h3>Using XML Namespace Prefix for Element or Attributes</h3>
<p>In order to use namespace you have to set Prefix property for any Element or Attribute when you Add them. For example to add element &lt;row&gt; with prefix ns1 (e.g. &lt;ns1:row&gt; ) you have to set prefix to ns1 on the Add/Edit Element UI. Before you can use Prefix make sure namespace is defined as per previous section.</p>
<h3>Removing XML declaration</h3>
<p>Some times you have requirement to omit XML declaration (e.g. first line  &lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt; ). For that check &#8220;Do not output XML declaration&#8221; option on XML options tab.</p>
<h3>Remove Invalid XML Characters</h3>
<p>If you ever encounter invalid XML characters and want to remove them <a href="https://zappysys.com/blog/how-to-remove-invalid-characters-from-xml-using-ssis-and-regex/" target="_blank" rel="noopener">then check this article</a></p>
<h3>Change / Remove Root Element from output</h3>
<p>By default XML document has root element called &#8220;Root&#8221; (See XML Options tab to change this). You can change this to custom name or  remove it if you wish to hide start and end tag of root element from output.</p>
<h2>Change / Removing XML Row Element from output</h2>
<p>By default row of dataset will start with default Row element (e.g. &lt;DatasetRow&gt;&#8230; &lt;/DatasetRow&gt;). if you wish to hide those start and end tag then make sure you remove default Row element name in Dataset Declaration (Edit dataset and remove Row Element name)</p>
<h2>Define Parent Child Join in XML datasets (One to Many)</h2>
<p>If you have parent child relationship in XML (e.g. each Customer Tag has multiple Orders) then you need to define at least two datasets (One for parent (i.e. Customer) and one for Child (i.e Orders)).</p>
<p>&nbsp;</p>
<div style="width: 699px" class="wp-caption alignnone"><img loading="lazy" decoding="async" title="SSIS Export XML File Task - Add/Edit Document Array" src="//zappysys.com/onlinehelp/ssis-powerpack/scr/images/xml-generator-transform/ssis-xml-generator-add-edit-document-array.png" alt="SSIS Export XML File Task - Add/Edit Document Array" width="689" height="384" /><p class="wp-caption-text">Define Parent to Child Relationship for XML Output (One to Many JOIN)</p></div>
<p>&nbsp;</p>
<h2>Making things Dynamic (Query Parameter / Layout Information)</h2>
<p>To make things dynamic you can insert <a href="//zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">variable placeholders</a> anywhere in the editor (Look for {{Insert variable}} menu item in the editor). If you want to make entire Layout dynamic then use option to Load Layout from File or Variable. If this option is not available then consider <a href="https://zappysys.com/blog/ssis-dataflow-expression-source-component-property/" target="_blank" rel="noopener">SSIS expression to make it dynamic</a><br />
<strong>Example:</strong></p><pre class="crayon-plain-tag">select * from MyTable Where Month='{{User::varMonthName}}'</pre><p>
<h2>Controlling XML Date Time formatting (How to use ISO date)</h2>
<p>By default date/time values are exported as yyyy-MM-dd HH:mm:ss format but if you wish to change so its exported to ISO format or other format then goto XML Options tab and set Date format to yyyy-MM-ddTHH:mm:ss for ISO. If Datetime is UTC then change format to yyyy-MM-ddTHH:mm:ssZ (append &#8220;Z&#8221; at the end)</p>
<h2>Conclusion</h2>
<p>Creating nested XML may not be easy task but innovative drag and drop approach of <a href="https://zappysys.com/products/ssis-powerpack/" target="_blank" rel="noopener">SSIS PowerPack</a> certainly makes it easy to produce complex XML with every possible option on hand. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack for free</a> (45+ tasks and components) and explore what else you can do with it.</p>
<p>&nbsp;</p>
<p>The post <a href="https://zappysys.com/blog/tutorial-create-xml-in-ssis-export-xml-file-output/">How to export XML from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
