<?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>tim laqua dot com &#187; business intelligence</title>
	<atom:link href="http://timlaqua.com/tag/business-intelligence/feed/" rel="self" type="application/rss+xml" />
	<link>http://timlaqua.com</link>
	<description>Thoughts and Code from Tim Laqua</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:12:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SSAS Cache Isn&#8217;t Making Cents</title>
		<link>http://timlaqua.com/2012/02/ssas-cache-isnt-making-cents/</link>
		<comments>http://timlaqua.com/2012/02/ssas-cache-isnt-making-cents/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 23:12:27 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[analysis services]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[ssas]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=888</guid>
		<description><![CDATA[I stole the pun from my Business Analyst, Mr. John Seiler Now on to my issue - when SSAS caches the value for my [Actual] measure, it seems to do so based on the results of the first query that requests that coordinate. In this particular cube, there's bunches of tiny fractions and depending on [...]]]></description>
			<content:encoded><![CDATA[<p>I stole the pun from my Business Analyst, Mr. John Seiler <img src='http://timlaqua.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   Now on to my issue - when SSAS caches the value for my [Actual] measure, it seems to do so based on the results of the first query that requests that coordinate.  In this particular cube, there's bunches of tiny fractions and depending on how you slice it, it aggregates a little different.  This is a fun problem in itself, but the part that drives me (and the Finance department) crazy is that if you go and slice on something OTHER than that first query that created the cache, the values they see don't always add up to the "Grand Total" in Excel - aka. "All"</p>
<p>These are the queries used for this test:</p>
<p>Query A</p>

<div class="wp_syntax"><div class="code"><pre class="mdx" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">SELECT</span> 
	<span style="color: #003300; font-weight: bold;">&#123;</span>Actual<span style="color: #003300; font-weight: bold;">&#125;</span> <span style="color: #0000FF; font-weight: bold;">ON</span> <span style="color: #cc66cc;">0</span>
<span style="color: #0000FF; font-weight: bold;">FROM</span> <span style="color: #333333;">[GL]</span> 
CELL <span style="color: #FF00FF;">PROPERTIES</span> <span style="color: #CC00FF;">VALUE</span></pre></div></div>

<p>Query B</p>

<div class="wp_syntax"><div class="code"><pre class="mdx" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">SELECT</span> 
	<span style="color: #003300; font-weight: bold;">&#123;</span>Actual<span style="color: #003300; font-weight: bold;">&#125;</span> <span style="color: #0000FF; font-weight: bold;">ON</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span>
	<span style="color: #0000FF; font-weight: bold;">NON</span> <span style="color: #0000FF; font-weight: bold;">EMPTY</span> <span style="color: #0000FF;">Hierarchize</span><span style="color: #003300; font-weight: bold;">&#40;</span><span style="color: #003300; font-weight: bold;">&#123;</span><span style="color: #0000FF;">DrilldownLevel</span><span style="color: #003300; font-weight: bold;">&#40;</span><span style="color: #003300; font-weight: bold;">&#123;</span><span style="color: #333333;">[Account]</span>.<span style="color: #333333;">[Accounts]</span>.<span style="color: #333333;">[All]</span><span style="color: #003300; font-weight: bold;">&#125;</span><span style="color: #66cc66;">,,,</span>INCLUDE_CALC_MEMBERS<span style="color: #003300; font-weight: bold;">&#41;</span><span style="color: #003300; font-weight: bold;">&#125;</span><span style="color: #003300; font-weight: bold;">&#41;</span> <span style="color: #0000FF; font-weight: bold;">ON</span> <span style="color: #cc66cc;">1</span>
<span style="color: #0000FF; font-weight: bold;">FROM</span> <span style="color: #333333;">[GL]</span> 
CELL <span style="color: #FF00FF;">PROPERTIES</span> <span style="color: #CC00FF;">VALUE</span></pre></div></div>

<p>Query C</p>

<div class="wp_syntax"><div class="code"><pre class="mdx" style="font-family:monospace;"><span style="color: #0000FF; font-weight: bold;">SELECT</span> 
	<span style="color: #003300; font-weight: bold;">&#123;</span>Actual<span style="color: #003300; font-weight: bold;">&#125;</span> <span style="color: #0000FF; font-weight: bold;">ON</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">,</span>
	<span style="color: #0000FF; font-weight: bold;">NON</span> <span style="color: #0000FF; font-weight: bold;">EMPTY</span> <span style="color: #0000FF;">Hierarchize</span><span style="color: #003300; font-weight: bold;">&#40;</span><span style="color: #003300; font-weight: bold;">&#123;</span><span style="color: #0000FF;">DrilldownLevel</span><span style="color: #003300; font-weight: bold;">&#40;</span><span style="color: #003300; font-weight: bold;">&#123;</span><span style="color: #333333;">[Date]</span>.<span style="color: #333333;">[Fiscal]</span>.<span style="color: #333333;">[All]</span><span style="color: #003300; font-weight: bold;">&#125;</span><span style="color: #66cc66;">,,,</span>INCLUDE_CALC_MEMBERS<span style="color: #003300; font-weight: bold;">&#41;</span><span style="color: #003300; font-weight: bold;">&#125;</span><span style="color: #003300; font-weight: bold;">&#41;</span> <span style="color: #0000FF; font-weight: bold;">ON</span> <span style="color: #cc66cc;">1</span>
<span style="color: #0000FF; font-weight: bold;">FROM</span> <span style="color: #333333;">[GL]</span> 
CELL <span style="color: #FF00FF;">PROPERTIES</span> <span style="color: #CC00FF;">VALUE</span>
GO</pre></div></div>

<style>
td {vertical-align: top;}
</style>
<p>Results (Cache was cleared with ClearCache on the entire Database before each Series)</p>
<table cellpadding=0 cellspacing=0>
<tr>
<th>Series 1</th>
<th>Series 2</th>
<th>Series 3</th>
</tr>
<tr>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-A.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-A.png" alt="" title="Series 1 - Query A" width="134" height="41" class="alignnone size-full wp-image-890" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-B.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-B.png" alt="" title="Series 2 - Query B" width="182" height="126" class="alignnone size-full wp-image-894" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-C.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-C.png" alt="" title="Series 3 - Query C" width="177" height="115" class="alignnone size-full wp-image-898" /></a>
  </td>
</tr>
<tr>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-B.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-B.png" alt="" title="Series 1 - Query B" width="181" height="124" class="alignnone size-full wp-image-891" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-C.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-C.png" alt="" title="Series 2 - Query C" width="179" height="117" class="alignnone size-full wp-image-895" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-A.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-A.png" alt="" title="Series 3 - Query A" width="132" height="38" class="alignnone size-full wp-image-896" /></a>
  </td>
<tr>
<tr>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-C.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-1-Query-C.png" alt="" title="Series 1 - Query C" width="176" height="116" class="alignnone size-full wp-image-892" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-A.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-2-Query-A.png" alt="" title="Series 2 - Query A" width="136" height="39" class="alignnone size-full wp-image-893" /></a>
  </td>
<td>
<a href="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-B.png"><img src="http://timlaqua.com/wp-content/uploads/2012/02/Series-3-Query-B.png" alt="" title="Series 3 - Query B" width="182" height="143" class="alignnone size-full wp-image-897" /></a>
  </td>
<tr>
</table>
<p>So basically the Grand Total of this GL cube is a random number based on whoever sneaks the first query in after the cache is cleared (processing, sync, etc).</p>
<p>And for all of you that think the MDX script breaks everything everywhere - I did comment out my entire MDX script before running these tests.</p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2012/02/ssas-cache-isnt-making-cents/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting a useful FTP error message out of SSIS</title>
		<link>http://timlaqua.com/2010/10/getting-a-useful-ftp-error-message-out-of-ssis/</link>
		<comments>http://timlaqua.com/2010/10/getting-a-useful-ftp-error-message-out-of-ssis/#comments</comments>
		<pubDate>Sat, 30 Oct 2010 14:10:55 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[ssis event handler]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=385</guid>
		<description><![CDATA[The plan: Upload a zip file for a bunch of different clients to various user-specified ftp servers - looks something like this: A quick note on what that "Update FTP Connection" task is doing - it's modifying the properties of the "FTP" connection manager to the appropriate Server/Username/Password for this particular client: 1 2 3 [...]]]></description>
			<content:encoded><![CDATA[<p>The plan:  Upload a zip file for a bunch of different clients to various user-specified ftp servers - looks something like this:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ControlFlow.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ControlFlow.png" alt="" title="FTPErrors-ControlFlow" width="272" height="197" class="alignnone size-full wp-image-391" /></a></p>
<p><em>A quick note on what that "Update FTP Connection" task is doing - it's modifying the properties of the "FTP" connection manager to the appropriate Server/Username/Password for this particular client:</em></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            ConnectionManager ftp <span style="color: #008000;">=</span> Dts.<span style="color: #0000FF;">Connections</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;FTP&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            ftp.<span style="color: #0000FF;">Properties</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;ServerName&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ftp, <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>Dts.<span style="color: #0000FF;">Variables</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;FTPServer&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            ftp.<span style="color: #0000FF;">Properties</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;ServerUserName&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ftp, <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>Dts.<span style="color: #0000FF;">Variables</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;FTPUser&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            ftp.<span style="color: #0000FF;">Properties</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;ServerPassword&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>ftp, <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#41;</span>Dts.<span style="color: #0000FF;">Variables</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;User::FTPPassword&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Value</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            Dts.<span style="color: #0000FF;">TaskResult</span> <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span><span style="color: #000000;">&#41;</span>ScriptResults.<span style="color: #0000FF;">Success</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>The problem: Anyone who has tried to upload multiple files to multiple FTP sites in an SSIS package very quickly ran in to FTP errors (that's what happens when you let users tell you what their FTP url and authentication is).  You can handle these errors and log them via the standard OnError handler dumping the ErrorCode, ErrorDescription, and usually SourceName out to a flat file or table.<br />
<span id="more-385"></span></p>
<p>Now, when you look at the ErrorDescription for an FTP Task - you'll be disappointed.  It usually states "Unable to connect to FTP server..." or something to that effect.  Looking at the execution results in the progress tab, you'll see that the FTP Connection Manager threw a more detailed description of the error:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ProgressScreen.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ProgressScreen-300x90.png" alt="" title="FTPErrors-ProgressScreen" width="300" height="90" class="alignnone size-medium wp-image-395" /></a></p>
<p>Good luck getting at that detailed error description - My first attempt here was to acquire a connection and connect via the connection manager and trap the error that came back.  While that worked, the error that was trapped was HRESULT 0xC001602A, which basically means that something bad happened.</p>
<p>Now we move on to phase two:  Retry the FTP operation via .NET FtpWebRequest and trap that error.  This can either flat out replace the FTP Task as a script task or, not sure why I did it this way - I suppose I like to try and use SSIS built in tasks as much as possible - you can retry the operation in the OnError handler assuming you have the requisite information (url, username, and password) available.</p>
<p>Create the OnError handler (either at the package level for everything or just on the executable you care about - I chose the latter):<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-CreateOnError.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-CreateOnError.png" alt="" title="FTPErrors-CreateOnError" width="212" height="94" class="alignnone size-full wp-image-392" /></a></p>
<p>Then add a data flow task - inside that add a Script Component (as a source) and an appropriate destination (Here it's going to an OleDb destination):<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-OnErrorDataFlowTasks.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-OnErrorDataFlowTasks.png" alt="" title="FTPErrors-OnErrorDataFlowTasks" width="175" height="164" class="alignnone size-full wp-image-394" /></a></p>
<p>Configure the Script Component for ReadOnly access to the requisite variables:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ScriptComponentVars.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ScriptComponentVars-300x236.png" alt="" title="FTPErrors-ScriptComponentVars" width="300" height="236" class="alignnone size-medium wp-image-397" /></a></p>
<p>And configure the Output buffer:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ScriptComponentOutput.png"><img src="http://timlaqua.com/wp-content/uploads/2010/10/FTPErrors-ScriptComponentOutput-300x173.png" alt="" title="FTPErrors-ScriptComponentOutput" width="300" height="173" class="alignnone size-medium wp-image-396" /></a></p>
<p>Now go edit the actual script:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Data</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">Microsoft.SqlServer.Dts.Pipeline.Wrapper</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">Microsoft.SqlServer.Dts.Runtime.Wrapper</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Net</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #000000;">&#91;</span>Microsoft.<span style="color: #0000FF;">SqlServer</span>.<span style="color: #0000FF;">Dts</span>.<span style="color: #0000FF;">Pipeline</span>.<span style="color: #0000FF;">SSISScriptComponentEntryPointAttribute</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> ScriptMain <span style="color: #008000;">:</span> UserComponent
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> CreateNewOutputRows<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> errorDescription <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">ErrorDescription</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>Variables.<span style="color: #0000FF;">ErrorDescription</span>.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Unable to connect to FTP server&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">try</span>
            <span style="color: #000000;">&#123;</span>
                FtpWebRequest ftp <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>FtpWebRequest<span style="color: #000000;">&#41;</span>WebRequest.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;ftp://&quot;</span> <span style="color: #008000;">+</span> Variables.<span style="color: #0000FF;">FTPUrl</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                ftp.<span style="color: #0000FF;">Method</span> <span style="color: #008000;">=</span> WebRequestMethods.<span style="color: #0000FF;">Ftp</span>.<span style="color: #0000FF;">UploadFile</span><span style="color: #008000;">;</span>
                ftp.<span style="color: #0000FF;">Credentials</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Net</span></span>.<span style="color: #0000FF;">NetworkCredential</span><span style="color: #000000;">&#40;</span>Variables.<span style="color: #0000FF;">FTPUser</span>, Variables.<span style="color: #0000FF;">FTPPassword</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                StreamReader sourceStream <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StreamReader<span style="color: #000000;">&#40;</span>Variables.<span style="color: #0000FF;">FTPLocalPath</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                <span style="color: #FF0000;">byte</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> fileContents <span style="color: #008000;">=</span> Encoding.<span style="color: #0000FF;">UTF8</span>.<span style="color: #0000FF;">GetBytes</span><span style="color: #000000;">&#40;</span>sourceStream.<span style="color: #0000FF;">ReadToEnd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                sourceStream.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                ftp.<span style="color: #0000FF;">ContentLength</span> <span style="color: #008000;">=</span> fileContents.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
&nbsp;
                Stream requestStream <span style="color: #008000;">=</span> ftp.<span style="color: #0000FF;">GetRequestStream</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                requestStream.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>fileContents, <span style="color: #FF0000;">0</span>, fileContents.<span style="color: #0000FF;">Length</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                requestStream.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                FtpWebResponse response <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>FtpWebResponse<span style="color: #000000;">&#41;</span>ftp.<span style="color: #0000FF;">GetResponse</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                response.<span style="color: #0000FF;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                errorDescription <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Upload retry attempt via .NET was successful.&quot;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception e<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                errorDescription <span style="color: #008000;">=</span> e.<span style="color: #0000FF;">Message</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
        ErrorSourceBuffer.<span style="color: #0000FF;">AddRow</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">ErrorCode</span> <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">ErrorCode</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">ErrorDescription</span> <span style="color: #008000;">=</span> errorDescription<span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">ErrorSource</span> <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">SourceName</span><span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">FTPUrl</span> <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">FTPUrl</span><span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">FTPUser</span> <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">FTPUser</span><span style="color: #008000;">;</span>
        ErrorSourceBuffer.<span style="color: #0000FF;">FTPPassword</span> <span style="color: #008000;">=</span> Variables.<span style="color: #0000FF;">FTPPassword</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And bob's your uncle.  Now you have meaningful text in the ErrorDescription column of the output buffer instead of some vague "something's wrong" message.</p>
<p>Here's a flat file destination walkthrough for the OnError handler: <a href="http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/archive/2007/04/08/ssis-design-pattern-custom-error-handling.aspx">http://vsteamsystemcentral.com/cs21/blogs/applied_business_intelligence/archive/2007/04/08/ssis-design-pattern-custom-error-handling.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2010/10/getting-a-useful-ftp-error-message-out-of-ssis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Excel 2007 Hangs When Trying to Edit an OLAP Cube Filter</title>
		<link>http://timlaqua.com/2010/04/excel-2007-hangs-when-trying-to-edit-an-olap-cube-filter/</link>
		<comments>http://timlaqua.com/2010/04/excel-2007-hangs-when-trying-to-edit-an-olap-cube-filter/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 03:38:16 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[analysis services]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[excel 2007]]></category>
		<category><![CDATA[pivot table]]></category>
		<category><![CDATA[ssas]]></category>
		<category><![CDATA[xmla]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=371</guid>
		<description><![CDATA[Ok, it doesn't hang every time you try to edit an OLAP cube filter, but sometimes - it appears to. In reality, I've never seen it permanently hang - just kind of go away for a while. Here's the basic symptom that the business will report to you: "Excel freezes (or hangs) when I try [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, it doesn't hang every time you try to edit an OLAP cube filter, but sometimes - it appears to.  In reality, I've never seen it permanently hang - just kind of go away for a while.  Here's the basic symptom that the business will report to you:</p>
<p><em>"Excel freezes (or hangs) when I try to change this filter"</em><br />
<a href="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Broken.png"><img src="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Broken.png" alt="" title="DeliveryDate-Date-Broken" width="352" height="351" class="alignnone size-full wp-image-373" /></a></p>
<p>Most of us have seen this at one point or another and shrugged it off as a busy time or processing is going on or there are cats clogging up the tubes, etc.  Tonight, I finally decided to figure out what's causing it.<br />
<span id="more-371"></span><br />
When you have an OLAP cube filter in your pivot table and expand the items list to select your filter items, Excel fires a bunch of Discover commands at the cube (these are pretty light in most cases).  If you don't have anything selected yet (so you just have the default member selected) Excel isn't doing much work here and the list pops right up.  Here's two basic flow examples for what discover commands are fired off when you DO have an item selected:</p>
<p>If you have one level 1 member selected</p>
<ol>
<li>MDSCHEMA_CUBES (whatever cube you're connected to)</li>
<li>MDSCHEMA_CUBES (again, same thing)</li>
<li>MDSCHEMA_MEMBERS (LEVEL_UNIQUE_NAME of the filter), no TREE_OP</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member) TREE_OP 4, only immediate parent</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent) TREE_OP 8, returns itself</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent) TREE_OP 1, returns all children</li>
</ol>
<p>If you have one level 2 member selected in a hierarchy</p>
<ol>
<li>MDSCHEMA_CUBES (whatever cube you're connected to)</li>
<li>MDSCHEMA_CUBES (again, same thing)</li>
<li>MDSCHEMA_MEMBERS (LEVEL_UNIQUE_NAME of the filter), no TREE_OP</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member) TREE_OP 4, only immediate parent</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent's parent)  TREE_OP 4, immediate parent</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent's parent) TREE_OP 8, returns itself</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent's parent)  TREE_OP 1, all children</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent) TREE_OP 8, returns itself</li>
<li>MDSCHEMA_MEMBERS (MEMBER_UNIQUE_NAME of the selected member's parent) TREE_OP 1, returns all children</li>
</ol>
<p>So, that's six requests for a level 1 member and 9 requests for a level 2 member - both of these take milliseconds to complete the whole flow, so no big deal.  When does this become a big deal?  When you do something like click the "Select multiple items" checkbox, expand a hierarchy and UNCHECK something... like if you opened the Adventure Works 2008 cube, added Delivery Date.Date as a filter, expanded the "All Periods" level and deselected the first day:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Setup.png"><img src="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Setup.png" alt="" title="DeliveryDate-Date-Setup" width="312" height="418" class="alignnone size-full wp-image-372" /></a></p>
<p>Now click OK and expand the items box - we get a familiar popup:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Broken.png"><img src="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Broken.png" alt="" title="DeliveryDate-Date-Broken" width="352" height="351" class="alignnone size-full wp-image-373" /></a></p>
<p>It comes back after a few seconds with the expected item list, but why did it take so long?  Well, based on our flows above, we have a whole bunch of level 1 members selected - 1187 of them to be exact.  That means there will be 1187 requests for their parent member (TREE_OP 4) which will all return the [All Periods] member.  To illustrate this, I traced that exact operation:<br />
<a href="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Profiler.png"><img src="http://timlaqua.com/wp-content/uploads/2010/04/DeliveryDate-Date-Profiler-300x144.png" alt="" title="DeliveryDate-Date-Profiler" width="300" height="144" class="alignnone size-medium wp-image-374" /></a></p>
<p>The profiler captured 1192 discover requests - 1187 of them were getting the parents of selected members, two were MDSCHEMA_CUBES requests, one was getting [All Periods], one was getting all the children of [All Periods], and one was getting the Unique Name of the root level.  Not cool.  Imagine what happens when your talking about tens of thousands of members at a particular level!  Granted, that seems unlikely but understand that the logic behind this is "I don't want to see this", "hide just this member", and so forth - in some cases people have no idea what actually happened was they unchecked one of 6,000 members.</p>
<p>So what to do about this?  Educate.  To fix the immediate problem of a seemingly broken Excel pivot table - just wait for the filter to load, it'll come back eventually.  In the future when working with Excel filters, always favor selecting vs. deselecting and filtering at higher levels in the hierarchy whenever possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2010/04/excel-2007-hangs-when-trying-to-edit-an-olap-cube-filter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Clone Analysis Services Partitions with PowerShell</title>
		<link>http://timlaqua.com/2010/01/clone-analysis-services-partitions-with-powershell/</link>
		<comments>http://timlaqua.com/2010/01/clone-analysis-services-partitions-with-powershell/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 20:45:20 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[amo]]></category>
		<category><![CDATA[analysis services]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[t-sql]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=322</guid>
		<description><![CDATA[Most of us with large Analysis Services cubes partition our cubes by month or year or some other time-based slice and we have all, at one point or another, developed some way to create partitions for new months on-demand. Often, the solution to this seems to be a C# console application or SSIS package using [...]]]></description>
			<content:encoded><![CDATA[<p>Most of us with large Analysis Services cubes partition our cubes by month or year or some other time-based slice and we have all, at one point or another, developed some way to create partitions for new months on-demand.  Often, the solution to this seems to be a C# console application or SSIS package using AMO to create a new partition based off an existing partition.  The problem I see with this is that maintaining it requires opening up the project or package, making changes, re-compiling, deploying, testing, deploying to production, verifying, etc.  It also requires that whoever is going to maintain it is comfortable with C#.</p>
<p>To simplify the maintenance and get rid of the "black box" factor that utility apps like this tend to have, I put together a PowerShell script to do the same thing and a stored procedure to call the script.  Really, it doesn't matter what you use as you're most likely using an almost identical chunk of code to get your new partition created - my argument is that using PowerShell instead of C# or SSIS reduces the cost of maintenance, improves readability, and facilitates better understanding throughout your team.<br />
<span id="more-322"></span><br />
<em>The PowerShell Script: cloneSSASPartition.ps1</em></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">param</span><span style="color: #000000;">&#40;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$ServerName</span><span style="color: pink;">,</span> 		<span style="color: pink;">&lt;</span><span style="color: #008000;"># The name of the Analysis Services Instance #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$DatabaseName</span><span style="color: pink;">,</span> 		<span style="color: pink;">&lt;</span><span style="color: #008000;"># The name of the Database our Cube is in #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$CubeName</span><span style="color: pink;">,</span>     		<span style="color: pink;">&lt;</span><span style="color: #008000;"># The name of the Cube that our Measure Group is in #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$MeasureGroupName</span><span style="color: pink;">,</span> 	<span style="color: pink;">&lt;</span><span style="color: #008000;"># The name of the Measure Group that our Partition is in #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$SourcePartitionName</span><span style="color: pink;">,</span> 	<span style="color: pink;">&lt;</span><span style="color: #008000;"># The name of the Partition we want to merge in to another partition #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$NewPartitionName</span><span style="color: pink;">,</span> 	<span style="color: pink;">&lt;</span><span style="color: #008000;"># The desired name of the new partition #&gt;</span>
   <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span> <span style="color: #800080;">$NewPartitionQuery</span> 	<span style="color: pink;">&lt;</span><span style="color: #008000;"># The Query source for the new partition (will use the same datasource as the SourcePartition #&gt;</span>
<span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.AnalysisServices&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">&gt;</span><span style="color: #800080;">$NULL</span>
&nbsp;
<span style="color: #800080;">$server</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Microsoft.AnalysisServices.Server
<span style="color: #800080;">$server</span>.Connect<span style="color: #000000;">&#40;</span><span style="color: #800080;">$ServerName</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #800080;">$database</span> <span style="color: pink;">=</span> <span style="color: #800080;">$server</span>.Databases.GetByName<span style="color: #000000;">&#40;</span><span style="color: #800080;">$DatabaseName</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$cube</span> <span style="color: pink;">=</span> <span style="color: #800080;">$database</span>.Cubes.GetByName<span style="color: #000000;">&#40;</span><span style="color: #800080;">$CubeName</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$measureGroup</span> <span style="color: pink;">=</span> <span style="color: #800080;">$cube</span>.MeasureGroups.FindByName<span style="color: #000000;">&#40;</span><span style="color: #800080;">$MeasureGroupName</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$sourcePartition</span> <span style="color: pink;">=</span> <span style="color: #800080;">$measureGroup</span>.Partitions.GetByName<span style="color: #000000;">&#40;</span><span style="color: #800080;">$SourcePartitionName</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$sourceQueryBinding</span> <span style="color: pink;">=</span> <span style="color: #800080;">$sourcePartition</span>.Source
&nbsp;
<span style="color: #800080;">$newPartition</span> <span style="color: pink;">=</span> <span style="color: #800080;">$sourcePartition</span>.Clone<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$newPartition</span>.ID <span style="color: pink;">=</span> <span style="color: #800080;">$NewPartitionName</span>
<span style="color: #800080;">$newPartition</span>.Name <span style="color: pink;">=</span> <span style="color: #800080;">$NewPartitionName</span>
<span style="color: #800080;">$measureGroup</span>.Partitions.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$newPartition</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">&gt;</span> <span style="color: #800080;">$NULL</span>
<span style="color: #800080;">$newPartition</span>.Source <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Microsoft.AnalysisServices.QueryBinding<span style="color: #000000;">&#40;</span><span style="color: #800080;">$sourceQueryBinding</span>.DataSourceID<span style="color: pink;">,</span> <span style="color: #800080;">$NewPartitionQuery</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$newPartition</span>.Update<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #800080;">$server</span>.Disconnect<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></div></div>

<p><em>The stored procedure to call the script: [Utility_CloneSSASPartition_S01] - assumes you placed cloneSSASPartition.ps1 at the root of the C: drive.  If you put it elsewhere, update the proc to reflect the actual location.</em></p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SET</span> ANSI_<span style="color: #808080;">NULL</span>S <span style="color: #0000FF;">ON</span>
GO
&nbsp;
<span style="color: #0000FF;">SET</span> QUOTED_IDENTIFIER <span style="color: #0000FF;">ON</span>
GO
&nbsp;
<span style="color: #008080;">/*************************************************************************************
***
*** Procedure:  		[Utility_CloneSSASPartition]
*** Purpose:		Executes PowerShell script to clone a SSAS partition
***			
***			
*** Author:		tl
*** Date Created:		2010-01-15
*** 
*** Revision History
*** Date		Author			Description
*** 2010-01-15	tl			Created
*************************************************************************************/</span>
&nbsp;
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">PROCEDURE</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Utility_CloneSSASPartition_S01<span style="color: #808080;">&#93;</span>
<span style="color: #808080;">&#40;</span>
	@ServerName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@DatabaseName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@CubeName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@MeasureGroupName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@SourcePartitionName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@NewPartitionName <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>,
	@NewPartitionQuery <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>
<span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">AS</span> 
&nbsp;
<span style="color: #0000FF;">SET</span> <span style="color: #0000FF;">NOCOUNT</span> <span style="color: #0000FF;">ON</span>
<span style="color: #0000FF;">DECLARE</span> @cmd <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">8000</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">SET</span> @cmd <span style="color: #808080;">=</span> 
	<span style="color: #FF0000;">'powershell.exe -Command &quot;&amp; {'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' C:<span style="color: #000099; font-weight: bold;">\c</span>loneSSASPartition.ps1'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -ServerName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @ServerName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -DatabaseName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @DatabaseName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -CubeName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @CubeName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -MeasureGroupName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @MeasureGroupName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -SourcePartitionName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @SourcePartitionName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -NewPartitionName:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @NewPartitionName <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span>
	<span style="color: #808080;">+</span> <span style="color: #FF0000;">' -NewPartitionQuery:<span style="color: #000099; font-weight: bold;">\&quot;</span>'</span> <span style="color: #808080;">+</span> @NewPartitionQuery <span style="color: #808080;">+</span> <span style="color: #FF0000;">'<span style="color: #000099; font-weight: bold;">\&quot;</span>}&quot;'</span>
&nbsp;
<span style="color: #0000FF;">PRINT</span> @cmd
<span style="color: #0000FF;">EXEC</span> xp_cmdshell @cmd</pre></div></div>

<p>And, finally, we execute it</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">EXEC</span> <span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Utility_CloneSSASPartition_S01<span style="color: #808080;">&#93;</span>
	 @ServerName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'TESTSERVER'</span>
	,@DatabaseName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'TestDatabase'</span>
	,@CubeName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'TestCube'</span>
	,@MeasureGroupName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'Test Measure Group'</span>
	,@SourcePartitionName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'Test Partition - 200912'</span>
	,@NewPartitionName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'Test Partition - 201001'</span>
	,@NewPartitionQuery <span style="color: #808080;">=</span> <span style="color: #FF0000;">'SELECT * FROM dbo.FactTableMonth('</span><span style="color: #FF0000;">'1/1/2010'</span><span style="color: #FF0000;">', '</span><span style="color: #FF0000;">'2/1/2010'</span><span style="color: #FF0000;">')'</span></pre></div></div>

<p>Again, I'm not saying there's anything "wrong" with using C# or SSIS Packages to do this sort of thing, I'm just pointing out that C# isn't always the answer - especially when someone other than you needs to maintain this thing in the future.  Keep it simple.</p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2010/01/clone-analysis-services-partitions-with-powershell/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wouldn&#8217;t it be fun if Cubes could talk?</title>
		<link>http://timlaqua.com/2009/11/wouldnt-it-be-fun-if-cubes-could-talk/</link>
		<comments>http://timlaqua.com/2009/11/wouldnt-it-be-fun-if-cubes-could-talk/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 19:47:21 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[amo]]></category>
		<category><![CDATA[analysis services]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[cubes]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=291</guid>
		<description><![CDATA[I didn't say "wouldn't it be useful" because after putting a test together, asking a cube questions with no context tends to return answers that it probably shouldn't have returned. In BI, it is incredibly important to understand what exactly it is you're asking for - if we just say we want "sales" and return [...]]]></description>
			<content:encoded><![CDATA[<p>I didn't say "wouldn't it be useful" because after putting a test together, asking a cube questions with no context tends to return answers that it probably shouldn't have returned.  In BI, it is incredibly important to understand what exactly it is you're asking for - if we just say we want "sales" and return an answer, nobody really knows what we meant by "sales."  Sure, in various circles, "sales" means the same thing - but once you start talking to different areas, departments, etc - the meaning of the word starts to shift.</p>
<p>But I digress - asking cubes questions is still pretty fun and some of the random things it returns when you point it at your own cubes can be flat out hilarious.</p>
<p>Here's a few questions thrown at the Adventure Works cube in the Adventure Works DW 2008 Analysis Services database<br />
<span id="more-291"></span></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">what was sales for nichole nara
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Customer].[Customer].[Nichole Nara]} ON 0 FROM [Adventure Works])
$13,295.38
what were sales for nichole nara in cy 2004
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Date].[Calendar Year].[CY 2004]} ON 0 FROM (SELECT {[Customer].[Customer].[Nichole Nara]} ON 0 FROM [Adventure Works]))
$2,419.06
what were sales for nichole nara in cy 2004 in north america
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Sales Territory].[Sales Territory Group].[North America]} ON 0 FROM (SELECT {[Date].[Calendar Year].[CY 2004]} ON 0 FROM (SELECT {[Customer].[Customer].[Nichole Nara]} ON 0 FROM [Adventure Works])))
No Results Found
what were sales for nichole nara in cy 2004 for bikes
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Product].[Category].[Bikes]} ON 0 FROM (SELECT {[Date].[Calendar Year].[CY 2004]} ON 0 FROM (SELECT {[Customer].[Customer].[Nichole Nara]} ON 0 FROM [Adventure Works])))
$2,384.07
what were sales in north america in fy 2003 for bikes
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Product].[Category].[Bikes]} ON 0 FROM (SELECT {[Date].[Fiscal Year].[FY 2003]} ON 0 FROM (SELECT {[Sales Territory].[Sales Territory Group].[North America]} ON 0 FROM [Adventure Works])))
$1,739,306.95
sales for cy 2004 in cy q1, cy q2, and cy q4 in north america and canada
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Sales Territory].[Sales Territory Group].[North America],[Customer].[Country].[Canada]} ON 0 FROM (SELECT {[Date].[Calendar Quarter of Year].[CY Q1],[Date].[Calendar Quarter of Year].[CY Q2],[Date].[Calendar Quarter of Year].[CY Q4]} ON 0 FROM (SELECT {[Date].[Calendar Year].[CY 2004]} ON 0 FROM [Adventure Works])))
I don't know - Query Failure: Members belong to different hierarchies in the  function.
sales for cy 2004 in cy q1, cy q2, and cy q4 in north america
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Sales Territory].[Sales Territory Group].[North America]} ON 0 FROM (SELECT {[Date].[Calendar Quarter of Year].[CY Q1],[Date].[Calendar Quarter of Year].[CY Q2],[Date].[Calendar Quarter of Year].[CY Q4]} ON 0 FROM (SELECT {[Date].[Calendar Year].[CY 2004]} ON 0 FROM [Adventure Works])))
$3,967,371.16
sales between cy 2003 and cy 2004 for large resellers
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT [Large Resellers] ON 0 FROM (SELECT {[Date].[Calendar Year].[CY 2003]:[Date].[Calendar Year].[CY2004]} ON 0 FROM [Adventure Works]))
$19,561,960.04
sales for top 50 customers in fy 2004 in fy q1 and fy q3
SELECT {[Measures].[Internet Sales Amount]} ON 0  FROM (SELECT {[Date].[Fiscal Quarter of Year].[FY Q1],[Date].[Fiscal Quarter of Year].[FY Q3]} ON 0 FROM (SELECT {[Date].[Fiscal Year].[FY 2004]} ON 0 FROM (SELECT [Top 50 Customers] ON 0 FROM [Adventure Works])))
$177,263.41</pre></div></div>

<p>The above questions returned pretty much exactly what I was looking for except for the one that threw us an error about members belonging to different hierarchies.  That one was because "Canada" was in [Customer].[Country] and "north america" was in [Sales Territory].[Sales Territory Group].  Yeah, it was a dumb question because canada is in north america, but it illustrates that when you don't qualify things, you can get some pretty confusing results.</p>
<p><strong>How's it work?</strong></p>
<ol>
<li>Enumerate all the Attribute Values for each Attribute Hierarchy and store them as "keywords"</li>
<li>Get some input</li>
<li>Look for the aforementioned "keywords" in the input string</li>
<li>Construct an MDX query based on what "keywords" were found in the string</li>
<li>Make sure there aren't any extra (non-noise) words in the string</li>
<li>Run Query</li>
<li>Return Results</li>
</ol>
<p><strong>How the queries are constructed</strong></p>
<ul>
<li>Attribute Values just create a subcube - it creates a new nested subcube for each list, range, or named set it finds</li>
<li>It only supports one measure as written and it just selects that from whatever quagmire of subcubes it's created</li>
</ul>
<p>There are tons of issues with this methodology when we have role playing dimensions because the attribute values will be the same for these dimensions - so only the first one enumerated will get in (there's a way to ignore certain dimensions in the app.config - ignore all but one role playing dimension).  It throws away context and calls it "noise" - now that's dangerous;  if you throw away the context and just look for keywords, it's pretty easy to answer a question that wasn't really asked (oops).</p>
<p>As far as configuring this thing goes - take a look at the app.config and throw in appropriate values for your setup.  You'll have to tweak the *Pattern values to fit things you want to match or exclude in your particular cube.  It's configured for the Adventure Works cube right now, but I didn't work with it much - I just flat out excluded a few dims and hierarchies that would obviously confuse it.</p>
<p>Also note that, as written, it needs an Analysis Services 2008 cube.</p>
<p>Let me know if you want to give it a try and I'll be more than happy to work with you on configuring/modifying it for your setup.  Also post comments on interesting observations you have when asking cubes unqualified questions <img src='http://timlaqua.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href='http://timlaqua.com/wp-content/uploads/2009/11/SmartCube.zip'>Download the VS 2008 Project: SmartCube.zip</a></p>
<p>Also note, the project uses an interface called IODoodad for getting questions and responding - this has two public methods, GetInput() and Respond().  The original theory here is that we could make an old-school IRC bot type thing.  We did manage to hook it to Yammer for its IO, respond to private messages and public messages prefixed with @cube, etc.  I didn't really explain the config for YammerIO (there's a custom config section for that that needs a bunch of OAuth stuff).  Again, if you're interested in getting that working, let me know and I'll post instructions.  The project above is set to use ConsoleIO.</p>
<p>I don't plan on doing any more development here, it was just a quick PoC to see what it looked like and get some initial feedback.  If anyone's interested in moving forward with it and making it smarter (the project arguably should have been titled DumbCube at this point), let me know so I can post a link to your work and fork away <img src='http://timlaqua.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/11/wouldnt-it-be-fun-if-cubes-could-talk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Charting Analysis Services 2008 Trace Events</title>
		<link>http://timlaqua.com/2009/10/charting-analysis-services-2008-trace-events/</link>
		<comments>http://timlaqua.com/2009/10/charting-analysis-services-2008-trace-events/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 15:05:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[analysis services]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[tsql]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=273</guid>
		<description><![CDATA[The other day I was running some Analysis Services traces for some reason or another and ran across Chris Webb's post on (Visualising Analysis Services Trace Information in Reporting Services). After looking over that post, I thought it'd be interesting to visualize various types of processing, queries, etc - basically take a trace and then [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I was running some Analysis Services traces for some reason or another and ran across Chris Webb's post on (<a href="http://cwebbbi.spaces.live.com/Blog/cns!7B84B0F2C239489A!1660.entry">Visualising Analysis Services Trace Information in Reporting Services</a>).  After looking over that post, I thought it'd be interesting to visualize various types of processing, queries, etc - basically take a trace and then graph out what happened and when.  Here's a few samples of what the project yielded:</p>
<ul>
<li style="color: red;">Red: <em>Cube Processing on a 2 Minute schedule</em></li>
<li style="color: green;">Green: <em>Cube Processing on a 1 hour schedule</em></li>
<li style="color: blue;">Blue: <em>Cube Processing on a 1 hour schedule</em></li>
<li style="color: black;">Black: <em>Query Activity</em></li>
</ul>
<p><em>Most of the activity here is from SSRS subscriptions firing around 8AM </em><br />
<a href="http://timlaqua.com/wp-content/uploads/2009/10/8AM-MSRS-Subscription-Processing.png"><img src="http://timlaqua.com/wp-content/uploads/2009/10/8AM-MSRS-Subscription-Processing-300x174.png" alt="8AM MSRS Subscription Processing" title="8AM MSRS Subscription Processing" width="300" height="174" class="alignnone size-medium wp-image-269" /></a><br />
<span id="more-273"></span><br />
<em>This is the report filtered to only show events that had a duration greater than 10,000 MS (10 seconds) - Red cube is a trouble maker</em><br />
<a href="http://timlaqua.com/wp-content/uploads/2009/10/SSAS-Events-Longer-Than-10-Seconds.png"><img src="http://timlaqua.com/wp-content/uploads/2009/10/SSAS-Events-Longer-Than-10-Seconds-300x173.png" alt="SSAS Events Longer Than 10 Seconds" title="SSAS Events Longer Than 10 Seconds" width="300" height="173" class="alignnone size-medium wp-image-270" /></a></p>
<p><em>And this is general SSAS activity over a few hours with the nearly instant events filtered out</em><br />
<a href="http://timlaqua.com/wp-content/uploads/2009/10/General-SSAS-Activity-3-Hours.png"><img src="http://timlaqua.com/wp-content/uploads/2009/10/General-SSAS-Activity-3-Hours-300x173.png" alt="General SSAS Activity (3 Hours)" title="General SSAS Activity (3 Hours)" width="300" height="173" class="alignnone size-medium wp-image-271" /></a></p>
<p>The following query assumes that the trace data ended up in a table:</p>
<ul>
<li>@StartMillisecond: INT; <em>Minimum relative start time (millisecond value, kinda have to guess and check)</em></li>
<li>@EndMillisecond: INT; <em>Maximum relative start time (millisecond value, kinda have to guess and check)</em></li>
<li>@MinDuration: INT; <em>Minimum duration in milliseconds</em></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">;WITH <span style="color: #66cc66;">&#91;</span>ProcessEvent<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>
	<span style="color: #ff0000;">'Process'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>cast<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>TextData<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span> XML<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">.</span>value
		<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'declare namespace B=&quot;http://schemas.microsoft.com/analysisservices/2003/engine&quot;;           
		(//B:DatabaseID)[1]'</span>
		<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'VARCHAR(1024)'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>DatabaseID<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>cast<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>TextData<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span> XML<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">.</span>value
		<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'declare namespace B=&quot;http://schemas.microsoft.com/analysisservices/2003/engine&quot;;           
		(//B:DimensionID)[1]'</span>
		<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'VARCHAR(1024)'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>DimensionID<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>cast<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>TextData<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span> XML<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">.</span>value
		<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'declare namespace B=&quot;http://schemas.microsoft.com/analysisservices/2003/engine&quot;;           
		(//B:MeasureGroupID)[1]'</span>
		<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'VARCHAR(1024)'</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>MeasureGroupId<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>Duration<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> dbo<span style="color: #66cc66;">.</span>zTrace_MSAS_20091023_2 T
<span style="color: #993333; font-weight: bold;">WHERE</span> 
	T<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>EventClass<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">16</span> 
	<span style="color: #993333; font-weight: bold;">AND</span> T<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>EventSubclass<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">12</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #66cc66;">&#91;</span>TextData<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">'%Process%'</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
<span style="color: #66cc66;">&#91;</span>QueryEvent<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>
	<span style="color: #ff0000;">'Query'</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>DatabaseName<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>DatabaseID<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>DimensionID<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>MeasureGroupId<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>Duration<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">FROM</span> dbo<span style="color: #66cc66;">.</span>zTrace_MSAS_20091023_2 T
<span style="color: #993333; font-weight: bold;">WHERE</span> T<span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>EventClass<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">10</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
<span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">AS</span>
<span style="color: #66cc66;">&#40;</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#91;</span>ProcessEvent<span style="color: #66cc66;">&#93;</span>
	<span style="color: #993333; font-weight: bold;">UNION</span>
	<span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#91;</span>QueryEvent<span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>
	 ROW_NUMBER<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> OVER <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">ASC</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>EventId<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>DATEADD<span style="color: #66cc66;">&#40;</span>HOUR<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">-</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>DATEDIFF<span style="color: #66cc66;">&#40;</span>MILLISECOND<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> MIN<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> Event<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#91;</span>RelativeStartTime<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>Duration<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span><span style="color: #66cc66;">&#91;</span>DatabaseID<span style="color: #66cc66;">&#93;</span>
	<span style="color: #66cc66;">,</span>CASE
		WHEN <span style="color: #66cc66;">&#91;</span>DimensionID<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> THEN <span style="color: #ff0000;">'Dimension'</span>
		WHEN <span style="color: #66cc66;">&#91;</span>MeasureGroupID<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> THEN <span style="color: #ff0000;">'Measure Group'</span>
		ELSE <span style="color: #ff0000;">'None'</span>
	 END <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>ObjectType<span style="color: #66cc66;">&#93;</span>	<span style="color: #66cc66;">,</span>CASE
		WHEN <span style="color: #66cc66;">&#91;</span>DimensionID<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> THEN <span style="color: #66cc66;">&#91;</span>DimensionID<span style="color: #66cc66;">&#93;</span>
		WHEN <span style="color: #66cc66;">&#91;</span>MeasureGroupID<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span> THEN <span style="color: #66cc66;">&#91;</span>MeasureGroupID<span style="color: #66cc66;">&#93;</span>
		ELSE <span style="color: #ff0000;">'None'</span>
	 END <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #66cc66;">&#91;</span>ObjectId<span style="color: #66cc66;">&#93;</span>	
<span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #66cc66;">&#91;</span>Event<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">WHERE</span>
	DATEDIFF<span style="color: #66cc66;">&#40;</span>MILLISECOND<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> MIN<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> Event<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;=</span> @StartMillisecond
	<span style="color: #993333; font-weight: bold;">AND</span> DATEDIFF<span style="color: #66cc66;">&#40;</span>MILLISECOND<span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> MIN<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> Event<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #66cc66;">&#91;</span>StartTime<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&lt;</span> @EndMillisecond
	<span style="color: #993333; font-weight: bold;">AND</span> Duration <span style="color: #66cc66;">&gt;=</span> @MinDuration</pre></div></div>

<p>A few notes on the report:</p>
<ul>
<li>[EventId] is the Series Group</li>
<li>This is a Range chart type, the Bottom value was [RelativeStartTime] and the Top value was [RelativeStartTime] + [Duration]</li>
<li>Coloring the series and markers uses the following expression

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">=</span>Iif<span style="color: #000000;">&#40;</span>Fields<span style="color: #008000;">!</span><span style="color: #0600FF;">Event</span>.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Process&quot;</span>
	,Iif<span style="color: #000000;">&#40;</span>Fields<span style="color: #008000;">!</span>DatabaseID.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;SSASDB&quot;</span>
		,<span style="color: #666666;">&quot;Red&quot;</span>
		,Iif<span style="color: #000000;">&#40;</span>Fields<span style="color: #008000;">!</span>DatabaseID.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;OtherSSASDB&quot;</span>
			,<span style="color: #666666;">&quot;Green&quot;</span>
			,Iif<span style="color: #000000;">&#40;</span>Fields<span style="color: #008000;">!</span>DatabaseID.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;YetAnotherSSASDB&quot;</span>
				,<span style="color: #666666;">&quot;Blue&quot;</span>
				,<span style="color: #666666;">&quot;Pink&quot;</span>
			<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#41;</span>
	,<span style="color: #666666;">&quot;Black&quot;</span>
<span style="color: #000000;">&#41;</span></pre></div></div>

</li>
</ul>
<p>And that's about it - if you have any more questions about it just let me know.  Just seemed like an interesting way to look at trace data <img src='http://timlaqua.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   It also wouldn't be that difficult to generate events for other things, like your ETL processing and such so you could see that on top of everything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/10/charting-analysis-services-2008-trace-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reporting Services (SSRS/MSRS) 2008 Error: Set used with the complement operator must have all members from the same level</title>
		<link>http://timlaqua.com/2009/10/reporting-services-ssrsmsrs-2008-error-set-used-with-the-complement-operator-must-have-all-members-from-the-same-level/</link>
		<comments>http://timlaqua.com/2009/10/reporting-services-ssrsmsrs-2008-error-set-used-with-the-complement-operator-must-have-all-members-from-the-same-level/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 19:38:06 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[mdx]]></category>
		<category><![CDATA[msrs]]></category>
		<category><![CDATA[reporting services]]></category>
		<category><![CDATA[ssrs]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=244</guid>
		<description><![CDATA[When you use the Not In operator in a SSRS 2008 MDX query filter to exclude a named set, it uses a the complement operator in the constructed MDX. This is fine as long as "all members [are] from the same level." Since you got this error, they are not You can get around this [...]]]></description>
			<content:encoded><![CDATA[<p>When you use the <strong>Not In</strong> operator in a SSRS 2008 MDX query filter to exclude a named set, it uses a the complement operator in the constructed MDX.  This is fine as long as "all members [are] from the same level."  Since you got this error, they are not <img src='http://timlaqua.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />   You can get around this by using the Except() MDX function instead of letting SSRS use the Complement operator</p>
<p>In the ReportServerService log, you'll see something like this:<br />
<em>Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException: Query (..., ...) Set used with the complement operator must have all members from the same level.</em></p>
<p><u>Original filter</u><br />
Dimension: <strong>Time</strong><br />
Hierarchy: <strong>Calendar Date</strong><br />
Operator: <strong>Not In</strong><br />
Filter Expression: <strong>[Today]</strong></p>
<p><u>New filter</u><br />
Dimension: <strong>Time</strong><br />
Hierarchy: <strong>Calendar Date</strong><br />
Operator: <strong>MDX</strong><br />
Filter Expression: <strong>Except([Time].[Calendar Date].[Calendar Date].MEMBERS, [Today])</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/10/reporting-services-ssrsmsrs-2008-error-set-used-with-the-complement-operator-must-have-all-members-from-the-same-level/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maintaining a Type 1 Slowly Changing Dimension (SCD) using T-SQL</title>
		<link>http://timlaqua.com/2009/05/maintaining-a-type-1-slowly-changing-dimension-scd-using-t-sql/</link>
		<comments>http://timlaqua.com/2009/05/maintaining-a-type-1-slowly-changing-dimension-scd-using-t-sql/#comments</comments>
		<pubDate>Sat, 23 May 2009 16:37:35 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[data warehouse]]></category>
		<category><![CDATA[scd]]></category>
		<category><![CDATA[slowly changing dimension]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[ssis]]></category>
		<category><![CDATA[t-sql]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=224</guid>
		<description><![CDATA[A few days ago, one of our SSIS packages that maintained a Type 1 Slowly Changing Dimension (SCD) of about 1 million rows crept up to 15 minutes of runtime. Now this doesn't sound too bad, but this is part of our hourly batches, so 15 minutes is 25% of our entire processing window. The [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, one of our SSIS packages that maintained a Type 1 Slowly Changing Dimension (SCD) of about 1 million rows crept up to 15 minutes of runtime.  Now this doesn't sound too bad, but this is part of our hourly batches, so 15 minutes is 25% of our entire processing window.  The package was using the Slowly Changing Dimension Wizard transformation - we were doing the standard OLEDB Source (which basically represented how the SCD "should" look) and then sending it to the SCD transform and letting it figure out what needed to be inserted and updated.  One option was to switch to lookups instead of the SCD wizard to speed things up, maybe even some fancy checksum voodoo for the updates (see <a href="http://blog.stevienova.com/2008/11/22/ssis-slowly-changing-dimensions-with-checksum/">http://blog.stevienova.com/2008/11/22/ssis-slowly-changing-dimensions-with-checksum/</a> for an example).  Then after thinking about it a little more - why are we sending a million rows down the pipeline every hour?  We know only a small percentage of these are new - and another small percentage needs to be updated.  Well, we can just write a quick SQL query to get us just those sets and the package would be much more efficient!  </p>
<p>Wait a tick - why would we give the rows to SSIS if all it is going to do insert one set and update the other?  Let's just do it all in T-SQL:<span id="more-224"></span></p>
<p><em>The following tables and dim are fictional - I just need to make up a star schema DIM to illustrate the approach</em></p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> #Temp_SCDInserts <span style="color: #808080;">&#40;</span><span style="color: #808080;">&#91;</span>PartId<span style="color: #808080;">&#93;</span> <span style="color: #0000FF;">INT</span><span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #008080;">-- INSERTS for new Parts</span>
<span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> #Temp_SCDInserts
<span style="color: #0000FF;">SELECT</span>   
	<span style="color: #808080;">&#91;</span>PartId<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">FROM</span> 
	Part a <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartType b <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartTypeId</span> <span style="color: #808080;">=</span> b.<span style="color: #202020;">PartTypeId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplier c <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartSupplierId</span> <span style="color: #808080;">=</span> c.<span style="color: #202020;">PartSupplierId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplierCategory d <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> c.<span style="color: #202020;">PartSupplierCategoryId</span> <span style="color: #808080;">=</span> d.<span style="color: #202020;">PartSupplierCategoryId</span>
<span style="color: #0000FF;">EXCEPT</span>
<span style="color: #0000FF;">SELECT</span>
	<span style="color: #808080;">&#91;</span>PartId<span style="color: #808080;">&#93;</span>	
<span style="color: #0000FF;">FROM</span>
	DW.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">Dim_Part</span> <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span>
&nbsp;
<span style="color: #008080;">-- UPDATES</span>
<span style="color: #0000FF;">SELECT</span> 
	 dim.<span style="color: #808080;">&#91;</span>PartKeyId<span style="color: #808080;">&#93;</span>
	,a.<span style="color: #808080;">&#91;</span>PartName<span style="color: #808080;">&#93;</span>
	,b.<span style="color: #808080;">&#91;</span>PartTypeId<span style="color: #808080;">&#93;</span>
	,b.<span style="color: #808080;">&#91;</span>PartTypeName<span style="color: #808080;">&#93;</span>
	,c.<span style="color: #808080;">&#91;</span>PartSupplierId<span style="color: #808080;">&#93;</span>
	,c.<span style="color: #808080;">&#91;</span>PartSupplierName<span style="color: #808080;">&#93;</span>
	,d.<span style="color: #808080;">&#91;</span>PartSupplierCategoryId<span style="color: #808080;">&#93;</span>
	,d.<span style="color: #808080;">&#91;</span>PartSupplierCategoryName<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">INTO</span> #Temp_SCDUpdates
<span style="color: #0000FF;">FROM</span> DW.<span style="color: #202020;">dbo</span>.<span style="color: #202020;">Dim_Part</span> dim <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> Part a <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span>
		<span style="color: #0000FF;">ON</span> dim.<span style="color: #202020;">PartId</span> <span style="color: #808080;">=</span> a.<span style="color: #202020;">PartId</span> <span style="color: #008080;">-- Business Key</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartType b <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartTypeId</span> <span style="color: #808080;">=</span> b.<span style="color: #202020;">PartTypeId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplier c <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartSupplierId</span> <span style="color: #808080;">=</span> c.<span style="color: #202020;">PartSupplierId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplierCategory d <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> c.<span style="color: #202020;">PartSupplierCategoryId</span> <span style="color: #808080;">=</span> d.<span style="color: #202020;">PartSupplierCategoryId</span>
<span style="color: #0000FF;">WHERE</span>
	dim.<span style="color: #202020;">PartName</span> <span style="color: #808080;">&lt;&gt;</span> a.<span style="color: #202020;">PartName</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartTypeId</span> <span style="color: #808080;">&lt;&gt;</span> b.<span style="color: #202020;">PartTypeId</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartTypeName</span> <span style="color: #808080;">&lt;&gt;</span> b.<span style="color: #202020;">PartTypeName</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartSupplierId</span> <span style="color: #808080;">&lt;&gt;</span> c.<span style="color: #202020;">PartSupplierId</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartSupplierName</span> <span style="color: #808080;">&lt;&gt;</span> c.<span style="color: #202020;">PartSupplierName</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartSupplierCategoryId</span> <span style="color: #808080;">&lt;&gt;</span> d.<span style="color: #202020;">PartSupplierCategoryId</span>
	<span style="color: #808080;">OR</span> dim.<span style="color: #202020;">PartSupplierCategoryName</span>	<span style="color: #808080;">&lt;&gt;</span> d.<span style="color: #202020;">PartSupplierCategoryName</span>
&nbsp;
<span style="color: #008080;">-- INSERT new records</span>
<span style="color: #0000FF;">INSERT</span> <span style="color: #0000FF;">INTO</span> <span style="color: #808080;">&#91;</span>DW<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Dim_Part<span style="color: #808080;">&#93;</span>
	<span style="color: #808080;">&#40;</span><span style="color: #808080;">&#91;</span>PartId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartTypeId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartTypeName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierCategoryId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierCategoryName<span style="color: #808080;">&#93;</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">SELECT</span> 
	 a.<span style="color: #808080;">&#91;</span>PartId<span style="color: #808080;">&#93;</span>
	,a.<span style="color: #808080;">&#91;</span>PartName<span style="color: #808080;">&#93;</span>
	,b.<span style="color: #808080;">&#91;</span>PartTypeId<span style="color: #808080;">&#93;</span>
	,b.<span style="color: #808080;">&#91;</span>PartTypeName<span style="color: #808080;">&#93;</span>
	,c.<span style="color: #808080;">&#91;</span>PartSupplierId<span style="color: #808080;">&#93;</span>
	,c.<span style="color: #808080;">&#91;</span>PartSupplierName<span style="color: #808080;">&#93;</span>
	,d.<span style="color: #808080;">&#91;</span>PartSupplierCategoryId<span style="color: #808080;">&#93;</span>
	,d.<span style="color: #808080;">&#91;</span>PartSupplierCategoryName<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">FROM</span> #Temp_SCDInserts i
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> Part a <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span>
		<span style="color: #0000FF;">ON</span> i.<span style="color: #202020;">PartId</span> <span style="color: #808080;">=</span> a.<span style="color: #202020;">PartId</span> <span style="color: #008080;">-- Business Key</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartType b <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartTypeId</span> <span style="color: #808080;">=</span> b.<span style="color: #202020;">PartTypeId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplier c <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartSupplierId</span> <span style="color: #808080;">=</span> c.<span style="color: #202020;">PartSupplierId</span>
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> PartSupplierCategory d <span style="color: #0000FF;">WITH</span><span style="color: #808080;">&#40;</span>NOLOCK<span style="color: #808080;">&#41;</span> 
		<span style="color: #0000FF;">ON</span> c.<span style="color: #202020;">PartSupplierCategoryId</span> <span style="color: #808080;">=</span> d.<span style="color: #202020;">PartSupplierCategoryId</span>
&nbsp;
<span style="color: #008080;">-- UPDATE existing records</span>
<span style="color: #0000FF;">UPDATE</span> <span style="color: #808080;">&#91;</span>DW<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Dim_Part<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">SET</span>
	 <span style="color: #808080;">&#91;</span>PartName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartTypeId<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartTypeId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartTypeName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartTypeName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierId<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartSupplierId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartSupplierName<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierCategoryId<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartSupplierCategoryId<span style="color: #808080;">&#93;</span>
	,<span style="color: #808080;">&#91;</span>PartSupplierCategoryName<span style="color: #808080;">&#93;</span> <span style="color: #808080;">=</span> b.<span style="color: #808080;">&#91;</span>PartSupplierCategoryName<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">FROM</span> 
	<span style="color: #808080;">&#91;</span>DW<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>dbo<span style="color: #808080;">&#93;</span>.<span style="color: #808080;">&#91;</span>Dim_Part<span style="color: #808080;">&#93;</span> <span style="color: #0000FF;">AS</span> a
	<span style="color: #0000FF;">INNER</span> <span style="color: #808080;">JOIN</span> #Temp_SCDUpdates <span style="color: #0000FF;">AS</span> b 
		<span style="color: #0000FF;">ON</span> a.<span style="color: #202020;">PartKeyId</span> <span style="color: #808080;">=</span> b.<span style="color: #202020;">PartKeyId</span>  <span style="color: #008080;">-- Join on Business Keys or Surrogate Key</span>
&nbsp;
&nbsp;
<span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">TABLE</span> #Temp_SCDInserts
<span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">TABLE</span> #Temp_SCDUpdates</pre></div></div>

<p>The results?  Our 15 minute SSIS package has been replaced with a few lines of T-SQL and it now runs in less than 90 seconds.  Nice.</p>
]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/05/maintaining-a-type-1-slowly-changing-dimension-scd-using-t-sql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Quick Analysis of Cached Query Plans in SQL Server 2005</title>
		<link>http://timlaqua.com/2009/05/quick-analysis-of-cached-query-plans-in-sql-server-2005/</link>
		<comments>http://timlaqua.com/2009/05/quick-analysis-of-cached-query-plans-in-sql-server-2005/#comments</comments>
		<pubDate>Fri, 15 May 2009 21:55:03 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[bi]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[hash match]]></category>
		<category><![CDATA[merge join]]></category>
		<category><![CDATA[nested loop]]></category>
		<category><![CDATA[query plan]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=207</guid>
		<description><![CDATA[I run this one pretty frequently when we need to figure out what procs are killing a complex ETL process and what exactly about them is making the server cry. So basically, if it's on the development server, I'll do a DBCC FREEPROCCACHE and a DBCC DROPCLEANBUFFERS, run the entire set of ETLs, then run [...]]]></description>
			<content:encoded><![CDATA[<p>I run this one pretty frequently when we need to figure out what procs are killing a complex ETL process and what exactly about them is making the server cry.  So basically, if it's on the development server, I'll do a <code>DBCC FREEPROCCACHE</code> and a <code>DBCC DROPCLEANBUFFERS</code>, run the entire set of ETLs, then run this query and then dig deeper in to the query plans that look suspect (high *Scan counts usually, sometimes lots of Hash Matches or Merge Joins).  On a production server, the clearing of the proc cache and dropcleanbuffers can be problematic so I'll often just run the query after a scheduled ETL run.  If you want to see the query plans mapped out visually, click on the query_plan value and SSMS will open up the XML.  Then save that XML file as a .sqlplan file.  Once you have that, close the XML and then open the .sqlplan file.<span id="more-207"></span></p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SELECT</span>
	 DatabaseName
	,ObjectName
	,<span style="color: #0000FF;">CAST</span><span style="color: #808080;">&#40;</span>query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		sum((/QP:ShowPlanXML/QP:BatchSequence/QP:Batch/QP:Statements/QP:StmtSimple/QP:QueryPlan/@CompileTime))'</span>,<span style="color: #FF0000;">'NVARCHAR(MAX)'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #0000FF;">FLOAT</span><span style="color: #808080;">&#41;</span><span style="color: #808080;">/</span><span style="color: #000;">1000.0</span><span style="color: #808080;">/</span><span style="color: #000;">60.0</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>CompileTime<span style="color: #808080;">&#93;</span>
	,query_plan
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:ColumnsWithNoStatistics))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>ColumnsWithNoStatistics<span style="color: #808080;">&#93;</span>
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:TableScan))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>TableScan<span style="color: #808080;">&#93;</span>
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:IndexScan))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>IndexScan<span style="color: #808080;">&#93;</span>
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:RelOp[@PhysicalOp=&quot;Nested Loops&quot;]))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>NestedLoop<span style="color: #808080;">&#93;</span>
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:RelOp[@PhysicalOp=&quot;Hash Match&quot;]))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>HashMatch<span style="color: #808080;">&#93;</span>
	,query_plan.<span style="color: #0000FF;">VALUE</span><span style="color: #808080;">&#40;</span><span style="color: #FF0000;">'
		declare namespace QP=&quot;http://schemas.microsoft.com/sqlserver/2004/07/showplan&quot;;   
		count((//QP:RelOp[@PhysicalOp=&quot;Merge Join&quot;]))'</span>,<span style="color: #FF0000;">'INT'</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> <span style="color: #808080;">&#91;</span>MergeJoin<span style="color: #808080;">&#93;</span>
<span style="color: #0000FF;">FROM</span> 
	<span style="color: #808080;">&#40;</span>	
		<span style="color: #0000FF;">SELECT</span>
			<span style="color: #FF00FF;">OBJECT_NAME</span><span style="color: #808080;">&#40;</span>st.<span style="color: #202020;">objectid</span>,st.<span style="color: #202020;">dbid</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> ObjectName,
			<span style="color: #FF00FF;">DB_NAME</span><span style="color: #808080;">&#40;</span>st.<span style="color: #202020;">dbid</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> DatabaseName,
			st.<span style="color: #202020;">dbid</span>,
			st.<span style="color: #202020;">objectid</span>,
			qs.<span style="color: #202020;">plan_handle</span>
		<span style="color: #0000FF;">FROM</span> 
			sys.<span style="color: #202020;">dm_exec_query_stats</span> <span style="color: #0000FF;">AS</span> qs
			<span style="color: #808080;">CROSS</span> APPLY sys.<span style="color: #202020;">dm_exec_sql_text</span><span style="color: #808080;">&#40;</span>qs.<span style="color: #202020;">sql_handle</span><span style="color: #808080;">&#41;</span> <span style="color: #0000FF;">AS</span> st
		<span style="color: #0000FF;">WHERE</span>
			ObjectId <span style="color: #0000FF;">IS</span> <span style="color: #808080;">NOT</span> <span style="color: #808080;">NULL</span>
		<span style="color: #0000FF;">GROUP</span> <span style="color: #0000FF;">BY</span>
			st.<span style="color: #202020;">dbid</span>,
			st.<span style="color: #202020;">objectid</span>,
			qs.<span style="color: #202020;">plan_handle</span>
	<span style="color: #808080;">&#41;</span> a
	<span style="color: #808080;">CROSS</span> APPLY sys.<span style="color: #202020;">dm_exec_query_plan</span><span style="color: #808080;">&#40;</span>plan_handle<span style="color: #808080;">&#41;</span> qp
<span style="color: #0000FF;">WHERE</span> DatabaseName <span style="color: #808080;">=</span> <span style="color: #FF0000;">'NameOfDatabase'</span>
<span style="color: #0000FF;">ORDER</span> <span style="color: #0000FF;">BY</span> DatabaseName, ObjectName</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/05/quick-analysis-of-cached-query-plans-in-sql-server-2005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Windows Event Log Logging To Existing SSIS Packages via C#</title>
		<link>http://timlaqua.com/2009/03/adding-windows-event-log-logging-to-existing-ssis-packages-via-c/</link>
		<comments>http://timlaqua.com/2009/03/adding-windows-event-log-logging-to-existing-ssis-packages-via-c/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 02:19:45 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[Scripts & Code]]></category>
		<category><![CDATA[business intelligence]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[integration services]]></category>
		<category><![CDATA[ssis]]></category>

		<guid isPermaLink="false">http://timlaqua.com/?p=182</guid>
		<description><![CDATA[While working with some SSIS logging, it occured to me that there's really no good way to globally apply the same logging to all packages on your server. For our production SSIS server, it would make sense to log all OnError events to the Application Event log. Then, whatever event log monitoring app you use [...]]]></description>
			<content:encoded><![CDATA[<p>While working with some SSIS logging, it occured to me that there's really no good way to globally apply the same logging to all packages on your server.  For our production SSIS server, it would make sense to log all OnError events to the Application Event log.  Then, whatever event log monitoring app you use can notify you of the package error (with details!).  Thus, this app was born - an app to remove pre-existing LogProviders and add in the intended LogProvider and options.</p>
<p>This is really just an example of the implementation that worked for my purposes - I'm sure some of you would prefer to log elsewhere.  This should be enough to get you going.  Please drop a line in the Comments if you post alternative approaches.</p>
<p><u>Usage</u></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">SSISForcedLogging.Console.exe &quot;Z:\SSIS Packages&quot;
or
SSISForcedLogging.Console.Exe &quot;Z:\SSIS Packages\Package1.dtsx&quot;</pre></div></div>

<p><span id="more-182"></span><br />
For the following code, be sure to add References to:</p>
<ul>
<li>Microsoft.SqlServer.ManagedDTS</li>
<li>System.configuration</li>
</ul>
<p><u>Program.cs</u></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Configuration</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">Microsoft.SqlServer.Dts.Runtime</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Reflection</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> SSISForcedLogging.<span style="color: #0000FF;">Console</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #FF0000;">class</span> ColumnFilter
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> Computer<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> DataBytes<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> ExecutionID<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> MessageText<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> Operator<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> SourceID<span style="color: #008000;">;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">bool</span> SourceName<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> DTSEventColumnFilter GetDTSEventColumnFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            DTSEventColumnFilter dtsEventColumnFilter <span style="color: #008000;">=</span> 
                <span style="color: #008000;">new</span> DTSEventColumnFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">DataBytes</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">DataBytes</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">Computer</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Computer</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">ExecutionID</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">ExecutionID</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">MessageText</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">MessageText</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0600FF;">Operator</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">Operator</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">SourceID</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SourceID</span><span style="color: #008000;">;</span>
            dtsEventColumnFilter.<span style="color: #0000FF;">SourceName</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">SourceName</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">return</span> dtsEventColumnFilter<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #FF0000;">class</span> Program
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>args.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">!=</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Console</span>.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>
                    <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\n</span>Please specify a package path or directory<span style="color: #008080; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Environment.<span style="color: #0000FF;">Exit</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #FF0000;">string</span> arg <span style="color: #008000;">=</span> args<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> packages <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>File.<span style="color: #0000FF;">Exists</span><span style="color: #000000;">&#40;</span>arg<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                packages.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>arg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span> <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>Directory.<span style="color: #0000FF;">Exists</span><span style="color: #000000;">&#40;</span>arg<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                packages <span style="color: #008000;">=</span> GetPackagesFromDirectory<span style="color: #000000;">&#40;</span>arg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">else</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Console</span>.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>
                    <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\n</span>Invalid package path or directory specified<span style="color: #008080; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Environment.<span style="color: #0000FF;">Exit</span><span style="color: #000000;">&#40;</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> pkgPath <span style="color: #0600FF;">in</span> packages<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Console</span>.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>
                    <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Updating: {0}&quot;</span>, pkgPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Application dts <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Application<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Package pkg <span style="color: #008000;">=</span> dts.<span style="color: #0000FF;">LoadPackage</span><span style="color: #000000;">&#40;</span>pkgPath, <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                RemoveOldLogsFromPackage<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> pkg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                AddLogToPackage<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> pkg<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
                <span style="color: #000000;">System</span>.<span style="color: #0000FF;">Console</span>.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span>
                    <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Saving: {0}&quot;</span>, pkgPath<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                dts.<span style="color: #0000FF;">SaveToXml</span><span style="color: #000000;">&#40;</span>pkgPath, pkg, <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> AddLogToPackage<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> Package Pkg<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// Add new provider</span>
            Pkg.<span style="color: #0000FF;">LoggingMode</span> <span style="color: #008000;">=</span> DTSLoggingMode.<span style="color: #0000FF;">Enabled</span><span style="color: #008000;">;</span>
&nbsp;
            LogProvider log <span style="color: #008000;">=</span> Pkg.<span style="color: #0000FF;">LogProviders</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>
                ConfigurationManager.<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;logType&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            log.<span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> 
                ConfigurationManager.<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;logName&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            log.<span style="color: #0000FF;">Description</span> <span style="color: #008000;">=</span> 
                ConfigurationManager.<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;logDesc&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            Pkg.<span style="color: #0000FF;">LoggingOptions</span>.<span style="color: #0000FF;">SelectedLogProviders</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>log<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            LoggingOptions logOptions <span style="color: #008000;">=</span> Pkg.<span style="color: #0000FF;">LoggingOptions</span><span style="color: #008000;">;</span>
            logOptions.<span style="color: #0000FF;">EventFilterKind</span> <span style="color: #008000;">=</span> DTSEventFilterKind.<span style="color: #0000FF;">Inclusion</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> events <span style="color: #008000;">=</span> 
                ConfigurationManager
                    .<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;eventsToLog&quot;</span><span style="color: #000000;">&#93;</span>
                        .<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">','</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            logOptions.<span style="color: #0000FF;">EventFilter</span> <span style="color: #008000;">=</span> events<span style="color: #008000;">;</span>
&nbsp;
            ArrayList columnList <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ArrayList<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            columnList.<span style="color: #0000FF;">AddRange</span><span style="color: #000000;">&#40;</span>
                ConfigurationManager
                    .<span style="color: #0000FF;">AppSettings</span><span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;columnsToLog&quot;</span><span style="color: #000000;">&#93;</span>
                        .<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">','</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            ColumnFilter eventColumnFilter <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ColumnFilter<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>FieldInfo field <span style="color: #0600FF;">in</span> 
                     eventColumnFilter.<span style="color: #0000FF;">GetType</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">GetFields</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>columnList.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span>field.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                    field.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>eventColumnFilter, <span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            logOptions.<span style="color: #0000FF;">SetColumnFilter</span><span style="color: #000000;">&#40;</span>
                <span style="color: #666666;">&quot;OnError&quot;</span>, 
                eventColumnFilter.<span style="color: #0000FF;">GetDTSEventColumnFilter</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> RemoveOldLogsFromPackage<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> Package Pkg<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// Remove existing log provider selections</span>
            <span style="color: #FF0000;">int</span> count <span style="color: #008000;">=</span> Pkg.<span style="color: #0000FF;">LoggingOptions</span>.<span style="color: #0000FF;">SelectedLogProviders</span>.<span style="color: #0000FF;">Count</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> count<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span>
                Pkg.<span style="color: #0000FF;">LoggingOptions</span>.<span style="color: #0000FF;">SelectedLogProviders</span>.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">// Remove existing log providers</span>
            count <span style="color: #008000;">=</span> Pkg.<span style="color: #0000FF;">LogProviders</span>.<span style="color: #0000FF;">Count</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> count<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span>
                Pkg.<span style="color: #0000FF;">LogProviders</span>.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            RemoveOldLogsFromExecutable<span style="color: #000000;">&#40;</span>Pkg.<span style="color: #0000FF;">Executables</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> RemoveOldLogsFromExecutable<span style="color: #000000;">&#40;</span>Executables Execs<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #008080; font-style: italic;">// reflection ftw</span>
            <span style="color: #FF0000;">int</span> count<span style="color: #008000;">;</span>
            <span style="color: #0600FF;">foreach</span><span style="color: #000000;">&#40;</span>Executable exec <span style="color: #0600FF;">in</span> Execs<span style="color: #000000;">&#41;</span> 
            <span style="color: #000000;">&#123;</span>
                <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>PropertyInfo prop <span style="color: #0600FF;">in</span> 
                         exec.<span style="color: #0000FF;">GetType</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">GetProperties</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #000000;">&#123;</span>
                    <span style="color: #0600FF;">switch</span><span style="color: #000000;">&#40;</span>prop.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                        <span style="color: #0600FF;">case</span> <span style="color: #666666;">&quot;LoggingMode&quot;</span><span style="color: #008000;">:</span>
                            prop.<span style="color: #0000FF;">SetValue</span><span style="color: #000000;">&#40;</span>
                                exec, 
                                DTSLoggingMode.<span style="color: #0000FF;">UseParentSetting</span>, 
                                <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                            break<span style="color: #008000;">;</span>
                        <span style="color: #0600FF;">case</span> <span style="color: #666666;">&quot;LoggingOptions&quot;</span><span style="color: #008000;">:</span>
                            LoggingOptions opts <span style="color: #008000;">=</span> 
                                prop.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>
                                    exec, 
                                    <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">as</span> LoggingOptions<span style="color: #008000;">;</span>
&nbsp;
                            count <span style="color: #008000;">=</span> opts.<span style="color: #0000FF;">SelectedLogProviders</span>.<span style="color: #0000FF;">Count</span><span style="color: #008000;">;</span>
                            <span style="color: #0600FF;">for</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> count<span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span>
                                opts.<span style="color: #0000FF;">SelectedLogProviders</span>.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>i<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                            break<span style="color: #008000;">;</span>
                        <span style="color: #0600FF;">case</span> <span style="color: #666666;">&quot;Executables&quot;</span><span style="color: #008000;">:</span>
                            Executables execs <span style="color: #008000;">=</span> 
                                prop.<span style="color: #0000FF;">GetValue</span><span style="color: #000000;">&#40;</span>
                                exec, 
                                <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span> <span style="color: #0600FF;">as</span> Executables<span style="color: #008000;">;</span>
                            RemoveOldLogsFromExecutable<span style="color: #000000;">&#40;</span>execs<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                            break<span style="color: #008000;">;</span>
                    <span style="color: #000000;">&#125;</span>
                <span style="color: #000000;">&#125;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> GetPackagesFromDirectory<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> Path<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span> files <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> List<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">string</span><span style="color: #008000;">&gt;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> d <span style="color: #0600FF;">in</span> Directory.<span style="color: #0000FF;">GetDirectories</span><span style="color: #000000;">&#40;</span>Path<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> f <span style="color: #0600FF;">in</span> GetPackagesFromDirectory<span style="color: #000000;">&#40;</span>d<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                    files.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>f<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> f <span style="color: #0600FF;">in</span> Directory.<span style="color: #0000FF;">GetFiles</span><span style="color: #000000;">&#40;</span>Path, <span style="color: #666666;">&quot;*.dtsx&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                files.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>f<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">return</span> files<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p><u>App.config</u></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;logType&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;DTS.LogProviderEventLog.1&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;logName&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Windows Event Log Logging Provider (Forced)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;logDesc&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Logs Event info to Windows Event Log (Forced)&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;eventsToLog&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;OnError&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;columnsToLog&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;Computer,Operator,SourceName,SourceID,ExecutionID,MessageText&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	   <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://timlaqua.com/2009/03/adding-windows-event-log-logging-to-existing-ssis-packages-via-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

