<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SQL Server with Mr. Denny &#187; SSIS</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/sql-server/tag/ssis/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/sql-server</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 19:39:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Using Event Viewer Logging for SSIS Performance Trouble Shooting</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/using-event-viewer-logging-for-ssis-performance-trouble-shooting/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/using-event-viewer-logging-for-ssis-performance-trouble-shooting/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 14:00:51 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[BIDS]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server 2008 R2]]></category>
		<category><![CDATA[SQL Server 2012]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/?p=2131</guid>
		<description><![CDATA[So while working with a client recently I was going some performance tuning on SSIS for them.  While SSIS isn&#8217;t exactly my normal workload, the problem wasn&#8217;t really in SSIS, but just normal SQL Statements being called from SSIS. While attacking this problem, the first thing that I did was look into the SSIS package [...]]]></description>
				<content:encoded><![CDATA[<p>So while working with a client recently I was going some performance tuning on SSIS for them.  While SSIS isn&#8217;t exactly my normal workload, the problem wasn&#8217;t really in SSIS, but just normal SQL Statements being called from SSIS.</p>
<p>While attacking this problem, the first thing that I did was look into the SSIS package and see what I had gotten myself into.  There were hundreds of objects within SSIS, most of them T-SQL Scripts of Data Pump Tasks.  So simply going through them one by one wasn&#8217;t going to be all that helpful.  The client didn&#8217;t have any logging to SQL Server or to a text file setup, but they did have the SSIS package setup to log to the Windows event log.</p>
<p>Opening the Application log greated me with one event for the start of each task, and one for the completion of each task.  Not exactly the most useful information ever, but better than nothing, so I&#8217;ll take what I can get.  The first thing that I did was export the Application Event log to a CSV file and download it to my desktop so that I could do the processing on my local machine.  The CSV file has a few hundred thousand lines, so I needed to figure out what I had via scripting.  The first problem that I had was that for each SSIS event there were multiple lines within the csv when opened in Excel which you can see below.</p>
<p><img class="alignnone" src="http://mrdenny.com/wp-content/uploads/2012/07/excel.jpg" alt="" width="755" height="179" /></p>
<p>Thankfully this made the rows pretty unique looking, so an Excel Macro was able to clean this up pretty easily.  Before I got started I added some column headers into the excel sheet.  The default columns from Event Viewer are Date, Time, Source, Severity, Category, EventID, User, Computer, Description.  This covered columns A through I.  After that I put columns J through P as being Operator, SourceName, SourceID, Execution, StartTime, EndTime and DataCode as these are the specific items that SSIS is logging that you can see above.  Then it was time to bust out a little VBA and flatten out all this data.  The macro shown below looped through the data and flattened everything out so that all the data was on a single line.  Then is went through and removed all the white lines.  This macro took about 3 hours to run.</p>
<p><code>Sub CleanUpData()<br />
Dim Row As Long<br />
Dim DataRow As Long<br />
Row = 32768<br />
Do While Range("A" &amp; Row).Value = ""<br />
If Range("B" &amp; Row).Value = "" Then<br />
DataRow = Row<br />
Range("A" &amp; Row).Select<br />
Else<br />
If Left(Range("A" &amp; Row).Value, 4) = " Mes" Then<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 4) = " Ope" Then<br />
Range("J" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 9) = " Source N" Then<br />
Range("K" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 10) = " Source ID" Then<br />
Range("L" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 4) = " Exe" Then<br />
Range("M" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 4) = " Sta" Then<br />
Range("N" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 4) = " End" Then<br />
Range("O" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
If Left(Range("A" &amp; Row).Value, 4) = " Dat" Then<br />
Range("P" &amp; DataRow).Value = Range("A" &amp; Row).Value<br />
Range("A" &amp; Row).Value = ""<br />
End If<br />
End If<br />
Row = Row + 1<br />
Loop</code></p>
<p>Do While Row 2<br />
If Range(&#8220;A&#8221; &amp; Row).Value = &#8220;&#8221; Then<br />
Range(Row &amp; &#8220;:&#8221; &amp; Row).Select<br />
Selection.Delete<br />
End If<br />
Row = Row &#8211; 1<br />
Loop<br />
End Sub</p>
<p>Once that was done I needed to set the start times for each event on the same line as the end time for each event. That way I wasn&#8217;t scrolling through looking for stuff while trying to do my data analysis. This I was also able to do with a little Macro. In this case I started on row 14 as that was the first entry that had SSIS data. You may need to change the EndRow=14 line to what ever line your data starts on. This puts the start time and the end time into Columns R and S, but only on the line which is the OnPostExecute line.</p>
<p><code>Sub FindRunTimes()<br />
Dim EndRow As Long<br />
Dim StartRow As Long<br />
Dim SourceName As String<br />
EndRow = 14<br />
Do While Range("A" &amp; EndRow).Value = ""<br />
If Range("I" &amp; EndRow).Value = " Event Name: OnPostExecute" Then<br />
StartRow = EndRow + 1<br />
Do Until Range("K" &amp; EndRow).Value = Range("K" &amp; StartRow).Value And Range("I" &amp; StartRow).Value = " Event Name: OnPreExecute"<br />
If Range("I" &amp; StartRow).Value = "" Then<br />
MsgBox "Ran out of rows to process for ending row " &amp; EndRow<br />
Exit Sub<br />
End If<br />
StartRow = StartRow + 1<br />
Loop<br />
Range("S" &amp; EndRow).Value = Range("B" &amp; EndRow).Value<br />
Range("R" &amp; EndRow).Value = Range("B" &amp; StartRow).Value<br />
'Range("T" &amp; EndRow).Value = DateDiff("mi", Range("A" &amp; StartRow).Value &amp; " " &amp; Range("B" &amp; StartRow).Value, Range("A" &amp; EndRow).Value &amp; " " &amp; Range("B" &amp; EndRow).Value)<br />
Range("R" &amp; EndRow).Select<br />
End If<br />
EndRow = EndRow + 1<br />
Loop<br />
End Sub</code></p>
<p>Once that Macro was finished I needed to figure out which of the statements was taking to long to run. Putting a formula into the column Q marked the rows that I needed to look into a little more. In this case I was using anything with a run time of 20 minutes or longer as needing to be looked at.</p>
<p><code>=IF(HOUR(R595)=HOUR(S595)*60+MINUTE(S595),"", "X"), IF(HOUR(R595)*60+MINUTE(R595)+19&gt;=HOUR(S595)*60+MINUTE(S595)+1440,"", "X"))</code></p>
<p>Once that formula was in there all the rows that were SSIS objects that took a long time to run had an X next to them. Now I still needed to ignore the rows which were containers, but those were pretty easy to figure out from the names of the objects as most of them had container in them (in the SourceName column which was column K of my Worksheet). At this point I was able to move back to the SSIS package and start digging through the package finding the objects which had long runtimes and getting those looked at.</p>
<p>The whole reason I went through this process instead of just adding logging to the SSIS package was for a few different reasons.</p>
<ul>
<li>I didn&#8217;t want to make ANY changes to production if I didn&#8217;t have to. This SSIS package loads a production data warehouse which the business uses to run their company, so making changes to it wasn&#8217;t something I wanted to try.</li>
<li>If I had simply put logging into place I would have had to have waited another day to being looking at the problems as the ETL process only runs once a day.</li>
<li>The SSIS package takes 8+ hours to run, so sitting around waiting for it to run wasn&#8217;t exactly the best use of my time, or the clients money.</li>
</ul>
<p>If you get stuck in this same sort of problem, hopefully this approach will help you out.<br />
Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/using-event-viewer-logging-for-ssis-performance-trouble-shooting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>24HOP: BI Workload Follow-Up</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/24hop-bi-workload-follow-up/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/24hop-bi-workload-follow-up/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 19:53:58 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[24 HoP]]></category>
		<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[RAM]]></category>
		<category><![CDATA[SQL PASS]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[Stacia Misner]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/24hop-bi-workload-follow-up/</guid>
		<description><![CDATA[This is a total repost of Stacia&#8217;s blog post from this morning so that hopefully everyone will see it.  So pretend that Stacia wrote this and that I didn&#8217;t. Yesterday, Denny Cherry (blog&#124;twitter) and I co-presented a 24HOP session for the Fall 2011 lineup, “So How Does the BI Workload Impact the Database Engine?” 24HOP [...]]]></description>
				<content:encoded><![CDATA[<p>This is a total repost of Stacia&#8217;s <a href="http://sqlblog.com/blogs/stacia_misner/archive/2011/09/08/38352.aspx">blog post</a> from this morning so that hopefully everyone will see it.  So pretend that Stacia wrote this and that I didn&#8217;t.</p>
<div class="BlogPostContent">
<blockquote><p>Yesterday, Denny Cherry (<a href="http://www.mrdenny.com/" target="_blank">blog</a>|<a href="http://www.twitter.com/mrdenny" target="_blank">twitter</a>) and I co-presented a <a href="http://www.sqlpass.org/24hours/fall2011/default.aspx" target="_blank">24HOP session for the Fall 2011 lineup</a>,  “So How Does the BI Workload Impact the Database Engine?” 24HOP stands  for 24 Hours of PASS and is a semiannual roundup of speakers from the  SQL Server community. Initially, this event consisted of 24 consecutive  sessions, each lasting an hour, but later it became a two-day event with  12 consecutive sessions each day. The sessions are free to attend and  feature many great topics covering the spectrum of SQL Server things to  know. Even if you missed previous 24HOP events, you can always go back  and view recordings of sessions that interest you at the 24HOP site for <a href="http://www.sqlpass.org/24hours/spring2011/" target="_blank">Spring 2011</a> and <a href="http://www.sqlpass.org/24hours/fall2010/" target="_blank">Fall 2010</a>.</p>
<p>And  if you missed Denny and me yesterday, a recording will be available in a  couple of weeks and I’ll update this post with a link. Our hour-long  session for 24HOP was a sneak preview of our upcoming half-day session  of the same name that we’ll be presenting at the <a href="http://www.sqlpass.org/summit/2011/" target="_blank">PASS Summit</a> in Seattle on Thursday, October 13, 2011 from 1:30 pm to 4:30 PM. In our <a href="http://www.sqlpass.org/summit/2011/Speakers/CallForSpeakers/SessionDetail.aspx?sid=1134" target="_blank">half-day session</a>,  we’ll dig into the details and spend more time on database engine  analysis, whereas in our 24HOP session, we focused on reviewing the  architecture and highlighting the connection between BI components and  the database engine.</p>
<p>We were able to answer a few questions at  the end, but one question in particular could not be answered easily in  the time allotted in a single sentence or two: How much RAM do I need to  plan for Integration Services (SSIS)? Andy Leonard (<a href="http://sqlblog.com/blogs/andy_leonard" target="_blank">blog</a>|<a href="http://www.twitter.com/AndyLeonard" target="_blank">twitter</a>)  did manage a succinct response: All of it! I, on the other hand, am not  known for being succinct, so deferred the question for this post.</p>
<p>Andy  is right that SSIS wants as much memory as you can give it, which can  be problematic if you’re executing an SSIS package on the same box as  SQL Server. On the other hand, there are benefits to executing the  package on the same box as well, so there is no one-size-fits-all  solution. And the solution for one data integration scenario might not  be the right solution for another data integration scenario. A lot  depends on what CPU and RAM resources a given server has and how much  data is involved. In order to know how much horsepower you need, you’re  going to have to do some benchmark testing with packages. Here are some  good resources for SSIS if you’re concerned about memory:</p>
<ul>
<li><a href="http://sqlcat.com/sqlcat/b/top10lists/archive/2008/10/01/top-10-sql-server-integration-services-best-practices.aspx" target="_blank">Top 10 SQL Server Integration Services Best Practices</a> from the SQL Customer Advisory Team (<a href="http://sqlcat.com/" target="_blank">blog</a> | <a href="http://www.twitter.com/sqlcat" target="_blank">twitter</a>):  This article provides an overview of best practices (as the name  implies!) and includes links to information about using performance  counters to monitor resource usage and about optimizing the Lookup  transformation, which is one of the big memory consumers in SSIS.</li>
<li><a href="http://msdn.microsoft.com/en-us/library/cc966530.aspx" target="_blank">SQL Server 2005 Integration Services: A Strategy for Performance</a>, a whitepaper by my friend, former colleague, and co-author of <a href="http://www.amazon.com/Business-Intelligence-ebook/dp/B004OR1XYC/ref=sr_1_2?ie=UTF8&amp;qid=1315496545&amp;sr=8-2" target="_blank">my first book</a>,  Elizabeth Vitt. Although it was written for SSIS 2005, the principles  related to tuning packages and how to benchmark still apply. The  significant changes between SSIS 2005 and SSIS 2008 with regard to  performance were improvements in thread management and in the <a href="http://www.sql-server-performance.com/2009/SSIS-New-Features-in-SQL-Server-2008-Part2/" target="_blank">Lookup transformation</a>.</li>
</ul>
<p>Is  there a rule of thumb for deciding how much memory you’ll need for  SSIS? Well, no less than 4 GB per CPU core is a good place to start. But  if that’s not possible, you certainly want to have memory that’s at  least two or three times the size of data that you expect to be  processing at a given time. So if you’re processing 1 GB of data, you’ll  want at least 2-3 GB of memory and, of course, more memory is even  better!</p></blockquote>
</div>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/24hop-bi-workload-follow-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Transformation Services vs. SSIS: The key differences</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/data-transformation-services-vs-ssis-the-key-differences/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/data-transformation-services-vs-ssis-the-key-differences/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 07:50:38 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[DTS]]></category>
		<category><![CDATA[SearchSQLServer.com]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/data-transformation-services-vs-ssis-the-key-differences/</guid>
		<description><![CDATA[I recently published an article on SearchSQLServer.com about DTS and SSIS where I talk about some of the differences.  Obvsiolly I didn&#8217;t cover all the differences between DTS and SSIS, just some of them.  So don&#8217;t go railing on me that I didn&#8217;t cover something. Denny]]></description>
				<content:encoded><![CDATA[<p>I recently published an article on SearchSQLServer.com about <a href="http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1370542,00.html" target="_blank">DTS and SSIS where I talk about some of the differences</a>.  Obvsiolly I didn&#8217;t cover all the differences between DTS and SSIS, just some of them.  So don&#8217;t go railing on me that I didn&#8217;t cover something.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/data-transformation-services-vs-ssis-the-key-differences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Development of SQL 2008 SSIS Packages Requires SSIS Service</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/development-of-sql-2008-ssis-packages-requires-ssis-service/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/development-of-sql-2008-ssis-packages-requires-ssis-service/#comments</comments>
		<pubDate>Mon, 22 Dec 2008 11:00:22 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[BIDS]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/development-of-sql-2008-ssis-packages-requires-ssis-service/</guid>
		<description><![CDATA[Unlike in SQL 2005, when developing SSIS packages in SQL Server 2008 BIDS you must have the SSIS service installed on your workstation.]]></description>
				<content:encoded><![CDATA[<p>Unlike in SQL 2005, when developing SSIS packages in SQL Server 2008 BIDS you must have the SSIS service installed on your workstation.  This is a change from SQL Server 2005 where you did not have to have the actual SSIS service installed on your workstation.</p>
<p>It doesn&#8217;t appear that you actually need to have the service running.  I have stopped the SSIS service on my workstation and I am still able to run my SQL 2008 SSIS packages, however I would recommend setting it to manual rather then disabled just in case BIDS needs it running for some reason.</p>
<p>If you try and edit an existing package without the SSIS service installed an error message will be displayed saying that the service needs to be installed.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/development-of-sql-2008-ssis-packages-requires-ssis-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to setup SQL 2008 BIDS to use VB.NET as the default scripting language</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-sql-2008-bids-to-use-vbnet-as-the-default-scripting-language/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-sql-2008-bids-to-use-vbnet-as-the-default-scripting-language/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 11:00:36 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[BIDS]]></category>
		<category><![CDATA[Integration Services 2008]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-sql-2008-bids-to-use-vbnet-as-the-default-scripting-language/</guid>
		<description><![CDATA[If you are like me and don&#8217;t know anything about C#, and you don&#8217;t want to have to change the script language every time to create a .NET script from C#.NET to VB.NET you can change the default.  Open BIDS, and select Tools &#62; Options.  On the menu on the left select &#8220;Business Intelligence Designers&#8221; then &#8220;Integration [...]]]></description>
				<content:encoded><![CDATA[<p>If you are like me and don&#8217;t know anything about C#, and you don&#8217;t want to have to change the script language every time to create a .NET script from C#.NET to VB.NET you can change the default.</p>
<p> Open BIDS, and select Tools &gt; Options.  On the menu on the left select &#8220;Business Intelligence Designers&#8221; then &#8220;Integration Services Designers&#8221;.  In the Script box in the middle of the right pain change the option in the drop down from &#8220;Microsoft Visual C# 2008&#8243; to &#8220;Microsoft Visual Basic 2008&#8243;.</p>
<p>If you prefer C# you&#8217;ve got nothing to worry about as C# is the default option.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/how-to-setup-sql-2008-bids-to-use-vbnet-as-the-default-scripting-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use caution when upgrading SQL 2008 CTP SSIS packages to RC0</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/use-caution-when-upgrading-sql-2008-ctp-ssis-packages-to-rc0/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/use-caution-when-upgrading-sql-2008-ctp-ssis-packages-to-rc0/#comments</comments>
		<pubDate>Thu, 12 Jun 2008 05:24:15 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[Beta]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/use-caution-when-upgrading-sql-2008-ctp-ssis-packages-to-rc0/</guid>
		<description><![CDATA[A ran across a bit of a problem when upgrading my SQL 2008  CTP 5 (November 2007) SSIS Packages to SQL 2008 RC0.  Apparently Microsoft has changed the way that they handle the script tasks within the SSIS packages.  Because of this when I edit all of the script tasks within my SSIS package the [...]]]></description>
				<content:encoded><![CDATA[<p>A ran across a bit of a problem when upgrading my SQL 2008  CTP 5 (November 2007) SSIS Packages to SQL 2008 RC0.  Apparently Microsoft has changed the way that they handle the script tasks within the SSIS packages.  Because of this when I edit all of the script tasks within my SSIS package the scripts were all blank.</p>
<p> The official fix from Microsoft is to install the older CTP version that you edited the scripts in on another machine and open the un-updated version of the SSIS package on that machine, and copy the code for the scripts into the RC0 version of the SSIS package.</p>
<p>The only object which I&#8217;ve had to do this on was a .NET Script Task.  I had this problem when going from CTP 5 to CTP 6 as well as from CTP 5 to RC0.  This will not effect migrating from SQL 2005 to SQL 2008 as SQL 2005 and SQL 2008 CTP 5 do not use the same scripting engine in the back end.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/use-caution-when-upgrading-sql-2008-ctp-ssis-packages-to-rc0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using a foreach loop to process an XML document.</title>
		<link>http://itknowledgeexchange.techtarget.com/sql-server/using-a-foreach-loop-to-process-an-xml-document/</link>
		<comments>http://itknowledgeexchange.techtarget.com/sql-server/using-a-foreach-loop-to-process-an-xml-document/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 08:00:01 +0000</pubDate>
		<dc:creator>Denny Cherry</dc:creator>
				<category><![CDATA[DataManagement]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SSIS]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/sql-server/using-a-foreach-loop-to-process-an-xml-document/</guid>
		<description><![CDATA[Receintly I was working on a project where I needed to use a foreach loop with an SSIS project, but couldn't for the life of me get it to properly process the XML document which I was giving it.  Well with some major work and digging I was able to get it working correctly, but it took me for ever to get all the little setting correct so I figured that I'd throw the info up here for anyone else who is looking for it.]]></description>
				<content:encoded><![CDATA[<p><a href="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2007/12/collection.jpg" title="Collection Screen"></a>Receintly I was working on a project where I needed to use a foreach loop with an SSIS project, but couldn&#8217;t for the life of me get it to properly process the XML document which I was giving it.  Well with some major work and digging I was able to get it working correctly, but it took me for ever to get all the little setting correct so I figured that I&#8217;d throw the info up here for anyone else who is looking for it.</p>
<p>Some background on what the process is that I&#8217;m working on.  Basically I&#8217;ve got a table with catagorized data in it.  I need to export all the data from the table info one file per catagory (don&#8217;t ask, I didn&#8217;t design it, I&#8217;ve just got to automate it; and it actually makes sence in the grant schem of things).  Well I figured that the easiest way to do this was to use a foreach loop and give it an XML document with the list of catagories to process.  (This was better than looping through and getting the next value from the database.)</p>
<p> So needless to say, I get started on my little process.</p>
<p>The query which I&#8217;m using within an Execute SQL Task is below.  The Execute SQL Task puts the XML data into an SSIS variable called v_CategoryList with a data type of string.</p>
<p>SELECT WebsiteBlockCategoryId as id<br />
FROM dbo.WebsiteBlockCategory cat with (nolock)<br />
where WebsiteBlockCategoryId  &lt;&gt; 0<br />
for XML AUTO</p>
<p>The XML document looks like this. (SSIS seams to be wrapping it within &lt;ROOT&gt;&lt;/ROOT&gt; tags for me which is why I&#8217;m not doing it my self.)  My XML document is actually must longer than this, but you get the idea.  It&#8217;s a very basic XML document.</p>
<p>&lt;ROOT&gt;<br />
 &lt;cat id=&#8221;18&#8243; /&gt;<br />
 &lt;cat id=&#8221;19&#8243; /&gt;<br />
 &lt;cat id=&#8221;20&#8243; /&gt;<br />
 &lt;cat id=&#8221;21&#8243; /&gt;<br />
 &lt;cat id=&#8221;22&#8243; /&gt;<br />
 &lt;cat id=&#8221;23&#8243; /&gt;<br />
 &lt;cat id=&#8221;24&#8243; /&gt;<br />
 &lt;cat id=&#8221;25&#8243; /&gt;<br />
 &lt;cat id=&#8221;26&#8243; /&gt;<br />
 &lt;cat id=&#8221;27&#8243; /&gt;<br />
 &lt;cat id=&#8221;28&#8243; /&gt;<br />
&lt;/ROOT&gt;</p>
<p>As you can see on the screenshot of the forloop properties I&#8217;ve set the source to be my variable and the EnumerationType to Element Collection.  Since I know where the data is within the XML document I use DirectInput for both the outer and Inner XPath strings.  For the Outer XPath string I&#8217;m using &#8220;//cat&#8221;.  Because I&#8217;m not putting in the ROOT level name it doesn&#8217;t matter what gets put in there as long as there is a parent level.    For the Inner XPath string I&#8217;ve got the Element name with an @ sign in front of it &#8220;@id&#8221;. </p>
<p><a href="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2007/12/collection.jpg" title="Collection Screen"><img border="0" width="450" src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2007/12/collection.jpg" alt="Collection Screen" height="380" /></a></p>
<p>Over on the Variables page of the UI I&#8217;ve got my v_CategoryId variable mapped to Index 0 of my document.  If you need to output more than one element from your XML document set your Inner XPath to &#8220;*&#8221;.  This &#8220;should&#8221; allow you to bring back all the elements and refer to them by index number starting with 0.  I havn&#8217;t actually tried this, as I&#8217;ve always only needed a single element hense the &#8220;should&#8221;.</p>
<p><a href="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2007/12/variable_mappings.jpg" title="Variable Mappings"><img border="0" width="450" src="http://cdn.ttgtmedia.com/ITKE/uploads/blogs.dir/20/files/2007/12/variable_mappings.jpg" alt="Variable Mappings Screen" height="380" /></a></p>
<p>And to think, that little thing took me a couple of days to get working right.  I can only imagine trying to do this in SQL 2000 and DTS.</p>
<p>Denny</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/sql-server/using-a-foreach-loop-to-process-an-xml-document/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
