<?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 JSON Export Task Archives | ZappySys Blog</title>
	<atom:link href="https://zappysys.com/blog/category/ssis/tasks/ssis-json-export-task/feed/" rel="self" type="application/rss+xml" />
	<link>https://zappysys.com/blog/category/ssis/tasks/ssis-json-export-task/</link>
	<description>SSIS / ODBC Drivers / API Connectors for JSON, XML, Azure, Amazon AWS, Salesforce, MongoDB and more</description>
	<lastBuildDate>Sun, 08 Jan 2023 21:06:29 +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 JSON Export Task Archives | ZappySys Blog</title>
	<link>https://zappysys.com/blog/category/ssis/tasks/ssis-json-export-task/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</title>
		<link>https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Sat, 13 Apr 2019 05:29:48 +0000</pubDate>
				<category><![CDATA[SSIS CSV Export Task]]></category>
		<category><![CDATA[SSIS Excel Export Task]]></category>
		<category><![CDATA[SSIS JSON Export Task]]></category>
		<category><![CDATA[SSIS SFTP / FTP Connection]]></category>
		<category><![CDATA[SSIS SFTP Task]]></category>
		<category><![CDATA[SSIS XML Export Task]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftps]]></category>
		<category><![CDATA[json.xml]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssis]]></category>
		<guid isPermaLink="false">https://zappysys.com/blog/?p=6761</guid>

					<description><![CDATA[<p>Introduction In this blog post you will see how easy it is to load large amount of data from SQL Server to FTP/SFTP. SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip). For demo purpose we will use SQL Server as relational source but you can use same steps for any database engine [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/">SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Introduction</h2>
<p><a href="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" target="_blank" rel="noopener"><img decoding="async" class="wp-image-3058 size-full alignleft" src="https://zappysys.com/blog/wp-content/uploads/2018/03/ssis-sftp-ftp-ftps-task.png" alt="" width="100" height="100" /></a>In this blog post you will see how easy it is to load large amount of data from SQL Server to FTP/SFTP. SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip).</p>
<p>For demo purpose we will use SQL Server as relational source but you can use same steps for any database engine such as Oracle, MySQL, DB2. In this post we will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV Task</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> to achieve desired integration with FTP/SFTP/FTPS with drag and drop approach. You can also export data to JSON or XML or Excel file to FTP/SFTP/FTPS using same techniques (Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a>  or <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML Task</a> or <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/" target="_blank" rel="noopener">Export Excel Task</a> ).</p>
<p>Our goal is to achieve following things</p>
<ul>
<li>Extract large amount of data from SQL Server Table or Query and export to CSV files</li>
<li>Generate CSV files in compressed format (*.gz) to speedup upload</li>
<li>Split CSV files by row count</li>
<li>Upload data to FTP/SFTP/FTPS using highly parallel manner for maximum speed</li>
</ul>
<p>There are three different ways you can achieve data export to Secure FTP using SSIS.</p>
<ol>
<li><strong>Method-1 (Fastest)</strong>: Use two step process (First export SQL Server data to local files using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export Task</a> and then upload files to Secure FTP using  <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> )</li>
<li><strong>Method-2 (Slower)</strong>: Use <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export Task</a> with Secure FTP Connection as Target rather than save to Local files.</li>
<li><strong>Method-3 (Slower)</strong>: Use Data flow components like <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">Secure FTP CSV File Destination</a>  (for JSON / XML / EXCEL   use Method1 or Method2)</li>
</ol>
<p>Each method has its own advantage / disadvantage. If you prefer to upload / compress / split large amount of data then we recommend Method#1 (Two steps). If you have not very huge dataset then you can use Method#2 or Method#3. For Last method you can only use CSV export option (we don’t have JSON/ XML / EXCEL Destination for Secure FTP yet – we may add in future)</p>
<p><strong>Screenshot of SSIS Package</strong></p>
<div id="attachment_707" style="width: 835px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-707" class="size-full wp-image-707" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png" alt="Extract SQL Server Data to CSV files in SSIS (Bulk export) and compress/upload files to Amazon S3 (AWS Cloud)" width="825" height="430" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3.png 825w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-server-data-upload-to-amazon-s3-300x156.png 300w" sizes="(max-width: 825px) 100vw, 825px" /></a><p id="caption-attachment-707" class="wp-caption-text">Extract SQL Server Data to CSV files in SSIS (Bulk export) Split / GZip Compress / upload files to FTP/SFTP/FTPS</p></div>
<h2><span id="Method-1_Upload_SQL_data_to_Azure_Blob_in_Two_steps">Method-1 : Upload SQL data to Secure FTP in Two steps</span></h2>
<p>In this section we will see first method (recommended) to upload SQL data to Secure FTP. This is the fastest approach if you have lots of data to upload.  In this approach we first create CSV files from SQL Server data on local disk using <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">SSIS Export CSV Task</a>. After that in second step we upload all files to Secure FTP Storage using <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a>.</p>
<h3><span id="Step-1_Configure_Source_Connection_in_Export_CSV_Task">Step-1: Configure Source Connection in Export CSV Task</span></h3>
<p>To extract data from SQL Server you can use Export CSV Task. It has many options which makes it possible to split large amount of data into multiple files. You can specify single table or multiple tables as your data source.</p>
<p>For multiple table use vertical bar. e.g.  dbo.Customers|dbo.Products|dbo.Orders. When you export this it will create 3 files ( dbo.Customers.csv , dbo.Products.csv, dbo.Orders.csv )</p>
<p><strong>Steps:</strong></p>
<ol>
<li>Drag ZS Export CSV Task from Toolbox</li>
<li>Double click task to configure</li>
<li>From connection drop down select New connection option (OLEDB or ADO.net)</li>
<li>Once connection is configured for Source database specify SQL Query to extract data as below
<div id="attachment_705" style="width: 528px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-705" class="size-full wp-image-705" src="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png" alt="Export SQL Server Table or Query as CSV file (Bulk export in SSIS)" width="518" height="494" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast.png 518w, https://zappysys.com/blog/wp-content/uploads/2016/07/export-sql-server-table-query-data-to-csv-fast-300x286.png 300w" sizes="(max-width: 518px) 100vw, 518px" /></a><p id="caption-attachment-705" class="wp-caption-text">Export SQL Server Table or Query as CSV file (Bulk export in SSIS)</p></div></li>
<li>Now go to target tab. Here you can specify full path for file. e.g. c:\ssis\temp\cust.csv</li>
</ol>
<h3><span id="Step-2_Compress_CSV_Files_in_SSIS_GZIP_format_8211_gz">Step-2: Compress CSV Files in SSIS ( GZIP format – *.gz )</span></h3>
<p>Above steps will export file as CSV format without splitting or compression. But to compress file once exported you can go to Target tab of Export CSV Task and check [<strong>Compress file to *.gz format</strong>] option.</p>
<div id="attachment_706" style="width: 579px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-706" class="size-full wp-image-706" src="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png" alt="Compress exported SQL Server data files to GZip ( *.gz) in SSIS Export CSV Task" width="569" height="462" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis.png 569w, https://zappysys.com/blog/wp-content/uploads/2016/07/compress-csv-files-in-ssis-300x244.png 300w" sizes="(max-width: 569px) 100vw, 569px" /></a><p id="caption-attachment-706" class="wp-caption-text">Compress exported SQL Server data files to GZip ( *.gz) in SSIS Export CSV Task</p></div>
<h3><span id="Step-3_Split_CSV_files_by_row_count_or_data_size_in_SSIS">Step-3: Split CSV files by row count or data size in SSIS</span></h3>
<p>Now lets look at how to split exported CSV files into multiple files so we can upload many files in parallel. Goto Split Options and check [<strong>Enable Split by Size/Rows</strong>]
<div id="attachment_708" style="width: 435px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-708" class="size-full wp-image-708" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png" alt="Using SSIS Split Exported CSV files (Split by row count or size)" width="425" height="489" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data.png 425w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-split-csv-files-sql-data-261x300.png 261w" sizes="(max-width: 425px) 100vw, 425px" /></a><p id="caption-attachment-708" class="wp-caption-text">Using SSIS Split Exported CSV files (Split by row count or size)</p></div>
<h3><span id="Step-4_Upload_CSV_files_to_Azure_Blob_8211_Using_multi_threaded_option">Step-4: Upload CSV files to Secure FTP – Using multi threaded option</span></h3>
<p>Now final thing is use <a href="https://zappysys.com/products/ssis-powerpack/ssis-sftp-task-ftp-ftps/" target="_blank" rel="noopener">ZS Secure FTP Task (SFTP, FTP, FTPS)</a> to upload files to Secure FTP.</p>
<p><strong>Steps:</strong></p>
<ol>
<li>Drag ZS Secure FTP Task (SFTP, FTP, FTPS) from SSIS toolbox</li>
<li>Double click ZS Secure FTP Task (SFTP, FTP, FTPS) to configure it</li>
<li>Specify Action = Upload Files To FTP Server</li>
<li>Specify Source file path (or pattern) e.g. c:\SSIS\temp\*.*</li>
<li>Now in the Target connection dropdown click [New]</li>
<li>When Connection UI opens Enter your Account, Secret Key (Leave all other parameters default if you not sure)</li>
<li>Click Test and close connection UI</li>
<li>On the Target path on ZS Secure FTP Task (SFTP, FTP, FTPS) enter your bucket and folder path where you want to upload local files. (For example: <strong>/datafolder/sqldata/)</strong></li>
<li>Click ok and Run package to test full package</li>
</ol>
<h2><span id="Method-2_Upload_SQL_data_to_Azure_Blob_without_local_stage_One_step">Method-2 : Upload SQL data to Secure FTP without local stage (One step)</span></h2>
<p>Now let’s change previous approach little bit to send SQL server data directly to FTP/SFTP/FTPS without any Landing area on local disk.  <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-csv-file-task/" target="_blank" rel="noopener">Export CSV Task</a> , <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> , <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-excel-file-task/" target="_blank" rel="noopener">Export Excel Task</a> and <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-xml-file-task/" target="_blank" rel="noopener">Export XML Task</a> all of them supports Azure Blob / Amazon S3 and Secure FTP (SFTP) connection as target (Only available in <strong>Pro Edition</strong>). We will use this feature in following section.</p>
<p>This approach helps to avoid any local disk need and it may be useful for security reason for some users. However drawback of this approach is, it wont use parallel threads to upload large amount of data like previous method.</p>
<p>Following change will be needed on Export task to upload SQL data directly to Azure / FTP or Amazon storage.</p>
<div id="attachment_5252" style="width: 859px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5252" class="size-full wp-image-5252" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png" alt="Export SQL data to multiple files to Amazon S3, Azure, Secure FTP (SFTP) in Stream Mode. Compress GZip, Overwrite, Split Options" width="849" height="627" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip.png 849w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip-300x222.png 300w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-export-sql-data-to-s3-csv-compress-gzip-768x567.png 768w" sizes="(max-width: 849px) 100vw, 849px" /></a><p id="caption-attachment-5252" class="wp-caption-text">Export SQL data to multiple files to Amazon S3, Azure Blob, Secure FTP (SFTP) in Stream Mode. Compress GZip, Overwrite, Split Options</p></div>
<h2><span id="Method-3_Using_Azure_Blob_destination_8211_Generate_Azure_Blob_file_from_any_source">Method-3 : Using Secure FTP CSV File Destination – Generate Secure FTP file from any source</span></h2>
<p>Now let’s look at third approach to save data from any SSIS Source to FTP/SFTP/FTPS file. Advantage of this approach is you are not limited to few source options provided by Export CSV Task. If you have complex data transformation needed in Data Flow before sending data to FTP/SFTP/FTPS then use this approach.  We will use <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">Secure FTP CSV File Destination</a> as below</p>
<ol>
<li>Drag SSIS Data flow task from toolbox<a href="https://zappysys.com/blog/wp-content/uploads/2019/09/ssis-drag-drop-data-flow-task.png"><img loading="lazy" decoding="async" class="aligncenter 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></li>
<li>Create necessary source connection (e.g. OLEDB connection)</li>
<li>Create Secure FTP Connection (Right click in Connection Managers panel in bottom and click New connection and select <strong>ZS-SFTP</strong> type )</li>
<li>Once connection managers are created Go to data flow designer and Drag OLEDB Source</li>
<li>Configure OLEDB Source to read desired data from source system (e.g. SQL Server / Oracle)</li>
<li>Once source is configured drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-secure-ftp-csv-file-destination/" target="_blank" rel="noopener">ZS Secure FTP CSV File Destination</a> from SSIS toolbox</li>
<li>Double click Secure FTP CSV File Destination and configure as below
<ol>
<li>On Connection Managers tab select Secure FTP Connection (We created in earlier section).</li>
<li>Properties tab configure like below screenshot</li>
<li>On Input Columns tab select desired column you like to write in the target file. Your name from upstream will be taken as is for target file. So make sure to name upstream columns correctly.</li>
<li>Click OK to save UI</li>
</ol>
</li>
<li>Execute package and check your Secure FTP to see files got created.
<div id="attachment_5253" style="width: 729px" class="wp-caption aligncenter"><a href="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5253" class="size-full wp-image-5253" src="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png" alt="Loading SQL Server data into S3 Bucket Files (Split, Compress Gzip Options) - SSIS Amazon S3 CSV File Destination" width="719" height="782" srcset="https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options.png 719w, https://zappysys.com/blog/wp-content/uploads/2016/07/ssis-amazon-s3-csv-destination-split-compress-gzip-options-276x300.png 276w" sizes="(max-width: 719px) 100vw, 719px" /></a><p id="caption-attachment-5253" class="wp-caption-text">Loading SQL Server data into Secure FTP Files (Split, Compress Gzip Options) &#8211; SSIS Secure Ftp CSV File Destination</p></div></li>
</ol>
<h2><span id="Conclusion">Conclusion</span></h2>
<p>In this post you have seen how easy it is to upload / archive your SQL Server data (or any other RDBMS data) to FTP/SFTP/FTPS in few clicks. <a href="https://zappysys.com/products/ssis-powerpack/">Try SSIS PowerPack</a> for free and find out yourself how easy it is to integrate SQL Server and Secure FTP using SSIS.</p>
<p>The post <a href="https://zappysys.com/blog/ssis-data-load-sql-server-ftp-sftp-split-files-gzip/">SSIS Data Load – SQL Server to FTP/SFTP (Split Files, GZip)</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>5 Ways to Export JSON from SQL Server using SSIS</title>
		<link>https://zappysys.com/blog/export-json-from-sql-server-using-ssis/</link>
		
		<dc:creator><![CDATA[ZappySys]]></dc:creator>
		<pubDate>Mon, 07 Dec 2015 19:38:44 +0000</pubDate>
				<category><![CDATA[SSIS JSON Export Task]]></category>
		<category><![CDATA[SSIS JSON File Destination]]></category>
		<category><![CDATA[SSIS JSON Generator Transform]]></category>
		<category><![CDATA[SSIS Logging Task]]></category>
		<category><![CDATA[SSIS Template Transform]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[sql server]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[SSIS Export JSON Task]]></category>
		<category><![CDATA[SSIS PowerPack]]></category>
		<guid isPermaLink="false">http://zappysys.com/blog/?p=209</guid>

					<description><![CDATA[<p>Introduction SQL Server 2012 and all previous versions lacking native JSON support, same theory is true for their ETL Platform SSIS. If you are one of them who wants to export JSON from SQL Server or any other RDBMS like MySQL, Oracle then you can easily output complex JSON using any of the following components. Five ways of [&#8230;]</p>
<p>The post <a href="https://zappysys.com/blog/export-json-from-sql-server-using-ssis/">5 Ways to Export JSON 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>SQL Server 2012 and all previous versions lacking native JSON support, same theory is true for their ETL Platform SSIS. If you are one of them who wants to export JSON from SQL Server or any other RDBMS like MySQL, Oracle then you can easily output complex JSON using any of the following components.</p>
<h2>Five ways of creating JSON inside SSIS</h2>
<p>ZappySys toolset provides multiple ways creating JSON inside SSIS. You can choose method suitable for your scenario. Each method has pros and cons so choose it as per your need.</p>
<h3>JSON File Destination</h3>
<p><img decoding="async" class="alignleft" style="font-family: inherit; font-size: inherit;" title="SSIS JSON Destination (Create JSON File)" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/json-file-destination/ssis-json-file-destination.png" alt="SSIS JSON Destination (Create JSON File)" width="100" /><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-destination-connector/" target="_blank" rel="noopener">SSIS JSON Destination</a> can be used to generate simple or complex JSON files out of relational data source such as SQL Server, Oracle, MySQL. In few clicks you can create desired JSON Shape from single or multiple tables (Parent/Child Nested Documents).</p>
<p><strong>PROS:</strong> Multiple data flow components can be attached. Which means unlike <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> you are not limited to OLEDB or ODBC Sources only.</p>
<p><strong>CONS:</strong> When you remove upstream component it may break Dataset mappings. Also server side Lookup Option is not available. File Splitting Options not available.</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-json-file-destination/" target="_blank" rel="noopener">some articles</a> for use case of this component.</p>
<div id="attachment_5358" style="width: 943px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5358" class="size-full wp-image-5358" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png" alt="JSON File Destination - Generate JSON in SSIS from multiple inputs" width="933" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png 933w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-300x252.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-768x645.png 768w" sizes="(max-width: 933px) 100vw, 933px" /></a><p id="caption-attachment-5358" class="wp-caption-text">JSON File Destination &#8211; Generate JSON in SSIS from multiple inputs</p></div>
<h3>JSON Generator Transform</h3>
<h3><span style="font-size: 16px;"><img decoding="async" class="alignleft" title="JSON Generator Transform" src="https://zappysys.com/images/SSIS-PowerPack/ssis-json-generator-transform.png" alt="JSON Generator Transform" width="100" /></span></h3>
<p><a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/" target="_blank" rel="noopener">SSIS JSON Generator Transform</a> can be used to generate single or multiple JSON documents from any type of data sources (e.g. SQL Server, MySQL, Flat File, Excel) inside data flow task. It takes multiple inputs and outputs JSON String Output Column which can be used to feed JSON to other downstream system.</p>
<p><strong>PROS:</strong> Multiple data flow components can be attached. Which means unlike <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">Export JSON Task</a> you are not limited to OLEDB or ODBC Sources only.</p>
<p><strong>CONS:</strong> When you remove upstream component it may break Dataset mappings. Also server side Lookup Option is not available. File Splitting Options not available. Output is JSON String Column.</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-json-generator-transform/" target="_blank" rel="noopener">some articles</a> for use case of this transform.</p>
<div id="attachment_4918" style="width: 792px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-4918" class="size-full wp-image-4918" src="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png" alt="Preview JSON - Generate for BigQuery Table Insert" width="782" height="640" srcset="https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert.png 782w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert-300x246.png 300w, https://zappysys.com/blog/wp-content/uploads/2017/07/ssis-preview-json-for-bigquery-dataset-insert-768x629.png 768w" sizes="(max-width: 782px) 100vw, 782px" /></a><p id="caption-attachment-4918" class="wp-caption-text">Preview JSON &#8211; Generate for BigQuery Table Insert</p></div>
<h3>Export JSON Task</h3>
<p><em><img decoding="async" class="alignleft" src="https://zappysys.com/images/SSIS-PowerPack/ssis-export-json-file-task.png" alt="SSIS Export JSON File Task" /></em><a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">SSIS Export JSON File Task</a> can be used to generate simple or complex JSON files out of relational data source such as SQL Server, Oracle, MySQL. It also support exporting directly to cloud (e.g. Azure Blob Storage, Amazon AWS S3, Secure FTP). In few clicks you can create desired JSON Shape from single or multiple tables (Parent/Child Nested Documents)</p>
<p><strong>PROS:</strong> Simple to use with flexible options to export to file, variable, AWS S3, Azure Blob, FTP / SFTP location. Allows to split records. File Splitting Options available (Split By Size  / Row Count).</p>
<p><strong>CONS:</strong> You can only use limited data sources as Dataset input (e.g. OLEDB / ODBC or SQL Server).</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-json-export-task/" target="_blank" rel="noopener">some articles</a> for use case of this task.</p>
<h3>Template Transform</h3>
<p><img decoding="async" class="alignleft" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/template-transform/ssis-template-transform.png" alt="SSIS SSIS Template Transform" />Template Transform can be used to create dynamic strings inside data flow. You can use upstream columns as placeholders or use SSIS variables anywhere in the template to create desired text (e.g. XML / JSON document).</p>
<p><strong>PROS:</strong> Very Simple to use.</p>
<p><strong>CONS:</strong> Cannot use multiple inputs. It may not be used to create Complex JSON and options like do not output NULL attributes is not possible.</p>
<p>&nbsp;</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/components/ssis-template-transform/" target="_blank" rel="noopener">some articles</a> for use case of this transform.</p>
<div id="attachment_2614" style="width: 983px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2614" class="size-full wp-image-2614" src="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png" alt="Create JSON for API Request (POST) using SSIS Template Transform" width="973" height="611" srcset="https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call.png 973w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-300x188.png 300w, https://zappysys.com/blog/wp-content/uploads/2018/02/ssis-template-transform-create-json-xml-for-api-call-768x482.png 768w" sizes="(max-width: 973px) 100vw, 973px" /></a><p id="caption-attachment-2614" class="wp-caption-text">Create JSON for API Request (POST) using SSIS Template Transform</p></div>
<h3>Logging Task (Control Flow Approach)</h3>
<p><img decoding="async" class="alignleft" src="https://zappysys.com/images/SSIS-PowerPack/ssis-logging-task.png" /> Just like Template Transform you can use <a href="https://zappysys.com/products/ssis-powerpack/ssis-logging-task-free/" target="_blank" rel="noopener">ZS Logging Task</a> to create JSON string from Template and Variable Placeholders.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Here is how to use Logging Task to save JSON into a variable.</p>
<ol>
<li>Select Variable which you like to Set on Logging Task</li>
<li>Enter your Template JSON String which you like to produce (see example below). Notice the use of yyyy-MM-dd <a href="https://zappysys.com/onlinehelp/ssis-powerpack/scr/ssis-format-specifiers.htm" target="_blank" rel="noopener">format specifier</a> and also JSONENCODE function.<br />
<pre class="crayon-plain-tag">{
 ActionId: {{User::vActionId}},
 CreatedOn: "{{User::vOrderDate,yyyy-MM-ddTHH:mm:ss}}",
 Notes: "{{User::vNotes,JSONENCODE}}"
}</pre>
</li>
<li>Select Message Type = <strong>None</strong></li>
<li><strong>Uncheck Append</strong>, and <strong>Prefix</strong> options like below
<div id="attachment_222" style="width: 732px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-222" class="wp-image-222 size-full" src="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png" alt="Creating JSON / XML Document using SSIS Logging Task" width="722" height="528" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png 722w, https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder-300x219.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-222" class="wp-caption-text">Creating JSON / XML Document using SSIS Logging Task</p></div></li>
</ol>
<p>&nbsp;</p>
<p>Here are <a href="https://zappysys.com/blog/category/ssis/tasks/ssis-logging-task/" target="_blank" rel="noopener">some articles</a> for use case of this task.</p>
<p>&nbsp;</p>
<h2>Create JSON using SSIS Export JSON Task</h2>
<p>Now let&#8217;s look at Export JSON Task form example to create JSON. Steps listed in below sections are very similar to JSON File Destination or JSON Generator Transform.</p>
<p>ZappySys offers innovative Layout Editor for JSON / XML creation from multiple sources. You can use Layout Editor to produce desired JSON Layout (Layout is stored in XML format behind the scene) and then in later step you will see how to make it dynamic so values are changed at runtime.</p>
<p>You can read layout as direct value, read from variable or read from file from disk.</p>
<h3>Select source connection for data</h3>
<p>First lets create new OLEDB or ADO.net connection from where we will read data. In our case we reading from Northwind Database.</p>
<div id="attachment_216" style="width: 565px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-216" class="size-full wp-image-216" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png" alt="SSIS JSON Export Task - Select Source Database Connection" width="555" height="218" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection.png 555w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-task-source-connection-300x118.png 300w" sizes="(max-width: 555px) 100vw, 555px" /></a><p id="caption-attachment-216" class="wp-caption-text">SSIS JSON Export Task &#8211; Select Source Database Connection</p></div>
<h3>Create Datasets</h3>
<p>Now add datasets which will be used to produce JSON File. One dataset will be always Root Dataset (Example: If your Root information is about customer then select customer table or query as your Main dataset. All other sections will be child sections)</p>
<div id="attachment_215" style="width: 419px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-215" class="size-full wp-image-215" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png" alt="Add SQL Dataset - Export JSON from SQL Query Option" width="409" height="431" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset.png 409w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-source-dataset-285x300.png 285w" sizes="(max-width: 409px) 100vw, 409px" /></a><p id="caption-attachment-215" class="wp-caption-text">Add SQL Dataset &#8211; Export JSON from SQL Query Option</p></div>
<h3>Add Output Columns for Main JSON Document</h3>
<p>Now its time to add columns for our output. If * is added by default then remove. * means output all columns. When you add columns first make sure you select correct parent node under which you want to add columns. In our case &#8220;Mappings&#8221; is parent node.</p>
<div id="attachment_214" style="width: 391px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-214" class="size-full wp-image-214" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png" alt="Add Output Columns for JSON Document - Column Selection Screen" width="381" height="446" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns.png 381w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-add-columns-256x300.png 256w" sizes="(max-width: 381px) 100vw, 381px" /></a><p id="caption-attachment-214" class="wp-caption-text">Add Output Columns for JSON Document &#8211; Column Selection Screen</p></div>
<h3>Add JSON Array / JOIN Conditions for related document</h3>
<p>Now let&#8217;s look at how to add JSON Array. For example Customer may have one or more Orders so we need to add node called Orders which may Produce JSON fragment like below</p>
<pre class="crayon-plain-tag">Orders : [ {...} , {...} ] </pre>
<p>Once customer related columns added, its time to add Orders section.</p>
<ol>
<li>This is Array of documents so first highlight &#8220;Mappings&#8221; node</li>
<li>Click &#8220;Add Document Array&#8221; option from toolbar.</li>
<li>On Add/Edit Elements UI specify name for JSON Attribute and specify correct relationship to parent dataset. In our case Orders related to Customers using CustomerID key.</li>
</ol>
<div id="attachment_212" style="width: 548px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-212" class="size-full wp-image-212" src="//zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png" alt="Add Child Section - nested JSON document , Define Parent-Child Relationship" width="538" height="432" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation.png 538w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-output-from-sql-server-parent-child-relation-300x241.png 300w" sizes="(max-width: 538px) 100vw, 538px" /></a><p id="caption-attachment-212" class="wp-caption-text">Add Child Section &#8211; nested JSON document , Define Parent-Child Relationship</p></div>
<h3>Handling JSON Array with dummy root dataset (Multiple Arrays)</h3>
<p>So in previous section we saw how to add array and define JOIN condition with parent dataset. Now what if you really have no parent dataset to join with ? For example we need to produce following sample JSON where Order array is related to Customer by common Column CustomerID as JOIN column. But Customer is not bound with any parent column. So how do you define JOIN condition? In such case you have to use below technique called dummy root dataset. (See next section on how to handle only one dataset using <strong>Single Dataset Array Mode</strong>)</p>
<p><strong>Sample JSON (Dummy root pattern)</strong></p><pre class="crayon-plain-tag">{
    "Customers": [
      {
        "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste",
        "Orders": [
          {
            "OrderID": 1000,
            "OrderDate": "2015-12-01"
          },
          {
            "OrderID": 1001,
            "OrderDate": "2015-12-01"
          }
        ]
      },

      {
        "CustomerID": "ANATR",
        "CompanyName": "Ana Trujillo Emparedados y helados",
        "Orders": [
          {
            "OrderID": 1002,
            "OrderDate": "2015-12-01"
          },
          {
            "OrderID": 1003,
            "OrderDate": "2015-12-01"
          }
        ]
      }

    ]
  }
}</pre><p>
Since root level always needs dataset, we must provide dummy dataset (only one row) even though there is no need for Parent Dataset JOIN in Customer Array. Typically you can write query like below to product dummy row in SQL Server or other database using OLEDB Source or Use <a href="https://zappysys.com/products/ssis-powerpack/dummy-data-source-free/" target="_blank" rel="noopener">Dummy Data Source</a> with Max Rows=1 setting to produce one fake record.</p><pre class="crayon-plain-tag">SELECT 1 as Col1</pre><p>
<strong>Using Dummy DataSource as Input</strong></p>
<p>For generating JSON which needs dummy root. Perform the following steps</p>
<ol>
<li>Drag Dummy Data Source from SSIS Toolbox. Change <strong>How many rows</strong> to 1. Click OK</li>
<li>Now drag two more OLEDB sources and Configure (e.g. Customers and Orders)</li>
<li>Now drag <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-file-destination-connector/">ZS JSON FIle Destination</a> component or <a href="https://zappysys.com/products/ssis-powerpack/ssis-json-generator-transform/">ZS JSON Generator</a></li>
<li>Now connect Dummy datasource then Customers and then Orders</li>
<li>Double click JSON component to configure layout. You may notice that Dummy Input is set as Root by default.</li>
<li>You can now select Mappings node and click on Add Array Documents icon. Configure like below. Notice we have not selected any JOIN criteria because its joined with Dummy Root.
<div id="attachment_5357" style="width: 785px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5357" class="size-full wp-image-5357" src="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png" alt="Add array to join with dummy dataset" width="775" height="617" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export.png 775w, https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export-300x239.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/dummy-root-pattern-ssis-json-export-768x611.png 768w" sizes="(max-width: 775px) 100vw, 775px" /></a><p id="caption-attachment-5357" class="wp-caption-text">Add array to join with dummy dataset</p></div></li>
<li>Now select newly added node and Click Add column icon to add CustomerID, CompanyName column under Customers array</li>
<li>Now select Customers array node and click Array Documents icon to Add Orders array.</li>
<li>Once Orders Array ia added you can Select Orders node and Insert new element to add OrderID and OrderDate columns</li>
<li>Finally it will look like below
<div id="attachment_5358" style="width: 943px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5358" class="size-full wp-image-5358" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png" alt="JSON File Destination - Generate JSON in SSIS from multiple inputs" width="933" height="784" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source.png 933w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-300x252.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-generate-json-using-dummy-root-multiple-input-source-768x645.png 768w" sizes="(max-width: 933px) 100vw, 933px" /></a><p id="caption-attachment-5358" class="wp-caption-text">JSON File Destination &#8211; Generate JSON in SSIS from multiple inputs</p></div></li>
</ol>
<p>&nbsp;</p>
<h3>Single dataset used as array</h3>
<p>Now lets look at one more pattern just like described in the previous section but now we have just one nested level (Only customers and not using Orders). If you have such case then choose Single dataset pattern option in the output mode. On Export Task you may see as check box rather than dropdown. To produced desired JSON (see blow) perform these steps.</p>
<ol>
<li>Select Output mode as <strong>Single Dataset Array</strong></li>
<li>In your Layout builder click on <strong>Add Document Array</strong> Icon and name it &#8220;Customers&#8221;.</li>
<li>After that highlight newly added node &gt; Right-Click &gt; <strong>Add Elements</strong> under that node</li>
<li>That&#8217;s it you will now see preview like below.</li>
</ol>
<pre class="crayon-plain-tag">{
    "Customers": [
      {
        "CustomerID": "ALFKI",
        "CompanyName": "Alfreds Futterkiste"
      },

      {
        "CustomerID": "ANATR",
        "CompanyName": "Ana Trujillo Emparedados y helados"
      }
    ]
  }
}</pre>
&nbsp;</p>
<h3>How to export JSON in 2D Array format</h3>
<p>If you have to export JSON as 2D array format then you can change following option.</p>
<p><img decoding="async" class="figureimage" title="SSIS Export to JSON File Task - Export as 2D Array" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-json-file-task/ssis-export-json-2d-array-format.png" alt="SSIS Export JSON File Task - Export as 2D Array" /></p>
<p>Here are examples of output for each option.<br />
Select say you have source data with 2 columns <i>id</i> and <i>name</i>.</p>
<p><b>Default</b></p><pre class="crayon-plain-tag">[{id:1,name:&quot;AA&quot;}, {id:2,name:&quot;BB&quot;}]</pre><p>
<b>Multicontent</b></p><pre class="crayon-plain-tag">{id:1,name:&quot;AA&quot;}{id:2,name:&quot;BB&quot;}</pre><p>
<b>ArrayDocs</b></p><pre class="crayon-plain-tag">[{id:1,name:&quot;AA&quot;}, {id:2,name:&quot;BB&quot;}]</pre><p>
<b>Array2D</b></p><pre class="crayon-plain-tag">[[1,&quot;AA&quot;],[2,&quot;BB&quot;]]</pre><p>
<b>Array2DWithHeader</b></p><pre class="crayon-plain-tag">[[&quot;id&quot;,&quot;name&quot;],[1,&quot;AA&quot;],[2,&quot;BB&quot;]]</pre><p>
<b>ArrayLines</b></p><pre class="crayon-plain-tag">[1,&quot;AA&quot;][2,&quot;BB&quot;]</pre><p>
<b>ArrayLinesWithHeader</b></p><pre class="crayon-plain-tag">[&quot;id&quot;,&quot;name&quot;][1,&quot;AA&quot;][2,&quot;BB&quot;]</pre><p>
&nbsp;</p>
<h3>Preview JSON output using live preview</h3>
<p>You can enable / disable Live preview of JSON layout as below.</p>
<div id="attachment_210" style="width: 573px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-210" class="size-full wp-image-210" src="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png" alt="JSON Output preview in SSIS Export JSON File Task" width="563" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png 563w, https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis-300x253.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-210" class="wp-caption-text">JSON Output preview in SSIS Export JSON File Task</p></div>
<h2>Make things dynamic (Using SSIS Variable for SQL or Layout)</h2>
<p>There will be a time when you have use dynamic values in your JSON generation. You may have to Alias something from variable or you have to supply Variable in your SQL used for Dataset. Not to worry. ZappySys Supports multiple ways to make it dynamic. You can use SSIS Variables following 3 ways to make Layout XML dynamic.</p>
<ol>
<li>Use SSIS variable inside Dataset SQL (Only for <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">ZS Export JSON Task</a>)</li>
<li>Anywhere inside Layout XML (Click <strong>Edit Code</strong> option)</li>
<li>Load Layout From Variable (Indirect Method)</li>
</ol>
<h3>Using Variable inside Dataset SQL</h3>
<p>Here is how you can use Variable inside dataset SQL for <a href="https://zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/" target="_blank" rel="noopener">ZS Export JSON Task</a></p>
<div id="attachment_5359" style="width: 736px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5359" class="size-full wp-image-5359" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png" alt="SSIS Export JSON Task - Using Variable for Dynamic SQL" width="726" height="538" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable.png 726w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-export-json-dynamic-dataset-sql-use-variable-300x222.png 300w" sizes="(max-width: 726px) 100vw, 726px" /></a><p id="caption-attachment-5359" class="wp-caption-text">SSIS Export JSON Task &#8211; Using Variable for Dynamic SQL</p></div>
<h3>Using Variable inside Layout XML</h3>
<p>Here is how you can insert SSIS Variable anywhere in Layout XML. In below Example we are choosing Alias for one column from some SSIS Variable.</p>
<div id="attachment_5360" style="width: 865px" class="wp-caption alignnone"><a href="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-5360" class="size-full wp-image-5360" src="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png" alt="SSIS JSON File Destination - Using SSIS Variable for Dynamic Layout" width="855" height="591" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout.png 855w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout-300x207.png 300w, https://zappysys.com/blog/wp-content/uploads/2015/12/ssis-json-file-destination-use-ssis-variable-dynamic-layout-768x531.png 768w" sizes="(max-width: 855px) 100vw, 855px" /></a><p id="caption-attachment-5360" class="wp-caption-text">SSIS JSON File Destination &#8211; Using SSIS Variable for Dynamic Layout</p></div>
<h3>Load Layout From Variable</h3>
<p>If you have some need to load Layout XML from File or SSIS Variable. You can use Load Layout from Variable Option.</p>
<p>For example in below screenshot we are creating layout first and ave to some variable. Or you can load from external file using <a href="https://zappysys.com/products/ssis-powerpack/ssis-file-system-task-advanced/">ZS Advanced File System Task</a>.  Connect Logging task to Export JSON Task and you ready to produce JSON.</p>
<div id="attachment_222" style="width: 732px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-222" class="size-full wp-image-222" src="//zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png" alt="Set SSIS Variable value (multi-line content using placeholder)" width="722" height="528" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder.png 722w, https://zappysys.com/blog/wp-content/uploads/2015/12/set-ssis-variable-value-multi-line-placeholder-300x219.png 300w" sizes="(max-width: 722px) 100vw, 722px" /></a><p id="caption-attachment-222" class="wp-caption-text">Set SSIS Variable value (multi-line content using placeholder)</p></div>
<p>Here is how to load Layout From any SSIS Variable. You can also load Layout from XML file or Variable which contains layout File Path.</p>
<div id="attachment_210" style="width: 573px" class="wp-caption alignnone"><a href="//zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-210" class="wp-image-210 size-full" src="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png" alt="JSON Layout from SSIS Variable" width="563" height="475" srcset="https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis.png 563w, https://zappysys.com/blog/wp-content/uploads/2015/12/sql-server-json-output-preview-ssis-300x253.png 300w" sizes="(max-width: 563px) 100vw, 563px" /></a><p id="caption-attachment-210" class="wp-caption-text">JSON Layout from SSIS Variable</p></div>
<h2>Other JSON Output Options</h2>
<p>Execute package and verify generated JSON it should look like below (Date format may be different in your case if you have set different on JSON options tab). For clarity we have formatted JSON below but in your output it may be compact version so reduce file size.</p>
<h3>Indent JSON Output</h3>
<p>You can check Indent option to make JSON look pretty like below.</p><pre class="crayon-plain-tag">{
  "CustomerID": "ALFKI",
  "CompanyName": "Alfreds Futterkiste",
  "ContactName": null,
  "Orders": [
    {
      "OrderID": 10643,
      "OrderDate": "1997-08-25T00:00:00"
    },
    {
      "OrderID": 10692,
      "OrderDate": "1997-10-03T00:00:00"
    },
    {
      "OrderID": 10702,
      "OrderDate": "1997-10-13T00:00:00"
    },
    {
      "OrderID": 10835,
      "OrderDate": "1998-01-15T00:00:00"
    },
    {
      "OrderID": 10952,
      "OrderDate": "1998-03-16T00:00:00"
    },
    {
      "OrderID": 11011,
      "OrderDate": "1998-04-09T00:00:00"
    }
  ]
}</pre><p>
<h3>Hide NULL Attribute Option</h3>
<p>There will be a time when you want to Hide NULL attribute rather than showing <strong>MyAttr: null</strong> this is also possible by checking Hide NULL Attribute Option on Options Tab.</p>
<h2>Export JSON to Amazon S3, Azure Blob, Secure FTP (SFTP / FTPS)</h2>
<p>Export JSON Task support some really good options to save file to other than local file system. If you want to export JSON directly to Amazon / Azure Cloud or FTP Server without saving to local disk then you can use Azure / FTP / Amazon Connection Manager on Target Tab of Export JSON Task. This option is only available for <strong>PRO Edition</strong> Users.</p>
<div style="width: 666px" class="wp-caption alignnone"><img loading="lazy" decoding="async" class="size-full" src="https://zappysys.com/onlinehelp/ssis-powerpack/scr/images/export-json-file-task/ssis-export-sql-tables-to-json-file-azure-blob-amazon-s3-secure-ftp-split-gzip-compress.png" alt="Export JSON / CSV / XML Files to Azure Blob, Amazon S3, Secure FTP Storage" width="656" height="440" /><p class="wp-caption-text">Export JSON / CSV / XML Files to Azure Blob, Amazon S3, Secure FTP Storage</p></div>
<h2>Conclusion</h2>
<p>If you want to output JSON from SQL Server or any other relational DB then its not simple task in SSIS specially when you have nested JSON documents (e.g. Customer-&gt;Orders). In this post you have seen how to use <a href="//zappysys.com/products/ssis-powerpack/ssis-export-json-file-task/">SSIS JSON Export Task</a> to generate nested JSON from multiple datasets.</p>
<p>The post <a href="https://zappysys.com/blog/export-json-from-sql-server-using-ssis/">5 Ways to Export JSON from SQL Server using SSIS</a> appeared first on <a href="https://zappysys.com/blog">ZappySys Blog</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
