<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">SSIS Team Blog</title><subtitle type="html">Helpful information and examples on how to use SQL Server Integration Services.</subtitle><id>http://blogs.msdn.com/mattm/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/mattm/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-04-08T08:48:10Z</updated><entry><title>Handling Slowly Changing Dimensions in SSIS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/11/13/handling-slowly-changing-dimensions-in-ssis.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/11/13/handling-slowly-changing-dimensions-in-ssis.aspx</id><published>2009-11-13T17:38:30Z</published><updated>2009-11-13T17:38:30Z</updated><content type="html">&lt;p&gt;I had a great time at &lt;a href="http://summit2009.sqlpass.org/"&gt;PASS&lt;/a&gt; last week, and had a chance to talk to a lot of different SSIS users. One of the big topics seemed to be Slowly Changing Dimensions – I had a number of people ask for various improvements to the current &lt;a href="http://msdn.microsoft.com/en-us/library/ms141715.aspx"&gt;Slowly Changing Dimension Transform&lt;/a&gt; in SSIS, and also ask for recommended alternatives in the meantime. I thought I’d summarize some of the more popular approaches I’ve seen, and see if anyone else has some alternatives. &lt;/p&gt;  &lt;h2&gt;Slowly Changing Dimension Wizard&lt;/h2&gt;  &lt;p&gt;You might have already tried the Slowly Changing Dimension Wizard that comes with SSIS 2005 and 2008 (and there are a number of good tutorials &lt;a href="http://www.mssqltips.com/tip.asp?tip=1442"&gt;out there&lt;/a&gt; if you haven’t). &lt;/p&gt;  &lt;p&gt;&lt;img alt="Outputs from the Slowly Changing Dimension Wizard" src="http://i.msdn.microsoft.com/ms141662.f8263eb5-71ff-43c0-9028-b1d7dc4374cd(en-us,SQL.100).gif" width="519" height="480" /&gt;&lt;/p&gt;  &lt;p&gt;The SCD Wizard has a few things going for it - it’s quick and easy to implement, it handles most SCD scenarios out of the box, and its multi-component approach means you can customize it with the functionality you need. &lt;/p&gt;  &lt;p&gt;It does have some pretty big limitations, however, which end up being a deal breaker for a lot of people.&lt;/p&gt;  &lt;p&gt;A major inhibitor is the performance of the transform. It doesn’t perform that well for a couple of different reasons:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The data lookups are not cached – each row results in a SQL Query&lt;/li&gt;    &lt;li&gt;OLE DB Command does row by row updates&lt;/li&gt;    &lt;li&gt;OLE DB Destination added by the wizard doesn’t use FastLoad by default (which can be easily changed in the OLE DB Destination editor UI)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Another downside to the transform is the “one way” nature of the wizard – running it again (to change columns, for example) means you’ll lose any customizations you might have made to the other transforms. &lt;/p&gt;  &lt;p&gt;I recommend using the wizard for simple dimensions, where you’re not processing a lot of data. If performance is a concern, consider one of the following approaches.&lt;/p&gt;  &lt;h2&gt;Using MERGE&lt;/h2&gt;  &lt;p&gt;I came across this tip from the &lt;a href="http://www.kimballgroup.com/"&gt;Kimball Group&lt;/a&gt; when I was putting together my Merge &amp;amp; CDC talk last year.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.kimballgroup.com/html/08dt/KU107_UsingSQL_MERGESlowlyChangingDimension.pdf"&gt;Using the SQL MERGE Statement for Slowly Changing Dimension Processing&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;In this approach, you write all of your incoming data to a staging table, and then use Execute SQL Tasks to run MERGE statements (you actually have to do two passes – one for Type 1 changes, and one for Type 2 – see the details in the tip above). I posted the &lt;a href="http://blogs.msdn.com/mattm/archive/2009/05/02/samples-for-the-cdc-merge-demo.aspx"&gt;sample packages and code I used in a previous blog post&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The performance in this approach is very good (although it moves the bulk of the work to the database machine, which might not be what you want). I recommend it if you don’t mind staging the data, writing custom SQL, or can’t use a 3rd party component in your environment.&lt;/p&gt;  &lt;h2&gt;Kimball Method SSIS Slowly Changing Dimension Component&lt;/h2&gt;  &lt;p&gt;I’ve heard great things about &lt;a href="http://toddmcdermid.blogspot.com/"&gt;Todd McDermid’s&lt;/a&gt; &lt;a href="http://kimballscd.codeplex.com/"&gt;custom SCD Transform&lt;/a&gt;. Instead of doing row by row lookups, this transform takes in the dimension as an input. This makes the comparison much faster than the stock SSIS version. It wraps up all of the functionality into a single transform, which is great if you’re following the Kimball methodology.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://8c0qtw.blu.livefilestore.com/y1p-ArSUduTw0F24ZRsXLSROd7vn1c2LS_gnQ6lKswEuKN1lJhKgnT0B5YpP0Sx-2LXjU0PhLxttU-3pOS_jdYR1Q/KimballSCD.jpg" /&gt;&lt;/p&gt;  &lt;h2&gt;Table Difference Component&lt;/h2&gt;  &lt;p&gt;I had the chance to meet with the &lt;a href="http://www.sqlbi.eu/"&gt;SQLBI.EU&lt;/a&gt; guys at PASS, and they mentioned their &lt;a href="http://www.sqlbi.eu/Projects/TableDifference/tabid/74/language/en-US/Default.aspx"&gt;Table Difference component&lt;/a&gt;. I haven’t tried it out myself, but I remembered an email from one of the SQL Rangers (Binh Cao) that suggested this component for SCD processing. I’ve included his write-up here:&lt;/p&gt;  &lt;p&gt;Table difference is an SSIS custom component designed to simplify the management of slowly changing dimensions and – in general – to check the differences between two tables or data flow with SSIS.&lt;/p&gt;  &lt;p&gt;The component receives input from two sorted sources and generates different outputs for unchanged, new, deleted or updated rows.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001" border="0" alt="clip_image001" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image001_3.jpg" width="460" height="236" /&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Unchanged rows (are the data rows that are the same in both inputs)&lt;/li&gt;    &lt;li&gt;Deleted rows (are the data rows that appear in old source but not in new source)&lt;/li&gt;    &lt;li&gt;New rows (are the data rows that appear in new source but not in old source)&lt;/li&gt;    &lt;li&gt;Updated rows (are the data rows that appear in both flows but something is changed)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The inputs MUST be sorted and have a collection of fields (keys) that let the component decide when two rows from the inputs represent the same row, but this is easily accomplished by SQL Server with a simple “order by” and a convenient index; moreover the SCD do normally maintain an index by the business key, so the sorting requirement is easily accomplished and do not represent a problem.&lt;/p&gt;  &lt;p&gt;Clicking on TableDifference control gives the following window.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002" border="0" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image002_3.jpg" width="307" height="356" /&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;TableDifference analyzes all the columns in both inputs and compares their names. If the name of two columns and their corresponding types are identical, TableDifference adds them to the available columns to manage.&lt;/p&gt;  &lt;p&gt;If the flows are sorted, their sort columns will be marked as key fields, using the same order in which they appear in the sort.&lt;/p&gt;  &lt;p&gt;All other columns are assigned a standard Update ID of 10 and are managed as comparable columns.&lt;/p&gt;  &lt;p&gt;Using the component editor, you need to provide the following information for the columns:&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Check Option&lt;/b&gt;: you can choose the column type between:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;b&gt;Key field&lt;/b&gt;:&amp;#160; column will be used to detect when two rows from the inputs represent the same row. Beware that the inputs must be sorted by those columns&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Compare&lt;/b&gt;:&amp;#160; column will be compared one by one to detect differences&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Prefer NEW&lt;/b&gt;: columns will be copied from the NEW input directly into the output, no check&lt;/li&gt;    &lt;li&gt;&lt;b&gt;Prefer OLD&lt;/b&gt;: columns will be copied from the OLD input directly into the output, no check&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;b&gt;KeyOrder&lt;/b&gt;: If a column is of type “Key Field” it is the order under which the field appear under the “order by” clause of your query. Beware that the component do not check for the correct sorting sequence, it is up to you to provide this information.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Update ID&lt;/b&gt;: Each different UpdateID creates a different output flow. If you need to detect when a change appears in some column you can use different update ID. Beware that the lowest update ID wins, i.e. if AccountNumber has update id of 10 and AddressLine1 has update id of 20, then Accountnumber will be checked first and if a change is detected, the row will go to update output 10, no matter if AddressLine has a difference.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image003_2.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003" border="0" alt="clip_image003" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image003_thumb.jpg" width="304" height="353" /&gt;&lt;/a&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Outputs Panel gives option to choose which output to enable as well as to name and describe the output.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004" border="0" alt="clip_image004" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image004_3.jpg" width="312" height="362" /&gt;&lt;u&gt;&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Output Details allows selection of the columns for each output.&amp;#160; Here columns that are not needed for an output can be disabled.&amp;#160; The picture shows an example of the DELETED output which only have the Customer Key column in its output.&amp;#160; The less columns in the output, the better the performance of the component.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image005" border="0" alt="clip_image005" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/HandlingSlowlyChangingDimensionsinSSIS_7EC2/clip_image005_3.jpg" width="334" height="388" /&gt;&lt;/p&gt;  &lt;p&gt;In the Misc Options tab, string comparisons definition can be defined:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;The culture ID to use to perform the comparison. If not specified TableDifference will use the culture ID of the running task. The default is “empty”.&lt;/li&gt;    &lt;li&gt;If you want it to ignore casing during string comparisons. The default is unchecked so TableDifference will perform comparison considering case.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;In the Warnings panel, it will list any unused column from the input. As you might recall, if two columns are not identical regarding name and type, TableDifference will ignore them. This might be an error but the decision is up to you. By checking the warnings panel you can see if TableDifference is working with all the columns you need it to compare. &lt;/p&gt;  &lt;p&gt;----&lt;/p&gt;  &lt;p&gt;Do you have any other SCD processing approaches you’d like to recommend?&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9922089" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Tutorial" scheme="http://blogs.msdn.com/mattm/archive/tags/Tutorial/default.aspx" /><category term="Data Warehousing" scheme="http://blogs.msdn.com/mattm/archive/tags/Data+Warehousing/default.aspx" /><category term="Slowly Changing Dimension" scheme="http://blogs.msdn.com/mattm/archive/tags/Slowly+Changing+Dimension/default.aspx" /></entry><entry><title>Something new for SSIS in SQL Server 2008 R2 November CTP</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/11/12/something-new-for-ssis-in-sql-server-2008-r2-november-ctp.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/11/12/something-new-for-ssis-in-sql-server-2008-r2-november-ctp.aspx</id><published>2009-11-12T19:29:27Z</published><updated>2009-11-12T19:29:27Z</updated><content type="html">&lt;p&gt;Ok, so it turns my &lt;a href="http://blogs.msdn.com/mattm/archive/2009/08/14/no-new-features-in-for-integration-services-in-sql-server-2008-r2.aspx"&gt;previous post about R2&lt;/a&gt; wasn’t entirely correct. &lt;/p&gt;  &lt;p&gt;SSIS does have one new feature which appears in the &lt;a href="http://www.microsoft.com/sqlserver/2008/en/us/R2.aspx"&gt;latest SQL Server 2008 R2 CTP&lt;/a&gt;. If you open up the ADO.NET Destination UI, you’ll notice a new “Use Bulk Insert when Possible” check box.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/SomethingnewforSSISinSQLServer2008R2Nove_956B/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.msdn.com/blogfiles/mattm/WindowsLiveWriter/SomethingnewforSSISinSQLServer2008R2Nove_956B/image_thumb_1.png" width="556" height="480" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Previously, the ADO.NET Destination did all of its inserts row by row (we do some batching internally, which is why the component has a BatchSize property, but the underlying ADO.NET provider will always do single row inserts). With this new feature enabled, SSIS will use a bulk insert interface (like enabling “FastLoad” for OLEDB Destination). Unfortunately, there isn’t a generic Bulk Load interface for ADO.NET, so this functionality is currently only supported by SQL Server (through the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"&gt;SqlBulkCopy&lt;/a&gt; API). Hopefully we can extend support to other ADO.NET providers in the future.&lt;/p&gt;  &lt;p&gt;The main reason for implementing this functionality was to improve our support for &lt;a href="http://www.microsoft.com/windowsazure/sqlazure/"&gt;SQL Azure&lt;/a&gt;. As you might already know, ADO.NET is the primary way to communicate with SQL Azure, and adding support for SqlBulkCopy greatly increased the transfer speed. It also speeds up things when you’re working with regular SQL Server systems -- although OLEDB with FastLoad is still the preferred way of doing SQL data loads. &lt;/p&gt;  &lt;p&gt;Be sure to try it out and &lt;a href="http://connect.microsoft.com/"&gt;provide feedback&lt;/a&gt; before the final release.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9921536" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="SSIS" scheme="http://blogs.msdn.com/mattm/archive/tags/SSIS/default.aspx" /><category term="Connectivity" scheme="http://blogs.msdn.com/mattm/archive/tags/Connectivity/default.aspx" /><category term="ADO.Net" scheme="http://blogs.msdn.com/mattm/archive/tags/ADO.Net/default.aspx" /><category term="SSDS" scheme="http://blogs.msdn.com/mattm/archive/tags/SSDS/default.aspx" /></entry><entry><title>2009 PASS Summit next week</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/10/29/2009-pass-summit-next-week.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/10/29/2009-pass-summit-next-week.aspx</id><published>2009-10-29T19:01:49Z</published><updated>2009-10-29T19:01:49Z</updated><content type="html">&lt;p&gt;I’m really looking forward to &lt;a href="http://summit2009.sqlpass.org/"&gt;attending PASS&lt;/a&gt; next week!&lt;/p&gt;  &lt;p&gt;I’ll be presenting two separate talks this time around:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/MaximizeYourSSISInvestmentwithTuningTricksa.aspx"&gt;Maximize Your SSIS Investment with Tuning Tricks and Tips&lt;/a&gt; &lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Session Details&lt;/strong&gt;&lt;/p&gt;    &lt;p&gt;Maximize the performance of your packages with this set of best practices and data flow tuning techniques. We'll show you how to improve the operational efficiency of various Integration Services connectors, and take a look at how to efficiently load your data warehouse solutions.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This is basically a talk about how to get good performance from SSIS without having to invest too much time and effort. I’ll talk about “smart package design”, how to effectively introduce parallelism, and then jump into some of the easier tuning tweaks you can do in your packages. &lt;/p&gt;  &lt;p&gt;Originally this talk was scheduled as one of the first sessions on Tuesday, which made it a very good segue for Thomas Kejser’s SQLCAT chalk talk on &lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/ChalkTalkSQLCATTuningETLandELT.aspx"&gt;Tuning ETL and ELT&lt;/a&gt;. It looks like my session was moved to Thursday in the latest PASS schedule, which means I’ll be presenting after he does. I think both sessions are a good compliment to each other - While mine focuses on package design, Thomas takes a more scientific approach to performance tuning, with a pretty deep dive on SQL Server optimization. If you’re interested in performance, I highly recommend attending both sessions (there shouldn’t be much overlap). &lt;/p&gt;  &lt;p&gt;My other session is a Chalk Talk that I’ll be co-presenting with John Welch.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;b&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/ChalkTalkMetadataDrivenETLCreatingDynamic.aspx"&gt;Metadata Driven ETL - Creating Dynamic Packages with Integration Services&lt;/a&gt;&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;&lt;b&gt;Session Details&lt;/b&gt;&lt;/p&gt;    &lt;p&gt;Schema changes got you down? Tired of hand coding your SSIS packages for a ton of different data sources? Come see this session where we'll focus on the requirements for metadata driven ETL, and how you can build your own dynamic package generation framework using the SSIS object model. We'll talk about some of SSIS package frameworks currently used in-house at Microsoft, how to automate and test your packages, and about the open-source resources available online.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;I’ll be at the SSIS booth and Ask the Experts areas throughout the conference, so be sure to come by and say hello.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9914884" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Conferences" scheme="http://blogs.msdn.com/mattm/archive/tags/Conferences/default.aspx" /></entry><entry><title>No new features in for Integration Services in SQL Server 2008 R2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/08/14/no-new-features-in-for-integration-services-in-sql-server-2008-r2.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/08/14/no-new-features-in-for-integration-services-in-sql-server-2008-r2.aspx</id><published>2009-08-14T22:20:00Z</published><updated>2009-08-14T22:20:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Update 2009-11-12&lt;/STRONG&gt;: &lt;/EM&gt;&lt;A href="http://blogs.msdn.com/mattm/archive/2009/11/12/something-new-for-ssis-in-sql-server-2008-r2-november-ctp.aspx" mce_href="http://blogs.msdn.com/mattm/archive/2009/11/12/something-new-for-ssis-in-sql-server-2008-r2-november-ctp.aspx"&gt;&lt;EM&gt;One&amp;nbsp;minor&amp;nbsp;feature change announced&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Have you been holding your breath waiting for Microsoft to announce the new SSIS features for &lt;A href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx" mce_href="http://www.microsoft.com/sqlserver/2008/en/us/r2.aspx"&gt;SQL Server 2008 R2&lt;/A&gt;? &lt;/P&gt;
&lt;P&gt;The answer is pretty simple – nothing new is being added for SSIS in R2. There will be some small bug fixes, but these will also be available in a Cumulative Update / Service Pack release for 2008. R2 is a target release for the &lt;A href="http://www.microsoft.com/sqlserver/2008/en/us/R2-SSBI.aspx" mce_href="http://www.microsoft.com/sqlserver/2008/en/us/R2-SSBI.aspx"&gt;Self-Service BI&lt;/A&gt; market, with some other engine and tools enhancements included. From a &lt;A href="http://www.microsoft.com/sqlserver/2008/en/us/R2-self-service-BI.aspx" mce_href="http://www.microsoft.com/sqlserver/2008/en/us/R2-self-service-BI.aspx"&gt;SQL BI point of view&lt;/A&gt;, the release is mostly about &lt;A href="http://www.microsoft.com/global/sqlserver/2008/en/us/PublishingImages/GeminiDashboard.jpg" mce_href="http://www.microsoft.com/global/sqlserver/2008/en/us/PublishingImages/GeminiDashboard.jpg"&gt;Project Gemini&lt;/A&gt;, Master Data Management, and some cool enhancements to Reporting Services.&lt;/P&gt;
&lt;P&gt;Instead of R2, we’ve been focused on the next major SQL Server release - we decided early on that splitting our effort to deliver some new features in R2 would end up diluting the overall value of what we eventually ship. We’ve been hard at work the past little while, and in fact, we’re currently wrapping up our first wave of improvements. It’s a bit too early for us to publically start talking about what we have planned, but I can say that it’s pretty big, and the feedback we’ve received so far is very promising. &lt;/P&gt;
&lt;P&gt;I’m really looking forward to when we can start giving demos of the new stuff at conferences... I’ll be sharing all of the details here as soon as I can!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9870628" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author></entry><entry><title>SQL PASS 2009</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/08/12/sql-pass-2009.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/08/12/sql-pass-2009.aspx</id><published>2009-08-12T18:39:21Z</published><updated>2009-08-12T18:39:21Z</updated><content type="html">&lt;p&gt;I was just &lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions.aspx"&gt;looking at the sessions&lt;/a&gt; for the &lt;a href="http://summit2009.sqlpass.org"&gt;SQL PASS 2009 Summit&lt;/a&gt; and was happy to see so many SSIS presentations on the list!&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="776" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="136"&gt;&lt;a href="http://www.sqlpass.org/Community/PASSPort.aspx?ProfileID=33222"&gt;Andy Leonard&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/AppliedSSISDesignPatterns.aspx"&gt;Applied SSIS Design Patterns&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;&lt;a href="http://www.sqlpass.org/Community/PASSPort.aspx?ProfileID=33010"&gt;Steve Simon&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/SQLServerIntegrationServicesandthemodern.aspx"&gt;SQL Server Integration Services and the modern financial institution&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;&lt;a href="http://www.sqlpass.org/Community/PASSPort.aspx?ProfileID=33076"&gt;Davide Mauri&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/InstrumentingMonitoringandAuditingofSSISETL.aspx"&gt;Instrumenting, Monitoring and Auditing of SSIS ETL Solutions&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;&lt;a href="http://www.sqlpass.org/Community/PASSPort.aspx?ProfileID=15217"&gt;Brian Knight&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/LoadingaDataWarehousewithSSIS.aspx"&gt;Loading a Data Warehouse with SSIS&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;&lt;a href="http://www.sqlpass.org/Community/PASSPort.aspx?ProfileID=105"&gt;Dave Fackler&lt;/a&gt;&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/ETLfromtheTrenchesUsingSSISintheRealWorl.aspx"&gt;ETL from the Trenches: Using SSIS in the Real World&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;Joy Mundy&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/ETLTheLinchpinfortheCompleteDataWarehouse.aspx"&gt;ETL: The Linchpin for the Complete Data Warehouse&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="136"&gt;Erik Veerman&lt;/td&gt;        &lt;td valign="top" width="638"&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/ProgramSessions/OvercomingSSISDeploymentandConfigurationChall.aspx"&gt;Overcoming SSIS Deployment and Configuration Challenges&lt;/a&gt;          &lt;br /&gt;&lt;a href="http://summit2009.sqlpass.org/Agenda/SpotlightSessions/DataProfilingandCleansingwithIntegrationServ.aspx"&gt;Data Profiling and Cleansing with Integration Services 2008&lt;/a&gt;&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;In addition to these SSIS specific topics, it looked like there were a lot of other data warehousing / BI best practices talks that looked like they touched on SSIS as well. &lt;/p&gt;  &lt;p&gt;I’ll be presenting a session entitled &lt;a href="http://www.softconference.com/PASS/ProgramSessions/2009/default.asp?SID=172859"&gt;Maximize Your SSIS Investment With Tuning Tricks and Tips&lt;/a&gt;, and I found out earlier this week that I might also get the chance to host a chalk talk on metadata driven ETL. And of course, members of the SSIS team will be in the pavilion / Ask the Experts area throughout the conference, so be sure to come by and say hello. &lt;/p&gt;  &lt;p&gt;&lt;img height="160" alt="" src="http://summit2009.sqlpass.org/Portals/0/Summit2009_750x160.gif" width="750" /&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9866599" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author></entry><entry><title>Looking up SSIS HResult / COMException ErrorCode</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/08/03/looking-up-ssis-hresult-comexception-errorcode.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/08/03/looking-up-ssis-hresult-comexception-errorcode.aspx</id><published>2009-08-04T07:21:02Z</published><updated>2009-08-04T07:21:02Z</updated><content type="html">&lt;p&gt;The method I describe in &lt;a href="http://blogs.msdn.com/mattm/archive/2009/08/03/debugging-a-comexception-during-package-generation.aspx"&gt;my post about handling COMExceptions during package generation&lt;/a&gt; works if you have control over the package generation code, but sometimes you’ll be using third party libraries, or debugging after the fact. &lt;/p&gt;  &lt;p&gt;Note, the error codes, symbolic names, and descriptions for all of the SSIS HResults can all be found on the &lt;a href="http://msdn.microsoft.com/en-us/library/ms345164.aspx"&gt;Integration Services Error and Message Reference&lt;/a&gt; page in Books Online. This should be your first stop if you want to quickly (and manually) lookup an SSIS error code. &lt;/p&gt;  &lt;p&gt;However, if you want to do this programmatically…&lt;/p&gt;  &lt;p&gt;The symbolic name for each SSIS error is slightly more useful than the hex error code value, and will sometimes be enough for you to isolate your problem right away. You can programmatically determine the symbolic name by comparing the error code value against the members of the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.hresults_members.aspx"&gt;HResults&lt;/a&gt; class.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public static string &lt;/span&gt;GetSymbolicName(&lt;span style="color: blue"&gt;int &lt;/span&gt;errorCode)
{
    &lt;span style="color: blue"&gt;string &lt;/span&gt;symbolicName = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty;
    &lt;span style="color: #2b91af"&gt;HResults &lt;/span&gt;hresults = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HResults&lt;/span&gt;();

    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;FieldInfo &lt;/span&gt;fieldInfo &lt;span style="color: blue"&gt;in &lt;/span&gt;hresults.GetType().GetFields())
    {
        &lt;span style="color: blue"&gt;if &lt;/span&gt;((&lt;span style="color: blue"&gt;int&lt;/span&gt;)fieldInfo.GetValue(hresults) == errorCode)
        {
            symbolicName = fieldInfo.Name;
            &lt;span style="color: blue"&gt;break&lt;/span&gt;;
        }
    }

    &lt;span style="color: blue"&gt;return &lt;/span&gt;symbolicName;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;I could use this function in a try/catch block to give the user additional information as to why the error occurred.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;catch &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;COMException &lt;/span&gt;ex)
{
    &lt;span style="color: blue"&gt;string &lt;/span&gt;symbolicName = GetSymbolicName(ex.ErrorCode);
    &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;Symbolic Name: {0}&amp;quot;&lt;/span&gt;, symbolicName);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Retrieving the actual error message for a given SSIS HResult is a little more involved. We can use the &lt;a href="http://msdn.microsoft.com/en-us/library/ms679351(VS.85).aspx"&gt;FormatMessage&lt;/a&gt; API to pull the message directly out of the dtsmsg100.dll (in 2005, it’s dtsmsg.dll). To do this, we’ll need to expose a couple of native methods so we can pinvoke them.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods
&lt;/span&gt;{
    [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: blue"&gt;public static extern &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;LoadLibrary(&lt;span style="color: blue"&gt;string &lt;/span&gt;dllToLoad);

    [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: blue"&gt;public static extern bool &lt;/span&gt;FreeLibrary(&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;hModule);

    [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Kernel32.dll&amp;quot;&lt;/span&gt;, SetLastError = &lt;span style="color: blue"&gt;true&lt;/span&gt;)]
    &lt;span style="color: blue"&gt;public static extern uint &lt;/span&gt;FormatMessage(&lt;span style="color: blue"&gt;uint &lt;/span&gt;dwFlags, &lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpSource,
       &lt;span style="color: blue"&gt;uint &lt;/span&gt;dwMessageId, &lt;span style="color: blue"&gt;uint &lt;/span&gt;dwLanguageId, &lt;span style="color: blue"&gt;ref &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpBuffer,
       &lt;span style="color: blue"&gt;uint &lt;/span&gt;nSize, &lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;pArguments);

    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_ALLOCATE_BUFFER = 256;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_IGNORE_INSERTS = 512;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_STRING = 1024;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_HMODULE = 2048;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_SYSTEM = 4096;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192;
    &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_MAX_WIDTH_MASK = 255;
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;First we’ll get a handle to dtsmsg100.dll using &lt;a href="http://msdn.microsoft.com/en-us/library/ms684175(VS.85).aspx"&gt;LoadLibrary&lt;/a&gt;:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;handle = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.LoadLibrary(&lt;span style="color: #a31515"&gt;&amp;quot;dtsmsg100.dll&amp;quot;&lt;/span&gt;);
&lt;span style="color: blue"&gt;if &lt;/span&gt;(handle == &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero)
{
    &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Couldn't open library dtsmsg100.dll&amp;quot;&lt;/span&gt;);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Then we’ll call &lt;a href="http://msdn.microsoft.com/en-us/library/ms679351(VS.85).aspx"&gt;FormatMessage&lt;/a&gt;. The first parameter is a set of flags – we’ll want the native method to do the allocation, the messages to be loaded from a specific DLL (dtsmsg), and we don’t want to do any parameter substitution.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;const int &lt;/span&gt;FormatMessageFlags = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_ALLOCATE_BUFFER | &lt;span style="color: green"&gt;// FormatMessage will allocate buffer
                               &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_FROM_HMODULE |    &lt;span style="color: green"&gt;// Messages are loaded from specified DLL
                               &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_IGNORE_INSERTS;   &lt;span style="color: green"&gt;// Don't perform place holder substitutions&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpMsgBuf = &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero;
&lt;span style="color: blue"&gt;uint &lt;/span&gt;dwChars = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FormatMessage(
                    FormatMessageFlags,
                    handle,                 &lt;span style="color: green"&gt;// handle to error message dll
                    &lt;/span&gt;errorCode,              &lt;span style="color: green"&gt;// error code we're looking up
                    &lt;/span&gt;0,                      &lt;span style="color: green"&gt;// 0 for default language
                    &lt;/span&gt;&lt;span style="color: blue"&gt;ref &lt;/span&gt;lpMsgBuf,           &lt;span style="color: green"&gt;// message buffer
                    &lt;/span&gt;2048,                   &lt;span style="color: green"&gt;// max size of message buffer
                    &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero);           &lt;span style="color: green"&gt;// substitution arguments

&lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(dwChars == 0)
{
    &lt;span style="color: green"&gt;// FormatMessage will set LastError
    &lt;/span&gt;&lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Win32Exception&lt;/span&gt;();
}

&lt;span style="color: blue"&gt;string &lt;/span&gt;sMessage = &lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.PtrToStringAnsi(lpMsgBuf);

&lt;span style="color: green"&gt;// Free the buffer
&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.FreeHGlobal(lpMsgBuf);&lt;/pre&gt;

&lt;p&gt;Once we have the error message, we can release the handle to dtsmsg using &lt;a href="http://msdn.microsoft.com/en-us/library/ms683152(VS.85).aspx"&gt;FreeLibrary&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Using the same scenario from my &lt;a href="http://blogs.msdn.com/mattm/archive/2009/08/03/debugging-a-comexception-during-package-generation.aspx"&gt;previous post&lt;/a&gt;, getting a COMException off a call to AcquireConnection() gives me an HResult of 0xC020801C. Programmatically retrieving the error message gives me this:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.&amp;#160; The AcquireConnection method call to the connection manager &amp;quot;&lt;strong&gt;%1&lt;/strong&gt;&amp;quot; failed with error code 0x&lt;strong&gt;%2!8.8X!&lt;/strong&gt;.&amp;#160; There may be error messages posted before this with more information on why the AcquireConnection method call failed.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Notice the format placeholders (%1 and %2!8.8X!) weren’t filled in. This is because we used the FORMAT_MESSAGE_IGNORE_INSERTS flag on FormatMessage – we wouldn’t have known what values to put in there, since we weren’t the ones that raised the original exception.&lt;/p&gt;

&lt;p&gt;I’ve encapsulated all of this logic in the HResultsHelper class. I’ve included the full code listing (including a CreatePackage method from previous API posts) here.&lt;/p&gt;

&lt;p&gt;-------&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;using &lt;/span&gt;System;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Collections.Generic;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Linq;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Text;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.SqlServer.Dts.Runtime;
&lt;span style="color: blue"&gt;using &lt;/span&gt;Microsoft.SqlServer.Dts.Pipeline.Wrapper;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Runtime.InteropServices;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.ComponentModel;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Globalization;
&lt;span style="color: blue"&gt;using &lt;/span&gt;System.Reflection;

&lt;span style="color: blue"&gt;namespace &lt;/span&gt;ErrorMsgFromHResult
{
    &lt;span style="color: blue"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HResultHelper &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IDisposable
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;const string &lt;/span&gt;MessageDLL = &lt;span style="color: #a31515"&gt;@&amp;quot;dtsmsg100.dll&amp;quot;&lt;/span&gt;;

        &lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;handle = &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero;
        &lt;span style="color: blue"&gt;bool &lt;/span&gt;disposed;
        &lt;span style="color: blue"&gt;const int &lt;/span&gt;FormatMessageFlags = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_ALLOCATE_BUFFER | &lt;span style="color: green"&gt;// FormatMessage will allocate buffer
                                       &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_FROM_HMODULE |    &lt;span style="color: green"&gt;// Messages are loaded from specified DLL
                                       &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FORMAT_MESSAGE_IGNORE_INSERTS;   &lt;span style="color: green"&gt;// Don't perform place holder substitutions

        &lt;/span&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;HResultHelper()
        {
            &lt;span style="color: green"&gt;// Load the DLL we'll get the error messages from
            &lt;/span&gt;handle = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.LoadLibrary(MessageDLL);
            &lt;span style="color: blue"&gt;if &lt;/span&gt;(handle == &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero)
            {
                &lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(&lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #2b91af"&gt;CultureInfo&lt;/span&gt;.CurrentCulture, &lt;span style="color: #a31515"&gt;&amp;quot;Couldn't open library: {0}&amp;quot;&lt;/span&gt;, MessageDLL));
            }
        }

        &lt;span style="color: blue"&gt;public string &lt;/span&gt;GetErrorMessage(&lt;span style="color: #2b91af"&gt;COMException &lt;/span&gt;comException)
        {
            &lt;span style="color: blue"&gt;return &lt;/span&gt;GetErrorMessage((&lt;span style="color: blue"&gt;uint&lt;/span&gt;)comException.ErrorCode);
        }

        &lt;span style="color: blue"&gt;public string &lt;/span&gt;GetErrorMessage(&lt;span style="color: blue"&gt;uint &lt;/span&gt;errorCode)
        {
            &lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpMsgBuf = &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero;
            &lt;span style="color: blue"&gt;uint &lt;/span&gt;dwChars = &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FormatMessage(
                                FormatMessageFlags,
                                handle,                 &lt;span style="color: green"&gt;// handle to error message dll
                                &lt;/span&gt;errorCode,              &lt;span style="color: green"&gt;// error code we're looking up
                                &lt;/span&gt;0,                      &lt;span style="color: green"&gt;// 0 for default language
                                &lt;/span&gt;&lt;span style="color: blue"&gt;ref &lt;/span&gt;lpMsgBuf,           &lt;span style="color: green"&gt;// message buffer
                                &lt;/span&gt;2048,                   &lt;span style="color: green"&gt;// max size of message buffer
                                &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero);           &lt;span style="color: green"&gt;// substitution arguments

            &lt;/span&gt;&lt;span style="color: blue"&gt;if &lt;/span&gt;(dwChars == 0)
            {
                &lt;span style="color: green"&gt;// FormatMessage will set LastError
                &lt;/span&gt;&lt;span style="color: blue"&gt;throw new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Win32Exception&lt;/span&gt;();
            }

            &lt;span style="color: blue"&gt;string &lt;/span&gt;sRet = &lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.PtrToStringAnsi(lpMsgBuf);

            &lt;span style="color: green"&gt;// Free the buffer
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Marshal&lt;/span&gt;.FreeHGlobal(lpMsgBuf);

            &lt;span style="color: blue"&gt;return &lt;/span&gt;sRet;
        }

        &lt;span style="color: blue"&gt;public void &lt;/span&gt;Dispose()
        {
            Dispose(&lt;span style="color: blue"&gt;true&lt;/span&gt;);
            &lt;span style="color: #2b91af"&gt;GC&lt;/span&gt;.SuppressFinalize(&lt;span style="color: blue"&gt;this&lt;/span&gt;);
        }

        &lt;span style="color: blue"&gt;private void &lt;/span&gt;Dispose(&lt;span style="color: blue"&gt;bool &lt;/span&gt;disposing)
        {
            &lt;span style="color: blue"&gt;if&lt;/span&gt;(!&lt;span style="color: blue"&gt;this&lt;/span&gt;.disposed)
            {
                &lt;span style="color: #2b91af"&gt;NativeMethods&lt;/span&gt;.FreeLibrary(handle);
                handle = &lt;span style="color: #2b91af"&gt;IntPtr&lt;/span&gt;.Zero;
                disposed = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
            }
        }

        ~HResultHelper()
        {
            Dispose(&lt;span style="color: blue"&gt;false&lt;/span&gt;);
        }

        &lt;span style="color: blue"&gt;static class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;NativeMethods
        &lt;/span&gt;{
            [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;)]
            &lt;span style="color: blue"&gt;public static extern &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;LoadLibrary(&lt;span style="color: blue"&gt;string &lt;/span&gt;dllToLoad);

            [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;kernel32.dll&amp;quot;&lt;/span&gt;)]
            &lt;span style="color: blue"&gt;public static extern bool &lt;/span&gt;FreeLibrary(&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;hModule);

            [&lt;span style="color: #2b91af"&gt;DllImport&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Kernel32.dll&amp;quot;&lt;/span&gt;, SetLastError = &lt;span style="color: blue"&gt;true&lt;/span&gt;)]
            &lt;span style="color: blue"&gt;public static extern uint &lt;/span&gt;FormatMessage(&lt;span style="color: blue"&gt;uint &lt;/span&gt;dwFlags, &lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpSource,
               &lt;span style="color: blue"&gt;uint &lt;/span&gt;dwMessageId, &lt;span style="color: blue"&gt;uint &lt;/span&gt;dwLanguageId, &lt;span style="color: blue"&gt;ref &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;lpBuffer,
               &lt;span style="color: blue"&gt;uint &lt;/span&gt;nSize, &lt;span style="color: #2b91af"&gt;IntPtr &lt;/span&gt;pArguments);

            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_ALLOCATE_BUFFER = 256;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_IGNORE_INSERTS = 512;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_STRING = 1024;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_HMODULE = 2048;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_FROM_SYSTEM = 4096;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192;
            &lt;span style="color: blue"&gt;public const int &lt;/span&gt;FORMAT_MESSAGE_MAX_WIDTH_MASK = 255;
        }
    }


    &lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Program
    &lt;/span&gt;{
        &lt;span style="color: blue"&gt;static void &lt;/span&gt;Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)
        {
            &lt;span style="color: #2b91af"&gt;HResultHelper &lt;/span&gt;helper = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;HResultHelper&lt;/span&gt;();

            &lt;span style="color: blue"&gt;try
            &lt;/span&gt;{
                CreatePackage();
            }
            &lt;span style="color: blue"&gt;catch &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;COMException &lt;/span&gt;ex)
            {
                &lt;span style="color: blue"&gt;string &lt;/span&gt;errorMessage = helper.GetErrorMessage(ex);
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(errorMessage);
            }

            helper.Dispose();
        }

        &lt;span style="color: blue"&gt;static &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Package &lt;/span&gt;CreatePackage()
        {
            &lt;span style="color: #2b91af"&gt;Package &lt;/span&gt;package = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Package&lt;/span&gt;();

            &lt;span style="color: green"&gt;// Add Data Flow Task
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Executable &lt;/span&gt;dataFlowTask = package.Executables.Add(&lt;span style="color: #a31515"&gt;&amp;quot;STOCK:PipelineTask&amp;quot;&lt;/span&gt;);

            &lt;span style="color: green"&gt;// Set the name (otherwise it will be a random GUID value)
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TaskHost &lt;/span&gt;taskHost = dataFlowTask &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TaskHost&lt;/span&gt;;
            taskHost.Name = &lt;span style="color: #a31515"&gt;&amp;quot;Data Flow Task&amp;quot;&lt;/span&gt;;

            &lt;span style="color: green"&gt;// We need a reference to the InnerObject to add items to the data flow
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MainPipe &lt;/span&gt;pipeline = taskHost.InnerObject &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MainPipe&lt;/span&gt;;

            &lt;span style="color: green"&gt;// Set the IDTSComponentEvent handler to capture the details from any 
            // COMExceptions raised during package generation
            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler &lt;/span&gt;events = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler&lt;/span&gt;();
            pipeline.Events = &lt;span style="color: #2b91af"&gt;DtsConvert&lt;/span&gt;.GetExtendedInterface(events &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSComponentEvents&lt;/span&gt;);

            &lt;span style="color: green"&gt;//
            // Add connection manager
            //

            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ConnectionManager &lt;/span&gt;connection = package.Connections.Add(&lt;span style="color: #a31515"&gt;&amp;quot;OLEDB&amp;quot;&lt;/span&gt;);
            connection.Name = &lt;span style="color: #a31515"&gt;&amp;quot;localhost&amp;quot;&lt;/span&gt;;
            connection.ConnectionString = &lt;span style="color: #a31515"&gt;&amp;quot;Data Source=localhost;Initial Catalog=AdventureWorksDW2008;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Connect Timeout=1&amp;quot;&lt;/span&gt;;

            &lt;span style="color: green"&gt;//
            // Add OLEDB Source
            //

            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSComponentMetaData100 &lt;/span&gt;srcComponent = pipeline.ComponentMetaDataCollection.New();
            srcComponent.ComponentClassID = &lt;span style="color: #a31515"&gt;&amp;quot;DTSAdapter.OleDbSource&amp;quot;&lt;/span&gt;;
            srcComponent.ValidateExternalMetadata = &lt;span style="color: blue"&gt;true&lt;/span&gt;;
            &lt;span style="color: #2b91af"&gt;IDTSDesigntimeComponent100 &lt;/span&gt;srcDesignTimeComponent = srcComponent.Instantiate();
            srcDesignTimeComponent.ProvideComponentProperties();
            srcComponent.Name = &lt;span style="color: #a31515"&gt;&amp;quot;OleDb Source&amp;quot;&lt;/span&gt;;

            &lt;span style="color: green"&gt;// Configure it to read from the given table
            &lt;/span&gt;srcDesignTimeComponent.SetComponentProperty(&lt;span style="color: #a31515"&gt;&amp;quot;AccessMode&amp;quot;&lt;/span&gt;, 0);
            srcDesignTimeComponent.SetComponentProperty(&lt;span style="color: #a31515"&gt;&amp;quot;OpenRowset&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;[DimCustomer]&amp;quot;&lt;/span&gt;);

            &lt;span style="color: green"&gt;// Set the connection manager
            &lt;/span&gt;srcComponent.RuntimeConnectionCollection[0].ConnectionManager = &lt;span style="color: #2b91af"&gt;DtsConvert&lt;/span&gt;.GetExtendedInterface(connection);
            srcComponent.RuntimeConnectionCollection[0].ConnectionManagerID = connection.ID;

            &lt;span style="color: green"&gt;// Retrieve the column metadata
            &lt;/span&gt;srcDesignTimeComponent.AcquireConnections(&lt;span style="color: blue"&gt;null&lt;/span&gt;);
            srcDesignTimeComponent.ReinitializeMetaData();
            srcDesignTimeComponent.ReleaseConnections();

            &lt;span style="color: green"&gt;//
            // Add OLEDB Destination
            //

            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSComponentMetaData100 &lt;/span&gt;destComponent = pipeline.ComponentMetaDataCollection.New();
            destComponent.ComponentClassID = &lt;span style="color: #a31515"&gt;&amp;quot;DTSAdapter.OleDbDestination&amp;quot;&lt;/span&gt;;
            destComponent.ValidateExternalMetadata = &lt;span style="color: blue"&gt;true&lt;/span&gt;;

            &lt;span style="color: #2b91af"&gt;IDTSDesigntimeComponent100 &lt;/span&gt;destDesignTimeComponent = destComponent.Instantiate();
            destDesignTimeComponent.ProvideComponentProperties();
            destComponent.Name = &lt;span style="color: #a31515"&gt;&amp;quot;OleDb Destination&amp;quot;&lt;/span&gt;;

            destDesignTimeComponent.SetComponentProperty(&lt;span style="color: #a31515"&gt;&amp;quot;AccessMode&amp;quot;&lt;/span&gt;, 3);
            destDesignTimeComponent.SetComponentProperty(&lt;span style="color: #a31515"&gt;&amp;quot;OpenRowset&amp;quot;&lt;/span&gt;, &lt;span style="color: #a31515"&gt;&amp;quot;[DimCustomer_Copy]&amp;quot;&lt;/span&gt;);

            &lt;span style="color: green"&gt;// set connection
            &lt;/span&gt;destComponent.RuntimeConnectionCollection[0].ConnectionManager = &lt;span style="color: #2b91af"&gt;DtsConvert&lt;/span&gt;.GetExtendedInterface(connection);
            destComponent.RuntimeConnectionCollection[0].ConnectionManagerID = connection.ID;

            &lt;span style="color: green"&gt;// get metadata
            &lt;/span&gt;destDesignTimeComponent.AcquireConnections(&lt;span style="color: blue"&gt;null&lt;/span&gt;);
            destDesignTimeComponent.ReinitializeMetaData();
            destDesignTimeComponent.ReleaseConnections();

            &lt;span style="color: green"&gt;//
            // Connect source and destination
            //

            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSPath100 &lt;/span&gt;path = pipeline.PathCollection.New();
            path.AttachPathAndPropagateNotifications(srcComponent.OutputCollection[0], destComponent.InputCollection[0]);

            &lt;span style="color: green"&gt;//
            // Configure the destination
            // 

            &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSInput100 &lt;/span&gt;destInput = destComponent.InputCollection[0];
            &lt;span style="color: #2b91af"&gt;IDTSVirtualInput100 &lt;/span&gt;destVirInput = destInput.GetVirtualInput();
            &lt;span style="color: #2b91af"&gt;IDTSInputColumnCollection100 &lt;/span&gt;destInputCols = destInput.InputColumnCollection;
            &lt;span style="color: #2b91af"&gt;IDTSExternalMetadataColumnCollection100 &lt;/span&gt;destExtCols = destInput.ExternalMetadataColumnCollection;
            &lt;span style="color: #2b91af"&gt;IDTSOutputColumnCollection100 &lt;/span&gt;sourceColumns = srcComponent.OutputCollection[0].OutputColumnCollection;

            &lt;span style="color: green"&gt;// The OLEDB destination requires you to hook up the external columns
            &lt;/span&gt;&lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;IDTSOutputColumn100 &lt;/span&gt;outputCol &lt;span style="color: blue"&gt;in &lt;/span&gt;sourceColumns)
            {
                &lt;span style="color: green"&gt;// Get the external column id
                &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSExternalMetadataColumn100 &lt;/span&gt;extCol = (&lt;span style="color: #2b91af"&gt;IDTSExternalMetadataColumn100&lt;/span&gt;)destExtCols[outputCol.Name];
                &lt;span style="color: blue"&gt;if &lt;/span&gt;(extCol != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                {
                    &lt;span style="color: green"&gt;// Create an input column from an output col of previous component.
                    &lt;/span&gt;destVirInput.SetUsageType(outputCol.ID, &lt;span style="color: #2b91af"&gt;DTSUsageType&lt;/span&gt;.UT_READONLY);
                    &lt;span style="color: #2b91af"&gt;IDTSInputColumn100 &lt;/span&gt;inputCol = destInputCols.GetInputColumnByLineageID(outputCol.ID);
                    &lt;span style="color: blue"&gt;if &lt;/span&gt;(inputCol != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
                    {
                        &lt;span style="color: green"&gt;// map the input column with an external metadata column
                        &lt;/span&gt;destDesignTimeComponent.MapInputColumn(destInput.ID, inputCol.ID, extCol.ID);
                    }
                }
            }

            &lt;span style="color: blue"&gt;return &lt;/span&gt;package;
        }

        &lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IDTSComponentEvents
        &lt;/span&gt;{
            &lt;span style="color: blue"&gt;private void &lt;/span&gt;HandleEvent(&lt;span style="color: blue"&gt;string &lt;/span&gt;type, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description)
            {
                &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;[{0}] {1}: {2}&amp;quot;&lt;/span&gt;, type, subComponent, description);
            }

            &lt;span style="color: blue"&gt;#region &lt;/span&gt;IDTSComponentEvents Members

            &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireBreakpointHit(&lt;span style="color: #2b91af"&gt;BreakpointTarget &lt;/span&gt;breakpointTarget)
            {
            }

            &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireCustomEvent(&lt;span style="color: blue"&gt;string &lt;/span&gt;eventName, &lt;span style="color: blue"&gt;string &lt;/span&gt;eventText, &lt;span style="color: blue"&gt;ref object&lt;/span&gt;[] arguments, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
            {
            }

            &lt;span style="color: blue"&gt;public bool &lt;/span&gt;FireError(&lt;span style="color: blue"&gt;int &lt;/span&gt;errorCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext)
            {
                HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;, subComponent, description);
                &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
            }

            &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireInformation(&lt;span style="color: blue"&gt;int &lt;/span&gt;informationCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
            {
                HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Information&amp;quot;&lt;/span&gt;, subComponent, description);
            }

            &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireProgress(&lt;span style="color: blue"&gt;string &lt;/span&gt;progressDescription, &lt;span style="color: blue"&gt;int &lt;/span&gt;percentComplete, &lt;span style="color: blue"&gt;int &lt;/span&gt;progressCountLow, &lt;span style="color: blue"&gt;int &lt;/span&gt;progressCountHigh, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
            {
            }

            &lt;span style="color: blue"&gt;public bool &lt;/span&gt;FireQueryCancel()
            {
                &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
            }

            &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireWarning(&lt;span style="color: blue"&gt;int &lt;/span&gt;warningCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext)
            {
                HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Warning&amp;quot;&lt;/span&gt;, subComponent, description);
            }

            &lt;span style="color: blue"&gt;#endregion
        &lt;/span&gt;}
    }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9856793" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="API" scheme="http://blogs.msdn.com/mattm/archive/tags/API/default.aspx" /></entry><entry><title>Debugging a COMException during package generation</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/08/03/debugging-a-comexception-during-package-generation.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/08/03/debugging-a-comexception-during-package-generation.aspx</id><published>2009-08-04T06:27:18Z</published><updated>2009-08-04T06:27:18Z</updated><content type="html">&lt;p&gt;You’ll occasionally receive a &lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comexception.aspx"&gt;COMException&lt;/a&gt; when you’re programmatically generating SSIS package – typically when dealing with Data Flow components. These COM Exceptions will provide you with an HRESULT (ErrorCode), and no additional information. &lt;/p&gt;  &lt;p&gt;&lt;font face="Courier New"&gt;System.Runtime.InteropServices.COMException (0xC020801C): Exception from HRESULT: 0xC020801C      &lt;br /&gt;&amp;#160;&amp;#160; at Microsoft.SqlServer.Dts.Pipeline.Wrapper.CManagedComponentWrapperClass.AcquireConnections(Object pTransaction)       &lt;br /&gt;&amp;#160;&amp;#160; at MyApp.Program.CreatePackage()       &lt;br /&gt;&amp;#160;&amp;#160; at MyApp.Program.Main(String[] args)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Ideally the exception you receive would have the underlying error message included. Unfortunately, the SSIS pipeline API doesn’t provide the &lt;a href="http://msdn.microsoft.com/en-us/library/ms345164.aspx"&gt;IErrorInfo&lt;/a&gt; support needed for the .NET runtime to determine the error details, but there is a way for you to receive the error(s) using an event handler.&lt;/p&gt;  &lt;p&gt;For this to work, you’ll need to be able to modify the package generation code (or at least control the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.taskhost.aspx"&gt;TaskHost&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.wrapper.mainpipe.aspx"&gt;MainPipe&lt;/a&gt; of the data flow objects). You’ll receive detailed error messages by supplying an &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.idtscomponentevents.aspx"&gt;IDTSComponentEvents&lt;/a&gt; handler for the &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.pipeline.wrapper.idtspipeline100.events.aspx"&gt;IDTSPipeline100.Events&lt;/a&gt; property. The &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.idtscomponentevents.fireerror.aspx"&gt;FireError&lt;/a&gt; event will be raised right before any COMException is thrown, proving you the error details.&lt;/p&gt;  &lt;p&gt;The first step is to create a class which implements the IDTSComponentEvents interface. This class is simply going to report all errors and warnings out to the console as they occur. &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IDTSComponentEvents
&lt;/span&gt;{&lt;/pre&gt;

&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;public bool &lt;/span&gt;FireError(&lt;span style="color: blue"&gt;int &lt;/span&gt;errorCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext)
    {
        Console.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;[Error] {0}: {2}&amp;quot;&lt;/span&gt;, subComponent, description);
        &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
    }&lt;/pre&gt;

&lt;pre class="code"&gt;[…]
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Next, we’ll hook up an instance of this class to the Events property of our MainPipe (Data Flow) object. &lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: #2b91af"&gt;Package &lt;/span&gt;package = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Package&lt;/span&gt;();

&lt;span style="color: green"&gt;// Add Data Flow Task
&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Executable &lt;/span&gt;dataFlowTask = package.Executables.Add(&lt;span style="color: #a31515"&gt;&amp;quot;STOCK:PipelineTask&amp;quot;&lt;/span&gt;);

&lt;span style="color: green"&gt;// Set the name (otherwise it will be a random GUID value)
&lt;/span&gt;&lt;span style="color: #2b91af"&gt;TaskHost &lt;/span&gt;taskHost = dataFlowTask &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TaskHost&lt;/span&gt;;
taskHost.Name = &lt;span style="color: #a31515"&gt;&amp;quot;Data Flow Task&amp;quot;&lt;/span&gt;;

&lt;span style="color: green"&gt;// We need a reference to the InnerObject to add items to the data flow
&lt;/span&gt;&lt;span style="color: #2b91af"&gt;MainPipe &lt;/span&gt;pipeline = taskHost.InnerObject &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MainPipe&lt;/span&gt;;

&lt;span style="color: green"&gt;// Set the IDTSComponentEvent handler to capture the details from any 
// COMExceptions raised during package generation
&lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler &lt;/span&gt;events = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler&lt;/span&gt;();
pipeline.Events = &lt;span style="color: #2b91af"&gt;DtsConvert&lt;/span&gt;.GetExtendedInterface(events &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;IDTSComponentEvents&lt;/span&gt;);&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;After this, any COMExceptions raised by the pipeline will be displayed on the console.&lt;/p&gt;

&lt;p&gt;For example, let’s look at the COM Exception I listed at the top of this post (HRESULT 0xC020801C). Looking up the error code on the &lt;a href="http://msdn.microsoft.com/en-us/library/ms345164.aspx"&gt;Integration Services Error and Message Reference&lt;/a&gt; page tells me that the HRESULT maps to DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER, so there’s a good chance one of my calls to AcquireConnection() is causing the exception. If my package contained a number of data sources and connection managers, it could make it very difficult to debug.&lt;/p&gt;

&lt;p&gt;After hooking up the event handler, I see the following on the command line before receiving the exception:&lt;/p&gt;

&lt;p&gt;&lt;font face="Courier New"&gt;[Error] OleDb Source [1]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.&amp;#160; The AcquireConnection method call to the connection manager &amp;quot;localhost&amp;quot; failed with error code 0xC0202009.&amp;#160; There may be error messages posted before this with more information on why the AcquireConnection method call failed.&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;Now I know which source is failing (OleDb Source [1]), and which connection manager (localhost) is causing the problem. It could still be better, but now at least I know where to start debugging (ie. make sure that the database on localhost is up and running).&lt;/p&gt;

&lt;p&gt;Here is a full implementation of IDTSComponentEvents incase you want to try it out yourself.&lt;/p&gt;

&lt;p&gt;--------&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ComponentEventHandler &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;IDTSComponentEvents
&lt;/span&gt;{
    &lt;span style="color: blue"&gt;private void &lt;/span&gt;HandleEvent(&lt;span style="color: blue"&gt;string &lt;/span&gt;type, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description)
    {
        &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;[{0}] {1}: {2}&amp;quot;&lt;/span&gt;, type, subComponent, description);
    }

    &lt;span style="color: blue"&gt;#region &lt;/span&gt;IDTSComponentEvents Members

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireBreakpointHit(&lt;span style="color: #2b91af"&gt;BreakpointTarget &lt;/span&gt;breakpointTarget)
    {
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireCustomEvent(&lt;span style="color: blue"&gt;string &lt;/span&gt;eventName, &lt;span style="color: blue"&gt;string &lt;/span&gt;eventText, &lt;span style="color: blue"&gt;ref object&lt;/span&gt;[] arguments, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
    {
    }

    &lt;span style="color: blue"&gt;public bool &lt;/span&gt;FireError(&lt;span style="color: blue"&gt;int &lt;/span&gt;errorCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext)
    {
        HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Error&amp;quot;&lt;/span&gt;, subComponent, description);
        &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireInformation(&lt;span style="color: blue"&gt;int &lt;/span&gt;informationCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
    {
        HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Information&amp;quot;&lt;/span&gt;, subComponent, description);
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireProgress(&lt;span style="color: blue"&gt;string &lt;/span&gt;progressDescription, &lt;span style="color: blue"&gt;int &lt;/span&gt;percentComplete, &lt;span style="color: blue"&gt;int &lt;/span&gt;progressCountLow, &lt;span style="color: blue"&gt;int &lt;/span&gt;progressCountHigh, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;ref bool &lt;/span&gt;fireAgain)
    {
    }

    &lt;span style="color: blue"&gt;public bool &lt;/span&gt;FireQueryCancel()
    {
        &lt;span style="color: blue"&gt;return true&lt;/span&gt;;
    }

    &lt;span style="color: blue"&gt;public void &lt;/span&gt;FireWarning(&lt;span style="color: blue"&gt;int &lt;/span&gt;warningCode, &lt;span style="color: blue"&gt;string &lt;/span&gt;subComponent, &lt;span style="color: blue"&gt;string &lt;/span&gt;description, &lt;span style="color: blue"&gt;string &lt;/span&gt;helpFile, &lt;span style="color: blue"&gt;int &lt;/span&gt;helpContext)
    {
        HandleEvent(&lt;span style="color: #a31515"&gt;&amp;quot;Warning&amp;quot;&lt;/span&gt;, subComponent, description);    
    }

    &lt;span style="color: blue"&gt;#endregion
&lt;/span&gt;}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9856748" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="API" scheme="http://blogs.msdn.com/mattm/archive/tags/API/default.aspx" /></entry><entry><title>Speaking for the Vancouver BI PASS Chapter</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/06/29/speaking-for-the-vancouver-bi-pass-chapter.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/06/29/speaking-for-the-vancouver-bi-pass-chapter.aspx</id><published>2009-06-29T20:09:46Z</published><updated>2009-06-29T20:09:46Z</updated><content type="html">&lt;p&gt;I’ll be presenting for the &lt;a href="http://vancouverbi.sqlpass.org/"&gt;Vancouver BI PASS Chapter&lt;/a&gt; next Friday, July 10th, at the Microsoft Canada offices. I really enjoyed meeting the &lt;a href="http://blogs.msdn.com/mattm/archive/2009/06/02/speaking-at-the-pnw-ssug.aspx"&gt;Pacific Northwest SQL Server User Group&lt;/a&gt; a couple of weeks ago, and I’m looking forward to sharing SSIS with my fellow Canadians in Vancouver. I’ll be going over some &lt;a href="http://blogs.msdn.com/mattm/archive/2009/05/20/avoiding-common-pitfalls-in-ssis.aspx"&gt;common SSIS pitfalls&lt;/a&gt;, and it seems like I’ll have plenty of time to go over any other topics that come up (perhaps there will be interest in &lt;a href="http://blogs.msdn.com/mattm/archive/2009/05/02/samples-for-the-cdc-merge-demo.aspx"&gt;CDC &amp;amp; Merge&lt;/a&gt;?)&lt;/p&gt;  &lt;p&gt;Hope to see you there!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Friday, July 10&lt;sup&gt;th&lt;/sup&gt; 2009&amp;#160; &lt;br /&gt;8:30 - 11:30 AM&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Microsoft Canada&lt;/strong&gt;     &lt;br /&gt;1111 W. Georgia, Suite 1100 (11th floor)&amp;#160; &lt;br /&gt;Vancouver, British Columbia&amp;#160; &lt;br /&gt;V6E 4M3 &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.bing.com/maps/default.aspx?v=2&amp;amp;FORM=LMLTCC&amp;amp;cp=49.285993~-123.12349&amp;amp;style=r&amp;amp;lvl=14&amp;amp;tilt=-90&amp;amp;dir=0&amp;amp;alt=-1000&amp;amp;phx=0&amp;amp;phy=0&amp;amp;phscl=1&amp;amp;where1=1111%20W.%20Georgia%2C%20Vancouver%2C%20British%20Columbia%2C%20Canada%2C%20%20V6E%204M3&amp;amp;encType=1"&gt;&lt;img height="46" alt="" src="http://vancouverbi.sqlpass.org/Portals/64/LiveSearchMaps.png" width="130" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9808754" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Conferences" scheme="http://blogs.msdn.com/mattm/archive/tags/Conferences/default.aspx" /></entry><entry><title>Scripts and assembly caching in 2005</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/06/17/scripts-and-assembly-caching-in-2005.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/06/17/scripts-and-assembly-caching-in-2005.aspx</id><published>2009-06-17T20:18:00Z</published><updated>2009-06-17T20:18:00Z</updated><content type="html">&lt;p&gt;A recent discussion with MVP &lt;a href="http://sqlblog.com/blogs/andy_leonard/default.aspx"&gt;Andy Leonard&lt;/a&gt; about a new property which showed up on the Script Task in SQL Server 2005 SP3 reminded me that I’ve been meaning to blog about how the script task and script component cache their precompiled code at runtime. This behavior has changed in every SP since 2005 RTM, and while there are &lt;a href="http://support.microsoft.com/kb/928323"&gt;a couple&lt;/a&gt; of &lt;a href="http://support.microsoft.com/kb/945893/"&gt;KB articles&lt;/a&gt; that describe the issues that prompted the changes, I haven’t seen anyone document the behavior itself. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The behavior in SQL Server 2008 is different from 2005 because of the switch from VSA to VSTA. 2008 does not have any of the problems or limitations listed below. &lt;/p&gt;  &lt;h3&gt;Script Assemblies&lt;/h3&gt;  &lt;p&gt;First a bit of background information on how the script task and script component work. I think the &lt;a href="http://msdn.microsoft.com/en-us/library/ms141752(SQL.90).aspx"&gt;BOL entry for the script task&lt;/a&gt; does a good job of explaining the compilation behavior:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;VSA scripts must be compiled before the package runs. The Script task includes the option to precompile script into binary code when the package is saved. When script is precompiled, the language engine is not loaded at run time and the package runs more quickly; however, compiled binary files consume significant disk space. If you do not use the precompile option, the script is compiled at run time, which slows package execution but consumes less disk space. If storing large packages is not a problem, you should precompile your VSA scripts. Also, only precompiled script can be run in a 64-bit environment. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Whether you’re using the &lt;strong&gt;PreCompile&lt;/strong&gt; option or not, the script will eventually be compiled into a .NET assembly. Loading the assembly takes time, uses memory, and requires a separate &lt;a href="http://msdn.microsoft.com/en-us/library/system.appdomain.aspx"&gt;AppDomain&lt;/a&gt;.&amp;#160; &lt;/p&gt;  &lt;h3&gt;2005 RTM&lt;/h3&gt;  &lt;p&gt;In the initial 2005 release, SSIS did not cache these Script Assemblies. This meant that if you were executing a script task inside of a loop, a new AppDomain would be created for each iteration, and the assembly is reloaded. This wasn’t good for performance, and because we can’t unload/destroy an AppDomain until the process finishes, could result in memory issues. &lt;/p&gt;  &lt;h3&gt;2005 SP1&lt;/h3&gt;  &lt;p&gt;Script assembly caching was introduced in SP1 to address the performance and memory issues. This functionality made sure that the script assembly was only loaded once, and then reused on subsequent executions. However, each script was associated with a GUID… if you copy/paste the .DTSX file, the GUID for the script task or script component stays the same (even if you later go in and modify the script code). This led to unexpected behavior – if the script code was completely different, but came from a copy/pasted script task, you’d end up reusing one of the script assemblies for both tasks. The &lt;a href="http://support.microsoft.com/kb/928323"&gt;related KB article&lt;/a&gt; describes the problem in more detail.&lt;/p&gt;  &lt;h3&gt;2005 SP2&lt;/h3&gt;  &lt;p&gt;This behavior was fixed in SP2 by changing the GUID every time the script is modified. This meant that if the script code was the same, and the name of the script task or component matched, the script assembly would only be loaded once.&lt;/p&gt;  &lt;h3&gt;2005 SP3&lt;/h3&gt;  &lt;p&gt;There was one remaining side effect of script caching that hadn’t turned up yet. This &lt;a href="http://support.microsoft.com/kb/945893/"&gt;KB article&lt;/a&gt; describes the problem you might run into, but doesn’t give much detail (other than that it’s related to caching). &lt;/p&gt;  &lt;p&gt;The issue was that if the same script is executed in parallel (multiple execute package tasks running the same child package in process), they might share the same Dts runtime object (which has collections for variables, and connection managers). So if a script in the first instance sets variable Foo to “A”, and the second instance sets it to “B”, the first instance would end up with a value of “B” as well. &lt;/p&gt;  &lt;p&gt;You can see why this would be a problem (and extremely confusing).&lt;/p&gt;  &lt;p&gt;Unfortunately this problem isn’t easily fixed without entirely disabling script caching. Because we don’t want to go back to the RTM behavior (no caching at all), we introduced a new property to the Script Task / Component to control caching - &lt;strong&gt;OptimizeScriptExecution&lt;/strong&gt;. If you’re running a child package with scripts multiple times in parallel, be sure to set this value to False, which disables the cache and prevents the scripts from sharing a runtime object. &lt;/p&gt;  &lt;p&gt;I hope that helps!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9769896" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Script Task" scheme="http://blogs.msdn.com/mattm/archive/tags/Script+Task/default.aspx" /></entry><entry><title>Speaking at the PNW SSUG</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/06/02/speaking-at-the-pnw-ssug.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/06/02/speaking-at-the-pnw-ssug.aspx</id><published>2009-06-02T18:41:51Z</published><updated>2009-06-02T18:41:51Z</updated><content type="html">&lt;p&gt;I’ll be speaking at the &lt;a href="http://pugetsound.sqlpass.org/"&gt;Pacific Northwest SQL Server User Group&lt;/a&gt; meeting next Wednesday, June 10th. I’ll be giving an updated version of the &lt;a href="http://blogs.msdn.com/mattm/archive/2009/05/20/avoiding-common-pitfalls-in-ssis.aspx"&gt;Avoiding Common Pitfalls in SSIS&lt;/a&gt; talk I gave at TechEd a couple of weeks ago. It will be my first time attending a user group meeting, and I’m really looking forward to meeting some more SQL people from the area. &lt;/p&gt;  &lt;p&gt;See you there!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9685731" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Conferences" scheme="http://blogs.msdn.com/mattm/archive/tags/Conferences/default.aspx" /></entry><entry><title>More tutorial videos on Jumpstart TV</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/05/26/more-tutorial-videos-on-jumpstart-tv.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/05/26/more-tutorial-videos-on-jumpstart-tv.aspx</id><published>2009-05-26T19:24:47Z</published><updated>2009-05-26T19:24:47Z</updated><content type="html">&lt;p&gt;A while ago I &lt;a href="http://blogs.msdn.com/mattm/archive/2007/06/12/ssis-tutorials-on-jumpstarttv.aspx"&gt;posted&lt;/a&gt; about the great SSIS tutorials available on &lt;a href="http://www.jumpstarttv.com/"&gt;Jumpstart TV&lt;/a&gt;, and it’s been one of my most read blog posts so far. In the two years or so since I originally posted it, they’ve been busy adding &lt;a href="http://www.jumpstarttv.com/Search.aspx?terms=ssis"&gt;new content for SSIS&lt;/a&gt;, as well as &lt;a href="http://www.jumpstarttv.com/channels/SQL.aspx"&gt;other SQL technologies&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Here are some of the SSIS videos that have been published since my last post:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/ssis-stumpers-v1-unpivot-example_268.aspx?searchid=36907"&gt;SSIS Stumpers V1 – Unpivot Example&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/using-the-aggregrate-transform-for-group-bys-in-ssis_510.aspx?searchid=36907"&gt;Using the Aggregate Transform for Group Bys in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/scheduling-ssis-packages-with-sql-server-agent_503.aspx?searchid=36907"&gt;Scheduling SSIS Packages with SQL Server Agent&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/using-a-sort-transform-in-ssis_509.aspx?searchid=36907"&gt;Using a Sort Transform in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/using-data-viewers-in-ssis_507.aspx?searchid=36906"&gt;Using Data Viewers in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/using-the-file-system-task-in-ssis_508.aspx?searchid=36906"&gt;Using the File System Task in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/executing-ssis-package-in-ssms_496.aspx?searchid=36906"&gt;Executing SSIS Package in SSMS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/adding-a-time-stamp-to-a-files-in-ssis_489.aspx?searchid=36906"&gt;Adding a Time Stamp to a File Name in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/parameterizing-the-execute-sql-task-in-ssis_500.aspx?searchid=36906"&gt;Parameterizing the Execute SQL Task in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/ssis-lookup-transform-basics_632.aspx?searchid=36906"&gt;SSIS Lookup Transform Basics&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/ssis-lookup-transform-lookup-failures_633.aspx?searchid=36906"&gt;SSIS Lookup Transform - Lookup Failures&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/secure-ftp-file-transfer-in-ssis_631.aspx?searchid=36906"&gt;Secure FTP File Transfer in SSIS&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.jumpstarttv.com/expression-language-basics_630.aspx?searchid=36906"&gt;Expression Language Basics&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Don’t forget the &lt;a href="http://blogs.msdn.com/mattm/archive/2009/05/26/tutorial-ssis-performance-videos.aspx"&gt;SSIS tutorials posted on MSDN&lt;/a&gt; as well.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9641620" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Getting Started" scheme="http://blogs.msdn.com/mattm/archive/tags/Getting+Started/default.aspx" /><category term="Tutorial" scheme="http://blogs.msdn.com/mattm/archive/tags/Tutorial/default.aspx" /></entry><entry><title>Tutorial: SSIS Performance Videos</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/05/26/tutorial-ssis-performance-videos.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/05/26/tutorial-ssis-performance-videos.aspx</id><published>2009-05-26T19:01:22Z</published><updated>2009-05-26T19:01:22Z</updated><content type="html">&lt;p&gt;This post is coming a little late (these have already been announced &lt;a href="http://sqlcat.com/presentations/archive/2009/05/02/designing-and-tuning-for-performance-your-ssis-packages-in-the-enterprise-sql-video-series.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://dougbert.com/blogs/dougbert/archive/2009/04/30/speed-up-your-etl-with-4-new-ssis-performance-videos-from-microsoft.aspx"&gt;here&lt;/a&gt;), but incase you haven’t seen these before, I wanted to bring attention to four new performance related created by the &lt;a href="http://sqlcat.com/Default.aspx"&gt;SQLCAT&lt;/a&gt; and SSIS teams. They mostly focus on larger scale/Enterprise level package deployments, but there are good tips for all levels of SSIS usage. &lt;/p&gt;  &lt;p&gt;From the &lt;a href="http://sqlcat.com/presentations/archive/2009/05/02/designing-and-tuning-for-performance-your-ssis-packages-in-the-enterprise-sql-video-series.aspx"&gt;SQLCAT post&lt;/a&gt;:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Measuring and Understanding the Performance of Your SSIS Packages in the Enterprise (SQL Server Video)&lt;/strong&gt;     &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd795223.aspx"&gt;Link&lt;/a&gt; | &lt;a href="http://go.microsoft.com/fwlink/?LinkId=149083"&gt;Watch this video&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: Denny Lee, Microsoft Corporation&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This video demonstrates how to measure and understand the performance of packages, based on lessons learned from enterprise customers. In this video, you will learn the following guidelines for improving performance: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;How the limits of the source system affect performance. &lt;/li&gt;    &lt;li&gt;Why disk I/O is important. &lt;/li&gt;    &lt;li&gt;Why you should establish a package performance baseline &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Tuning Your SSIS Package Data Flow in the Enterprise (SQL Server Video)      &lt;br /&gt;&lt;/strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd795225.aspx"&gt;Link&lt;/a&gt; | &lt;a href="http://msdn.microsoft.com/en-us/library/dd795225.aspx"&gt;Watch this video&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: David Noor, Microsoft Corporation&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This video demonstrates how to improve the performance of the data flow in an Integration Services package. In this video, you will learn how to tune the following phases of the data flow: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Extraction &lt;/li&gt;    &lt;li&gt;Transformation &lt;/li&gt;    &lt;li&gt;Loading &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;You can apply these performance tuning tips when you design, develop, and run the data flow.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Understanding SSIS Data Flow Buffers (SQL Server Video)&lt;/strong&gt;     &lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd795224.aspx"&gt;Link&lt;/a&gt; | &lt;a href="http://go.microsoft.com/fwlink/?LinkId=149086"&gt;Watch this video&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: Bob Bojanic, Microsoft Corporation&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This video looks at the memory buffers that transfer data to the data flow of an Integration Services package. The video includes the following items: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Demonstration of a simple package that shows you how Integration Services divides the data along the data flow paths and how buffers carry data along those paths.      &lt;br /&gt;This simple package performs the following operations:       &lt;ul&gt;       &lt;li&gt;Data extraction &lt;/li&gt;        &lt;li&gt;Character mapping &lt;/li&gt;        &lt;li&gt;Creation of new columns by using a synchronous transformation &lt;/li&gt;        &lt;li&gt;Multicasting &lt;/li&gt;        &lt;li&gt;Sorting by using a blocking (asynchronous) transformation. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Design guidelines for building and maintaining the data flow of a package. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Designing Your SSIS Packages for Parallelism (SQL Server Video)      &lt;br /&gt;&lt;/strong&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd795221.aspx"&gt;Link&lt;/a&gt; | &lt;a href="http://go.microsoft.com/fwlink/?LinkId=149087"&gt;Watch this video&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Author&lt;/strong&gt;: Matt Carroll, Microsoft Corporation&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;This video demonstrates how to increase the performance of your Integration Services packages by designing for parallelism. &lt;/p&gt;  &lt;p&gt;------&lt;/p&gt;  &lt;p&gt;These four videos join the &lt;a href="http://msdn.microsoft.com/en-us/library/dd299421.aspx"&gt;growing list of SSIS tutorial videos&lt;/a&gt; in the SQL Server Video series. Others that might interest you:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd299421.aspx"&gt;Creating a Basic Package&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc952922.aspx"&gt;Exporting SQL Server Data to Excel&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd440761.aspx"&gt;How to: Automate SSIS Package Execution by Using the SQL Server Agent&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc952927.aspx"&gt;How to: Call a Web Service by Using the Web Service Task&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc952929.aspx"&gt;How to: Implement a Lookup Transformation in Full Cache Mode&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc952923.aspx"&gt;How to: Use the Data Profiling Task&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dd440760.aspx"&gt;Troubleshooting: SSIS Package Execution Using SQL Server Agent&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9641598" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Getting Started" scheme="http://blogs.msdn.com/mattm/archive/tags/Getting+Started/default.aspx" /><category term="Performance" scheme="http://blogs.msdn.com/mattm/archive/tags/Performance/default.aspx" /><category term="Tutorial" scheme="http://blogs.msdn.com/mattm/archive/tags/Tutorial/default.aspx" /></entry><entry><title>Avoiding Common Pitfalls in SSIS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/05/20/avoiding-common-pitfalls-in-ssis.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/05/20/avoiding-common-pitfalls-in-ssis.aspx</id><published>2009-05-21T00:42:14Z</published><updated>2009-05-21T00:42:14Z</updated><content type="html">&lt;p&gt;I’ve uploaded the slides for the Chalk Talk I gave at TechEd last week. I always appreciate feedback (good or bad), and I’ve gotten some great comments so far. If you attended the session (or just like the slides), feel free to comment below. &lt;/p&gt;  &lt;p&gt;&lt;iframe style="border-right: #dde5e9 1px solid; padding-right: 0px; border-top: #dde5e9 1px solid; padding-left: 0px; padding-bottom: 0px; margin: 3px; border-left: #dde5e9 1px solid; width: 240px; padding-top: 0px; border-bottom: #dde5e9 1px solid; height: 66px; background-color: #ffffff" marginwidth="0" marginheight="0" src="http://cid-2aeb3aa8bb4bd9fd.skydrive.live.com/embedrowdetail.aspx/Public/SSIS%7C_Pitfalls.pptx" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9632927" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author><category term="Getting Started" scheme="http://blogs.msdn.com/mattm/archive/tags/Getting+Started/default.aspx" /></entry><entry><title>Samples for the CDC &amp; Merge demo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/05/02/samples-for-the-cdc-merge-demo.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/05/02/samples-for-the-cdc-merge-demo.aspx</id><published>2009-05-03T03:53:13Z</published><updated>2009-05-03T03:53:13Z</updated><content type="html">&lt;p&gt;I’ve put together the samples I used in the Incremental Data Warehousing talk I did at the SSWUG.Org Virtual Conference. You can download them from my sky drive, here:&lt;/p&gt; &lt;iframe style="border-bottom: #dde5e9 1px solid; border-left: #dde5e9 1px solid; padding-bottom: 0px; background-color: #ffffff; margin: 3px; padding-left: 0px; width: 240px; padding-right: 0px; height: 26px; border-top: #dde5e9 1px solid; border-right: #dde5e9 1px solid; padding-top: 0px" marginheight="0" src="http://cid-2aeb3aa8bb4bd9fd.skydrive.live.com/embedrow.aspx/Public/MergeCDC.zip" frameborder="0" marginwidth="0" scrolling="no"&gt;&lt;/iframe&gt;  &lt;p&gt;The zip has a readme.txt file that should explain how to setup and run the samples. Please let me know if you have any questions. &lt;/p&gt;  &lt;p&gt;For those keeping track – these are the same demos I did at the last PASS Conference in Seattle. I updated the talk a bit for the SSWUG conference, but the demos are essentially the same. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9584137" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author></entry><entry><title>Sample videos posted for the SSWUG.ORG Virtual Conference</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/mattm/archive/2009/04/08/sample-videos-posted-for-the-sswug-org-virtual-conference.aspx" /><id>http://blogs.msdn.com/mattm/archive/2009/04/08/sample-videos-posted-for-the-sswug-org-virtual-conference.aspx</id><published>2009-04-08T18:48:10Z</published><updated>2009-04-08T18:48:10Z</updated><content type="html">&lt;p&gt;They’ve posted 10 minute previews for some of the talks at the upcoming &lt;a href="http://blogs.msdn.com/mattm/archive/2009/03/30/sswug-org-ultimate-virtual-conference-april-2009.aspx"&gt;SSWUG.ORG Virtual Conference&lt;/a&gt;. Here are some of the SSIS related topics:&lt;/p&gt;  &lt;p&gt;Matt Masson - &lt;a href="http://www.vconferenceonline.com/speaker.asp?id=mmasson"&gt;Incremental Data Warehouse Loads with Merge &amp;amp; CDC&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;John Welch -&amp;#160; &lt;a href="http://www.vconferenceonline.com/speaker.asp?id=JWelch"&gt;Doing More (ETL) With Less (Effort) by Automating SSIS&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Brian Knight - &lt;a href="http://www.vconferenceonline.com/speaker.asp?id=BKnight"&gt;Loading a Data Warehouse With SSIS&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Anthony D’Angelo - &lt;a href="http://www.vconferenceonline.com/speaker.asp?id=ADAngelo"&gt;Deep Dive: Extending SSIS with .NET Development&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;They also have a &lt;a href="http://vconferenceonline.com/shows/spring09/sql/s09event.asp"&gt;free community event&lt;/a&gt; coming up on April 17th. If you’re not sure how the whole virtual conference thing works, this event is a great way to try it out. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9538440" width="1" height="1"&gt;</content><author><name>mmasson</name><uri>http://blogs.msdn.com/members/mmasson.aspx</uri></author></entry></feed>