<?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>Samuel Haddad &#187; Overwrite Excel File</title> <atom:link href="http://samuelhaddad.com/tag/overwrite-excel-file/feed/" rel="self" type="application/rss+xml" /><link>http://samuelhaddad.com</link> <description></description> <lastBuildDate>Thu, 03 Nov 2011 16:32:38 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>Overwriting an Excel file destination using SSIS</title><link>http://samuelhaddad.com/2009/03/31/overwriting-an-excel-file-destination-using-ssis/</link> <comments>http://samuelhaddad.com/2009/03/31/overwriting-an-excel-file-destination-using-ssis/#comments</comments> <pubDate>Tue, 31 Mar 2009 23:57:57 +0000</pubDate> <dc:creator>Samuel Haddad</dc:creator> <category><![CDATA[Desktop Enginnering]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[SSIS]]></category> <category><![CDATA[Web Design]]></category> <category><![CDATA[Excel Destination]]></category> <category><![CDATA[Overwrite Excel File]]></category> <category><![CDATA[SQL]]></category> <category><![CDATA[SQL Server Integration Service]]></category> <guid
isPermaLink="false">http://samuelhaddad.com/?p=256</guid> <description><![CDATA[This was a problem I racked my brains over for a while when I first started using SSIS. I found a few possible including using a File System task to copy a &#8220;Template&#8221; Excel file over the existing on, or generating unique files by appending the date.  I simply wanted to overwrite the existing data [...]]]></description> <content:encoded><![CDATA[<p>This was a problem I racked my brains over for a while when I first started using SSIS. I found a few possible including using a File System task to copy a &#8220;Template&#8221; Excel file over the existing on, or generating unique files by appending the date.  I simply wanted to overwrite the existing data just like the <strong>Flat File Destination </strong>gives you that option.</p><p>My work around was as flows:</p><p>Create the Data flow the way you normally would, then go to the <strong>Control View </strong> Then add two <strong>Execute SQL Tasks </strong> before your data flow is called so it looks like this</p><div
id="attachment_257" class="wp-caption alignnone" style="width: 170px"><img
class="size-medium wp-image-257" title="Step 1: Add Execute SQL Task 1 to Control Flow" src="http://samuelhaddad.com/wp-content/uploads/2009/03/step1controlflow.png" alt="Step 1: Add Execute SQL Task 1 to Control Flow" width="160" height="257" /><p
class="wp-caption-text">Step 1: Add Execute SQL Task 1 to Control Flow</p></div><p>Set both <strong>Execute SQL Tasks </strong>to use the Excel file</p><div
id="attachment_258" class="wp-caption alignnone" style="width: 397px"><img
class="size-full wp-image-258" title="Step 2: Set Connection Manager" src="http://samuelhaddad.com/wp-content/uploads/2009/03/step2connectionmanager.png" alt="Step 2: Set Connection Manager" width="387" height="120" /><p
class="wp-caption-text">Step 2: Set Connection Manager</p></div><p>Set your first <strong>Execute SQL Task&#8217;s </strong>SQL Command drop your table which is also known as the sheet name of your Excel file.</p><div
id="attachment_259" class="wp-caption alignnone" style="width: 345px"><img
class="size-full wp-image-259" title="Step 3: Drop Table" src="http://samuelhaddad.com/wp-content/uploads/2009/03/step3droptable.png" alt="Step 3: Drop Table" width="335" height="335" /><p
class="wp-caption-text">Step 3: Drop Table</p></div><p>Repeat step 3 on the second <strong>Execute SQL Command </strong>this time create your tables.</p><p>That&#8217;s it. Good luck.</p> ]]></content:encoded> <wfw:commentRss>http://samuelhaddad.com/2009/03/31/overwriting-an-excel-file-destination-using-ssis/feed/</wfw:commentRss> <slash:comments>28</slash:comments> </item> </channel> </rss>
