<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Running SSIS packages from C#</title><link>http://sqlblog.com/blogs/piotr_rodak/archive/2012/04/09/running-ssis-packages-from-c.aspx</link><description>Most of the developers and DBAs know about two ways of deploying packages: You can deploy them to database server and run them using SQL Server Agent job or you can deploy the packages to file system and run them using dtexec.exe utility. Both approaches</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: Running SSIS packages from C#</title><link>http://sqlblog.com/blogs/piotr_rodak/archive/2012/04/09/running-ssis-packages-from-c.aspx#42755</link><pubDate>Tue, 10 Apr 2012 05:03:43 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:42755</guid><dc:creator>ashish</dc:creator><description>&lt;p&gt;Do we have option to run it asynchronously?..I mean do we have something like BeginExecute()?&lt;/p&gt;
</description></item><item><title>re: Running SSIS packages from C#</title><link>http://sqlblog.com/blogs/piotr_rodak/archive/2012/04/09/running-ssis-packages-from-c.aspx#42756</link><pubDate>Tue, 10 Apr 2012 07:17:14 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:42756</guid><dc:creator>Piotr Rodak</dc:creator><description>&lt;p&gt;Sure you can. Since the service runs as singleton, you can have whole asynchronous execution framework implemented. You just enqueue execution of the package into some sort of a queue and return. &lt;/p&gt;
</description></item><item><title>re: Running SSIS packages from C#</title><link>http://sqlblog.com/blogs/piotr_rodak/archive/2012/04/09/running-ssis-packages-from-c.aspx#45157</link><pubDate>Wed, 12 Sep 2012 12:55:50 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45157</guid><dc:creator>Sid</dc:creator><description>&lt;p&gt;This looks fantastic and I'm trying your sample but I've hit a problem and I don't readily see the solution. &amp;nbsp;I have the SSIS package working and it runs and creates a file if I run it through in Visual Studio but I can't get it to work from the service. &amp;nbsp;I'm getting this erorr from the console:&lt;/p&gt;
&lt;p&gt;Calling package ExportEmployees.dtsx with parameter 12.&lt;/p&gt;
&lt;p&gt;Microsoft.SqlServer.Dts.Runtime.DtsRuntimeException: The package failed to load&lt;/p&gt;
&lt;p&gt;due to error 0xC0011008 &amp;quot;Error loading from XML. No further detailed error infor&lt;/p&gt;
&lt;p&gt;mation can be specified for this problem because no Events object was passed whe&lt;/p&gt;
&lt;p&gt;re detailed error information can be stored.&amp;quot;. This occurs when CPackage::LoadFr&lt;/p&gt;
&lt;p&gt;omXML fails.&lt;/p&gt;
&lt;p&gt; ---&amp;gt; System.Runtime.InteropServices.COMException: The package failed to load du&lt;/p&gt;
&lt;p&gt;e to error 0xC0011008 &amp;quot;Error loading from XML. No further detailed error informa&lt;/p&gt;
&lt;p&gt;tion can be specified for this problem because no Events object was passed where&lt;/p&gt;
&lt;p&gt; detailed error information can be stored.&amp;quot;. This occurs when CPackage::LoadFrom&lt;/p&gt;
&lt;p&gt;XML fails.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.SqlServer.Dts.Runtime.Wrapper.ApplicationClass.LoadPackage(Strin&lt;/p&gt;
&lt;p&gt;g FileName, Boolean loadNeutral, IDTSEvents90 pEvents)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, I&lt;/p&gt;
&lt;p&gt;DTSEvents events, Boolean loadNeutral)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; --- End of inner exception stack trace ---&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, I&lt;/p&gt;
&lt;p&gt;DTSEvents events, Boolean loadNeutral)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at Microsoft.SqlServer.Dts.Runtime.Application.LoadPackage(String fileName, I&lt;/p&gt;
&lt;p&gt;DTSEvents events)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; at SSISRunner.PackRunner.RunPackage2(String name, Int32 rows) in L:\ZipStuff\&lt;/p&gt;
&lt;p&gt;ServiceETLDemo\SSISRunner\SSISRunner\Program.cs:line 118&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://localhost:8011/runpackwithparams?package=%22ExportEmployees.dtsx%22&amp;amp;rows="&gt;http://localhost:8011/runpackwithparams?package=%22ExportEmployees.dtsx%22&amp;amp;rows=&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;12&lt;/p&gt;
&lt;p&gt;I'm running everything locally on my workstation on which I'm an admin.&lt;/p&gt;
&lt;p&gt;I've probably missed something relatively simple but could you please help.&lt;/p&gt;
&lt;p&gt;Any help is greatly appreciated.&lt;/p&gt;
</description></item><item><title>re: Running SSIS packages from C#</title><link>http://sqlblog.com/blogs/piotr_rodak/archive/2012/04/09/running-ssis-packages-from-c.aspx#45166</link><pubDate>Wed, 12 Sep 2012 15:06:18 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:45166</guid><dc:creator>Sid</dc:creator><description>&lt;p&gt;Ok -- I got it &amp;nbsp;-- the console app references a 2005 library:&lt;/p&gt;
&lt;p&gt;C:\Program Files\Microsoft SQL Server\90\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll&lt;/p&gt;
&lt;p&gt;and I'm using a 2008 SSIS package so just switch the reference to the same dll in the \100 subdirectory and it works as expected.&lt;/p&gt;
&lt;p&gt;Sorry for the confusion,&lt;/p&gt;
&lt;p&gt;This article clarified it for me:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://sqlaj.wordpress.com/2010/01/12/t-sql-tuesday-002-a-puzzling-situation-the-package-failed-to-load-due-to-error-0xc0011008/"&gt;http://sqlaj.wordpress.com/2010/01/12/t-sql-tuesday-002-a-puzzling-situation-the-package-failed-to-load-due-to-error-0xc0011008/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;thanks again for this great article!!! &lt;/p&gt;
&lt;p&gt;My head is already spinning with ideas on how to apply this technology.&lt;/p&gt;
</description></item></channel></rss>