<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Sherry&#039;s BI Corner</title>
	<atom:link href="http://bisherryli.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bisherryli.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sat, 28 Jan 2012 03:17:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='bisherryli.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sherry&#039;s BI Corner</title>
		<link>http://bisherryli.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://bisherryli.wordpress.com/osd.xml" title="Sherry&#039;s BI Corner" />
	<atom:link rel='hub' href='http://bisherryli.wordpress.com/?pushpress=hub'/>
		<item>
		<title>SSIS #107 &#8211; Parameterized Query in OLE DB Data Source: parameter information cannot be derived from SQL statements with sub-select queries</title>
		<link>http://bisherryli.wordpress.com/2012/01/27/ssis-107-parameterized-query-in-ole-db-data-source-parameter-information-cannot-be-derived-from-sql-statements-with-sub-select-queries/</link>
		<comments>http://bisherryli.wordpress.com/2012/01/27/ssis-107-parameterized-query-in-ole-db-data-source-parameter-information-cannot-be-derived-from-sql-statements-with-sub-select-queries/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 03:04:11 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSIS Best Practices]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2333</guid>
		<description><![CDATA[I have a few posts blogging about how to pass variables into parameterized queries into Execute SQL Task and OLE DB Data Source in a data flow. SSIS #101 – Use expressions to pass parameters to ADO.NET Source SSIS #99 – Pass a date time parameter to the Execute SQL Task SSIS – Pass a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2333&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a few posts blogging about how to pass variables into parameterized queries into Execute SQL Task and OLE DB Data Source in a data flow.</p>
<ul>
<li>
<h4><a href="http://bisherryli.wordpress.com/2011/09/30/ssis-101-use-expressions-to-pass-parameters-to-ado-net-source/"><font size="2">SSIS #101 – Use expressions to pass parameters to ADO.NET Source</font></a></h4>
</li>
<li>
<h4><a href="http://bisherryli.wordpress.com/2011/08/27/ssis-99-pass-a-date-time-parameter-to-the-execute-sql-task/"><font size="2">SSIS #99 – Pass a date time parameter to the Execute SQL Task</font></a></h4>
</li>
<li><a href="http://bisherryli.wordpress.com/2011/03/06/ssis-pass-a-variable-to-a-ole-db-source-in-a-data-flow/#comment-249"><font size="2">SSIS – Pass a variable to a OLE DB Source in a Data Flow</font></a> </li>
<li><a href="http://bisherryli.wordpress.com/2011/03/13/ssis-pass-a-list-of-values-to-a-data-flow-source/"><font size="2">SSIS – Pass a list of values to a data flow source</font></a> </li>
</ul>
<p>As you gain more confidence in SSIS, you start to design your ETL process with higher efficiency and higher portability. That means using more variables, and more package configuration files. This is when you will start to hit the limitations. One of the limitations that is relevant to this topic comes from this unfortunate message:</p>
<h4><strong>Parameter information cannot be derived from SQL statements with sub-select queries</strong></h4>
<p>This message is generated from an OLE DB Data Source in a data flow. It has a simple SQL command, but with a parameter inside a sub-query.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image15.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb15.png?w=581&#038;h=350" width="581" height="350" /></a>&#160; </p>
<p>This is what you will see when you try to Preview or click the Parameters… button.</p>
<p>&#160; <a href="http://bisherryli.files.wordpress.com/2012/01/image16.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb16.png?w=573&#038;h=175" width="573" height="175" /></a> </p>
<p>This is a very interesting message actually. It is telling us why SSIS refuses to accept the query because a parameter is inside a sub-query. It also gives us a very interesting recommendation, that is to use the “SQL command from variable” mode.</p>
<p>Another recommendation Microsoft might have given us here is to create a stored procedure with parameters. It didn’t, because creating stored procedures is essentially taking us away from Integration Services, and back to the SQL Server land. I guess the Integration Services designers wouldn’t want that to happen.</p>
<p>Integration Services’ inability to parse SQL statements with parameters inside sub-select queries comes from the OLE DB provider. In my case, we are using the native OLE DB native provider. You would think that this provider will be “smarter” than other providers, such as OLE DB provider for Oracle. Unfortunately, no privilege here.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image17.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb17.png?w=610&#038;h=80" width="610" height="80" /></a> </p>
<h4><strong>Use “SQL command from variable” for OLE DB Data Source</strong></h4>
<p>I don’t want to go back to the SQL Server land, so following the above recommendation is my choice. The screenshots and steps I am sharing with you here are really backwards in order. If you want to implement this recommendation in your own package, you will need to follow the steps below in backward order.&#160; </p>
<p>To follow the recommendation from Microsoft, you will need to change the <strong>Data access mode</strong> from SQL command to <strong>SQL command from variable.</strong></p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image18.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb18.png?w=420&#038;h=370" width="420" height="370" /></a> </p>
<p><strong>Select the user variable you have created that stores the query as an expression</strong>. You should see that your parameter(s) are actually showing the values you have assigned to the variable(s).</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image19.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb19.png?w=494&#038;h=310" width="494" height="310" /></a> </p>
<h4><strong>Create a variable to store the parameterized query</strong></h4>
<p>This is the package-scope variable I’ve created to store the parameterized query.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image20.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb20.png?w=374&#038;h=137" width="374" height="137" /></a> </p>
<p>To make this work, there are a few things you will need to pay attention to:</p>
<p>1) The data type of this variable should be String. A word of caution here. My query has sub-query, but it’s really a very simple query. If you have a query that is very complicated, and possibly exceeds the max length of a String data type, then the recommendation from Microsoft is not really a good choice for you. Going back to the SQL Server land to create a stored procedure will be a more manageable solution. </p>
<p>2) In the Properties window, set <strong>EvaluateAsExpression</strong> to <strong>True</strong>. This will give you a chance to use the <strong>Expression Builder.</strong></p>
<p>3) Open the <strong>Expression Builder </strong>by clicking on the eclipse button in Expression</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image21.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb21.png?w=378&#038;h=35" width="378" height="35" /></a> </p>
<h4><strong>Use the Expression Builder to build the parameterized query</strong></h4>
<p>Expression Builder is a invaluable tool in SSIS, but it’s not a tool I look forward to in my daily job. The reason is that everything needs to be wrapped around the double quote. When our variable itself is a String data type, it’s actually very easy to construct the query.</p>
<p>String is one of the most used data types, but it’s not the only data type. In my case, my variable varDAYS_HRS is set to 60, and it’s an integer.&#160; </p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image22.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb22.png?w=551&#038;h=239" width="551" height="239" /></a> </p>
<p>In the above screenshot, the two red boxes should be 60, if I hard-code it. Since all needs to be string, I must use some data type casting function to cast it as string. (DT_WSTR, &lt;&lt;length&gt;&gt;) is a way to do just that.</p>
<p>A more generic syntax for explicitly converting an expression from one data type to a different data type is here:</p>
<p>(type_spec) expression</p>
<p>See <a href="http://msdn.microsoft.com/en-us/library/ms141704.aspx" target="_blank">Cast (SSIS Expression): Convert SSIS Data Types</a> from MSDN for details.</p>
<p>Always use the Evaluate Expression button on the Expression Builder screen to make sure that your expression is acceptable by Integration Services. </p>
<h4><strong>Create another variable to hold the dynamic parameter value</strong></h4>
<p>Variable varDAYS_HRS is created to hold the dynamic parameter we need to pass to the query. This is a simple user variable:</p>
<p>&#160; <a href="http://bisherryli.files.wordpress.com/2012/01/image23.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb23.png?w=343&#038;h=25" width="343" height="25" /></a> </p>
<h4><strong>“SQL command from variable” for OLE DB Data Source is a valuable recommendation</strong></h4>
<p>Next time, when Integration Services cannot parse your parameterized queries, give this recommendation a try if your query is reasonably simple and short. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2333/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2333/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2333/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2333&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2012/01/27/ssis-107-parameterized-query-in-ole-db-data-source-parameter-information-cannot-be-derived-from-sql-statements-with-sub-select-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb17.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb19.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>MDX #1 &#8211; Why should we always provide set_expression2 in NonEmpty() function</title>
		<link>http://bisherryli.wordpress.com/2012/01/20/mdx-1-why-should-we-always-provide-set_expression2-in-nonempty-function/</link>
		<comments>http://bisherryli.wordpress.com/2012/01/20/mdx-1-why-should-we-always-provide-set_expression2-in-nonempty-function/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 22:31:55 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[MDX Challenge]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2313</guid>
		<description><![CDATA[NonEmpty() is a very powerful MDX function for improving your MDX query performance. It is primarily used to remove unwanted empty sets in a very fast manner. According to MDX Function Reference, it returns the set of tuples that are not empty from a specified set, based on the cross product of the specified set [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2313&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>NonEmpty() is a very powerful MDX function for improving your MDX query performance. It is primarily used to remove unwanted empty sets in a very fast manner. </p>
<p>According to <a href="http://technet.microsoft.com/en-us/library/ms145970.aspx" target="_blank">MDX Function Reference</a>, it returns the set of tuples that are not empty from <strong>a specified set</strong>, based on the cross product of the specified set with <strong>a second set</strong>. The syntax is simple enough:</p>
<pre>NONEMPTY(set_expression1 [,set_expression2])</pre>
<p>Look closely, you will see that the usage of the set_expression2 is optional. I’ve been using NonEmpty() without the <strong>set_expression2</strong> for many of my SSRS reports. Going from “out-of-memory” on the report server to only a few seconds to render my reports, I was so happy that I’ve never thought about testing record counts or some measures, until I finally had time.</p>
<p>What I saw in my test results shocked me. After some research and reading, I realized that the problem is in the omission of the set_expression2. By including the appropriate <strong>set_expression2</strong>, I got the perfect results.</p>
<p>In this blog, I’ll try to share with you this little lesson I’ve learned.</p>
<h4><strong>Non-empty is a characteristic of the cells references by the tuples, not the tuples themselves</strong></h4>
<p>This is an important note from the above MDX Function Reference from Microsoft. Now that I am reading this note, I start to visualize:</p>
<p>1) set_expression1 will be typically the cross product of members of some hierarchies, for example,&#160;&#160; </p>
<pre>

DEDESCENDANTS([Queue].[Queue].[Level 03].[Online Email], [Queue].[Queue].[Level 05], self) *

[Time].[Day].[Day].MEMBERS
</pre>
<p>2) Since the non-empty is really a characteristic of the cells, and we want to remove sets that have no certain measures, does that that mean we really need to specify the measures we are referring to? Now it makes sense to me that we do need to specify the measures we are referring to.</p>
<h4><strong>If a second set is not provided, the expression is evaluated in the context of the <font color="#ff0000">current coordinates</font> of the members of the attribute hierarchies and the measures in the cube</strong></h4>
<p>This is another important note from the above MDX Function Reference from Microsoft. So if the second set is not provided, we are blindly relying on the Analysis Services to find these “current coordinates”. “Current” really means at the moment of evaluation. Unfortunately, these “current coordinates” can be pretty random at the moment of evaluation, depending on how we setup our default members, and especially if we are defining calculated measures in our query. The default initial value of any calculated measure is null. This can lead to a very messy, confusing, and unexpected query results.</p>
<h4><strong>set_expression2 is not provided – wrong result</strong></h4>
<p>This is part of my initial query, where the second set expression is not provided. </p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image11.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb11.png?w=610&#038;h=63" width="610" height="63" /></a> </p>
<p>Although the NonEmpty() function is used, rows with all nulls are plainly showing. Further testing showed that the record counts and measures are incorrect.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image12.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb12.png?w=556&#038;h=188" width="556" height="188" /></a> </p>
<h4><strong>set_expression2 is provided – All looks good!</strong></h4>
<p>This is part of my revised query, where the second set expression is now provided with a measure.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image13.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb13.png?w=563&#038;h=55" width="563" height="55" /></a> </p>
<p>There is no longer any rows that are all null. Further testing showed that all numbers are correct.&#160; </p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image14.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb14.png?w=556&#038;h=209" width="556" height="209" /></a> </p>
<h4><strong>Conclusion – Always include a measure in the second set in NonEmpty() function</strong></h4>
<p>I will put this lesson in my MDX best practice list. Hope you will do the same.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2313/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2313/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2313/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2313&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2012/01/20/mdx-1-why-should-we-always-provide-set_expression2-in-nonempty-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS #106 &#8211; You can create package configuration files to make SSIS package dynamic and portable</title>
		<link>http://bisherryli.wordpress.com/2012/01/14/ssis-106-you-can-create-package-configuration-files-to-make-ssis-package-dynamic-and-portable/</link>
		<comments>http://bisherryli.wordpress.com/2012/01/14/ssis-106-you-can-create-package-configuration-files-to-make-ssis-package-dynamic-and-portable/#comments</comments>
		<pubDate>Sat, 14 Jan 2012 20:52:02 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSIS Best Practices]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2302</guid>
		<description><![CDATA[I had many posts that share my experiences with using package configuration files to make my SSIS packages portable from my local development BIDS environment, to the test environment, and the production environment. In the next few blogs, I’ll share with you a few simple steps to create your own XML configuration files and then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2302&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had many posts that share my experiences with using package configuration files to make my SSIS packages portable from my local development BIDS environment, to the test environment, and the production environment.</p>
<p>In the next few blogs, I’ll share with you a few simple steps to create your own XML configuration files and then how to use them to make your SSIS packages dynamic and portable.</p>
<h4><strong>Benefit of using package XML configuration files</strong></h4>
<p>There are many resources on this topic. In a nutshell, using package configuration files is a powerful way to make your SSIS package extremely <strong>versatile</strong>. </p>
<h5><strong>Example 1 – Make a connection string for a connection manager dynamic</strong></h5>
<p>We typically have our server name, database name, user name (password as well sometimes) embedded in our Connection Manager.</p>
<p>When we are ready to move our packages from development to test, or to production, the least we would expect is that the server name will be different.</p>
<p>In this case, the goal of using a package configuration file is:</p>
<p>1) <strong>no modification to our packages themselves</strong></p>
<p>2) <strong>the only change we will make is to the package configuration file</strong>. I’ll need to change the Data Source and the Initial Catalog accordingly.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image8.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb8.png?w=612&#038;h=25" width="612" height="25" /></a> </p>
<h5><strong>Example 2 – Make a Value for a variable dynamic</strong></h5>
<p>A typical example is a path where we fetch our incoming files. This file path will be most likely different from what is on our local PC and what is on our test or production server, especially the root folder will be most likely different.</p>
<p>Again the goal of using a&#160; a package configuration file in this case is:</p>
<p>1) <strong>no modification to our packages themselves</strong></p>
<p>2) <strong>the only change we will make is to the package configuration file</strong>. I’ll need to change the ConfiguredValue accordingly when I move my package to the test or the production server.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image9.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb9.png?w=446&#038;h=35" width="446" height="35" /></a> </p>
<p>So, it’s fair to summarize the benefits of using package configuration files as:</p>
<ul>
<li>
<h6><strong><font size="3">no modification to our packages themselves</font></strong></h6>
</li>
<li>
<h6><strong><font size="3">the only change we will make is to the package configuration file</font></strong></h6>
<p>&#160;</p>
</li>
<p> If it’s your first time to use a package configuration files, and you received it from a co-worker, you might wonder how the package configuration file is created.I’ll share two examples with you. One example is to create a package configuration file for a connection manager. Another example is for a variable.The steps of creating package configuration file is simple enough. There are two things that are not crystal clear though:1) The multiple choices of properties that are available to us. All the properties are exposed to us. Which one do we need?&#160; </ul>
<p> <a href="http://bisherryli.files.wordpress.com/2012/01/image10.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb10.png?w=420&#038;h=316" width="420" height="316" /></a>
<ul><strong></strong>
<p>&#160;</p>
<p>2) What are we going to do about the configuration file?</p>
<p>I’ll continue to share with you these two tasks when I get time in the future.</p>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2302/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2302/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2302/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2302&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2012/01/14/ssis-106-you-can-create-package-configuration-files-to-make-ssis-package-dynamic-and-portable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSRS 65# &#8211; Add row or column totals to matrix</title>
		<link>http://bisherryli.wordpress.com/2012/01/06/ssrs-65-add-row-or-column-totals-to-matrix/</link>
		<comments>http://bisherryli.wordpress.com/2012/01/06/ssrs-65-add-row-or-column-totals-to-matrix/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 06:14:17 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSRS Expert]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2293</guid>
		<description><![CDATA[A reader asked me how to add grand totals a matrix (A Sample of Matrix in SSRS). It’s actually pretty easy to accomplish that in both SSRS 2005 and 2008. I am going to show a few screen shots here. Challenge Suppose you have a very simple table with sales data for products sold from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2293&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A reader asked me how to add grand totals a matrix (<a href="http://beyondrelational.com/blogs/sherryli/archive/2010/03/15/a-sample-of-matrix-in-ssrs.aspx">A Sample of Matrix in SSRS</a>).</p>
<p>It’s actually pretty easy to accomplish that in both SSRS 2005 and 2008. I am going to show a few screen shots here.</p>
<h4><strong>Challenge</strong></h4>
<p>Suppose you have a very simple table with sales data for products sold from each store.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb.png?w=451&#038;h=160" width="451" height="160" /></a> </p>
<p>You want to rearrange the data so it shows the stores vertically, all products horizontally, and the Sales Amount at each intersection. Finally you want to show totals at the bottom and also to the right.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb1.png?w=497&#038;h=117" width="497" height="117" /></a> </p>
<p>Matrix will be a perfect choice for this purpose with no extra coding on your part.</p>
<h4><strong>Solution – create a matrix and then add totals to row and column</strong></h4>
<p>The steps are very straightforward. I am going to show the screen shots from SSRS 2008 here.</p>
<p>Here is a matrix without any configuration yet.</p>
<p>&#160;<a href="http://bisherryli.files.wordpress.com/2012/01/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb2.png?w=262&#038;h=77" width="262" height="77" /></a> </p>
<p>Point the cursor to the Rows cell, an icon appear on the upper right corner. Click the icon, you will see the list of columns from your dataset. Select Store.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image3.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb3.png?w=244&#038;h=135" width="244" height="135" /></a> </p>
<p>For the Columns cell, select Product.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image4.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb4.png?w=363&#038;h=113" width="363" height="113" /></a> </p>
<p>For the Data cell, select SalesAmount.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image5.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb5.png?w=244&#038;h=97" width="244" height="97" /></a> </p>
<p>Now, right-click the data cell, you will see choices under Tablix. Select Add Totals, and then Row.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image6.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb6.png?w=373&#038;h=362" width="373" height="362" /></a> </p>
<p>Repeat the above step to create a total next the column Product.</p>
<p><a href="http://bisherryli.files.wordpress.com/2012/01/image7.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2012/01/image_thumb7.png?w=326&#038;h=89" width="326" height="89" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2293/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2293/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2293/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2293&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2012/01/06/ssrs-65-add-row-or-column-totals-to-matrix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2012/01/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSRS #64 &#8211; Remove default values for parameters on report server</title>
		<link>http://bisherryli.wordpress.com/2011/12/31/ssrs-64-remove-default-values-for-parameters-on-report-server/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/31/ssrs-64-remove-default-values-for-parameters-on-report-server/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 17:46:44 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSRS Expert]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2275</guid>
		<description><![CDATA[In my previous blog, SSRS &#38; SSAS #63 – Stop SSRS 2008 MDX Query Designer from Overwriting Parameter Queries, I mentioned that you can manually remove the parameter default values in BIDS before you deploy your reports to your report server. But what if you already “infected” your report server” with unwanted default values for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2275&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p> In my previous blog, <a href="http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-63-stop-ssrs-2008-mdx-query-designer-from-overwriting-parameter-queries/">SSRS &amp; SSAS #63 – Stop SSRS 2008 MDX Query Designer from Overwriting Parameter Queries</a>, I mentioned that you can manually remove the parameter default values in BIDS before you deploy your reports to your report server.</p>
<p>But what if you already “infected” your report server” with <strong>unwanted default values</strong> for report parameters? It has happened to me many times. So I thought I should share with you this little annoying thing about default values for parameters on report server.</p>
<p>Here is a screenshot from the report server showing the <strong>unwanted default values.</strong> </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image31.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb31.png?w=602&#038;h=175" width="602" height="175" /></a> </p>
<p> Talking about unwanted or unwelcomed guests, this is one of those. It will stay on the report server, unless we take time to remove them.</p>
<p>Simply uncheck the box “Has Default”. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image32.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb32.png?w=549&#038;h=158" width="549" height="158" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2275/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2275/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2275/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2275&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/31/ssrs-64-remove-default-values-for-parameters-on-report-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb31.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb32.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSRS &amp; SSAS #63 &#8211; Stop SSRS 2008 MDX Query Designer from Overwriting Parameter Queries</title>
		<link>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-63-stop-ssrs-2008-mdx-query-designer-from-overwriting-parameter-queries/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-63-stop-ssrs-2008-mdx-query-designer-from-overwriting-parameter-queries/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 03:49:04 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSRS Expert]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2268</guid>
		<description><![CDATA[In a previous blog, SSRS &#38; SSAS #61 – SSRS and SSAS Integration: how bad it is and our hope with two types of data providers, I complained about how bad the integration between Reporting Services and Analysis Services is. Complain itself will not solve any issue. But it drove me to focus on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2268&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a previous blog, <a href="http://bisherryli.wordpress.com/2011/12/19/ssas-26-ssrs-and-ssas-integration-how-bad-it-is-and-our-hope-with-two-types-of-data-providers/">SSRS &amp; SSAS #61 – SSRS and SSAS Integration: how bad it is and our hope with two types of data providers</a>, I complained about how bad the integration between Reporting Services and Analysis Services is.</p>
<p>Complain itself will not solve any issue. But it drove me to focus on the frustration and research solutions or workarounds. </p>
<h5><strong>Issue – The MDX query designer in SSRS 2008 overwrites my parameter queries</strong></h5>
<p>When using Analysis Services as data source, the query designer is a very attractive tool for assembling MDX queries. When I decide to use parameters, it even creates the queries for me for the parameters. All is good, except when I found out that my customized parameter queries got overwritten over and over again.</p>
<p>There are many reasons why I write customized parameter queries. Here are a few:</p>
<p>1. The least reason is to format my MDX queries for better readability. If you have read some machine-generated MDX queries, such as queries from Excel, ProClarity, SSRS, you would not blame me for spending some extra time for better readability.</p>
<p>2. The auto-generated parameter queries most likely will retrieve the top level member ALL for the hierarchy along with children members. I personally do not like this feature. I often modify the parameter queries to exclude the ALL member.</p>
<p>3. To implement cascading parameters, the auto-generated parameter queries must be modified.&#160;&#160;&#160;&#160;&#160; </p>
<p>Unfortunately, if I open the main data set again in the MDX query designer, all the customized parameter queries will be overwritten.&#160; </p>
<h5><strong>A Workaround – Add a tag SuppressAutoUpdate = true to the RDL file</strong></h5>
<p>There are very few books on the integration between SSRS and SSAS, even fewer resources on solutions to the issues we face. Thanks to some dedicated bloggers, I found the following articles online regarding this annoying issue:</p>
<ul>
<li><a href="http://agilebi.com/mcole/2010/09/13/prevent-ssrs-2008-from-overwriting-datasets/">Prevent SSRS 2008 from Overwriting Datasets</a></li>
<li><a href="http://blogs.adatis.co.uk/blogs/sachatomey/archive/2009/11/16/stop-reporting-services-ssrs-2008-from-overwriting-custom-parameter-datasets.aspx">Stop Reporting Services (SSRS) 2008 from overwriting custom Parameter Datasets</a></li>
</ul>
<p>This link, <a href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=417209">MDX Query Designer Overwrites Parameter Queries</a>, is actually a bug report on Microsoft Connect. It seems that this new issue in SSRS 2008 had never got fixed. I could be wrong on this. It will be appreciated if anybody can let me know if this has been fixed in later release of SSRS 2008.</p>
<p>It turned out that&#160; the workaround to preserve my changes to the parameters queries is to modify the report’s RDL source code as follows by adding &lt;rd:SuppressAutoUpdate&gt;true&lt;/rd:SuppressAutoUpdate&gt; between the tag &lt;Query&gt; and &lt;/Query&gt;:</p>
<p>&lt;Query&gt;   <br />&#160;&#160; &#8230;    <br />&#160;&#160; &lt;rd:SuppressAutoUpdate&gt;true&lt;/rd:SuppressAutoUpdate&gt;    <br />&lt;/Query&gt;</p>
<p>Here are some simple steps to accomplish this:</p>
<p><strong>1. Right click the report in BIDS 2008, and select View Code.</strong></p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image27.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb27.png?w=293&#038;h=70" width="293" height="70" /></a>&#160; </p>
<p><strong>2. Search string &lt;/DataSet&gt; in the RDL/XML file.</strong></p>
<p>Then add &lt;rd:SuppressAutoUpdate&gt;true&lt;/rd:SuppressAutoUpdate&gt; to just before &lt;/Query&gt;.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image28.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb28.png?w=476&#038;h=120" width="476" height="120" /></a> </p>
<p><strong>3. Repeat step 2 for every data set (or only the data sets you do not want to be updated).</strong></p>
<h5><strong>Default values for parameters still need to be manually removed</strong></h5>
<p>The above workaround prevents SSRS 2008 from overwriting my parameters queries, but still leaves the Default Values for my parameters.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image29.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb29.png?w=539&#038;h=325" width="539" height="325" /></a> </p>
<p>This is actually not a bad thing for testing purpose because it can save me many mouse-clicking to select parameters. When I am ready to send my report to the report server, I can just open the property window for my parameters, and change to No default value on the Default Values tab.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image30.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb30.png?w=529&#038;h=166" width="529" height="166" /></a> </p>
<p>So I guess I will keep complaining about SSRS-SSAS-MDX till I can find either workarounds or solutions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2268&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-63-stop-ssrs-2008-mdx-query-designer-from-overwriting-parameter-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb27.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb28.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb29.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb30.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSRS &amp; SSAS #62 &#8211; Create a data source on Report Server for an Analysis Services database</title>
		<link>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-62-create-a-data-source-on-report-server-for-an-analysis-services-database/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-62-create-a-data-source-on-report-server-for-an-analysis-services-database/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 01:36:16 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSRS Expert]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2258</guid>
		<description><![CDATA[The team I recently moved into had never had a data source created on their report server for an Analysis Services source. A co-worker helped me got a data source created with Microsoft SLQ Server Analysis Services as the Data Source Type. For credentials for connection, we correctly flagged “Credentials stored securely in the report [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2258&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The team I recently moved into had never had a data source created on their report server for an Analysis Services source.</p>
<p>A co-worker helped me got a data source created with Microsoft SLQ Server Analysis Services as the Data Source Type. </p>
<p>For credentials for connection, we correctly flagged “Credentials stored securely in the report server” with the right User name and Password.</p>
<p>The initial try of using the newly created data source failed, however. After fixing two issues, the configuration for the data source finally worked. The final configuration is shown below. <a href="http://bisherryli.files.wordpress.com/2011/12/image23.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb23.png?w=586&#038;h=455" width="586" height="455" /></a> </p>
<p>Since I don’t do this kind of task every day, I thought it would be a good idea to write down how we fixed the issues.</p>
<h5><strong>1. The user name for the connection should be part of the server role</strong></h5>
<p>This is the error message from the report server before we made sure that the user name is part of the server instance role. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image24.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb24.png?w=458&#038;h=93" width="458" height="93" /></a> </p>
<p>In SSMS, right click on the Analysis Services server instance, select Properties. On the Security tab, make sure that the user name is added. I have a little doubt about the user being part of the Server administrators. It seems to be too much privilege to me.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image25.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb25.png?w=577&#038;h=214" width="577" height="214" /></a> </p>
<h5><strong>2. Check &quot;Use as Windows credentials when connecting to the data source”</strong></h5>
<p>Before we check this option, here is the error we got:</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image26.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb26.png?w=579&#038;h=155" width="579" height="155" /></a> </p>
<p>I guess this has to do with the fact that we can only connect to Analysis Services (and also Integration Services) instance via Windows Authentication.</p>
<p>(Note: in the screen shot above, ignore the red warning about invalid password. I changed the User name to be a fake user name for this blog.)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2258&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/30/ssrs-ssas-62-create-a-data-source-on-report-server-for-an-analysis-services-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb23.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb24.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb25.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb26.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS #105 &#8211; Loop through rows in a SQL table (with multiple columns)</title>
		<link>http://bisherryli.wordpress.com/2011/12/23/ssis-loop-through-rows-in-a-sql-table-with-multiple-columns/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/23/ssis-loop-through-rows-in-a-sql-table-with-multiple-columns/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 18:50:25 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSIS Best Practices]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2247</guid>
		<description><![CDATA[I am a SQL purist, meaning that I have vowed never to use cursors in T-SQL to loop through rows record by record. In SSIS package design, however, I have used the Foreach Loop Container very often. I would not say that I have broken my vows though for the following reasons: 1.&#160; The record [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2247&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I am a SQL purist, meaning that I have vowed never to use cursors in T-SQL to loop through rows record by record.</p>
<p>In SSIS package design, however, I have used the <strong>Foreach Loop Container</strong> very often. I would not say that I have broken my vows though for the following reasons:</p>
<p>1.&#160; The record set I loop through is usually <strong>relatively small</strong>.</p>
<p>2. <strong>Foreach Loop Container</strong> in Integration Services takes a data type of <strong>System.Object</strong> (not the physical SQL table), which is a in-memory object that is native to the Integration Services. So I trust that Microsoft engineers have done a wonderful job in terms of optimal performance. </p>
<p>In Integration Services, I have used two ways to generate this System.Object for the&#160; Foreach Loop Container to consume.</p>
<p>One way is to use an<strong> Execute SQL Task</strong>. I have blogged about this way in the past.</p>
<ul>
<li><a href="http://bisherryli.wordpress.com/2011/03/06/ssis-full-result-set-to-a-set-variable-of-object/">SSIS – “Full result set” to a set variable of Object</a>. </li>
<li><a href="http://bisherryli.wordpress.com/2011/03/06/ssis-use-foreach-loop-container-and-pass-a-variable-to-a-ole-db-source-in-a-data-flow/">SSIS – Use “Foreach Loop Container” and pass a variable to a OLE DB Source in a Data Flow</a></li>
<li><a href="http://bisherryli.wordpress.com/2011/08/27/ssis-99-pass-a-date-time-parameter-to-the-execute-sql-task/">SSIS #99 – Pass a date time parameter to the Execute SQL Task</a></li>
</ul>
<p>Here are two screen shots that shows how to configure the Execute SQL Task to receive the query result into a variable with data type of System.Object.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image11.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb11.png?w=379&#038;h=249" width="379" height="249" /></a></p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image12.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb12.png?w=548&#038;h=174" width="548" height="174" /></a>&#160; </p>
<p>Although you can map the query result to more than one System.Object variables, this would not work for the problem I am facing now.</p>
<h5><strong>Challenge</strong></h5>
<p>1. Here is a pseudo query that I need to retrieve a collection of new QueueName and their parent IDs. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image13.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb13.png?w=282&#038;h=100" width="282" height="100" /></a> </p>
<p>2. I want to use both the QueueName and the QueueParentId, and pass them through a Foreach Loop Container to another task and use them as query parameters.</p>
<p>For the 2nd challenge, <strong>where more than one columns must be split up from one single System.Object</strong>, I cannot use Execute SQL Task with a Full result set configuration.</p>
<h5><strong>Recordset Destination comes to the rescue</strong></h5>
<p>&#160;</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image14.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb14.png?w=440&#038;h=304" width="440" height="304" /></a> </p>
<p>The ADO recordset fits perfectly for my problem.</p>
<h5><strong>A Design Pattern (Loop through rows with multiple columns) with Recordset Destination and Foreach Loop Container </strong></h5>
<p>1. First, I need <strong>three package level variables</strong>. vLoopSet is the System.Object that will store the ADO dataset. The other two non-System.Object variables are for each column in the ADO recordset.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image15.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb15.png?w=365&#038;h=130" width="365" height="130" /></a> </p>
<p>2. Here is the Control Flow I will need. The first Data Flow will run some query against my data source and send the results to a <strong>Recordset Destination</strong>.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image16.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb16.png?w=362&#038;h=272" width="362" height="272" /></a> </p>
<p>3. Here is the Data Flow. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image17.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb17.png?w=204&#038;h=244" width="204" height="244" /></a> </p>
<p>Configuration the <strong>Recordset Destination</strong> is simple enough. All the interface on top is useless. The only thing you need is to set the&#160; <strong>VariableName</strong>.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image18.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb18.png?w=590&#038;h=350" width="590" height="350" /></a> </p>
<p>And also the <strong>Output columns</strong>.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image19.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb19.png?w=490&#038;h=348" width="490" height="348" /></a> </p>
<p>4. For the<strong> Foreach Loop Container</strong>, select <strong>Foreach ADO Enumerator</strong>, <strong>User::vLoopSet</strong>, and <strong>Rows in the first table</strong>.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image20.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb20.png?w=384&#038;h=386" width="384" height="386" /></a> </p>
<p>For the <strong>variable mapping</strong>, use the<strong> zero-based index</strong> to map the columns to the variable. Index zero will be the first column in the query, and 1 is the second column in the query. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image21.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb21.png?w=483&#038;h=261" width="483" height="261" /></a> </p>
<p>5. Finally, we are ready to use the User::vQueryName and User::vQueueParentID as <strong>dynamic parameters</strong> for our task inside the Foreach Loop Container.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image22.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb22.png?w=244&#038;h=147" width="244" height="147" /></a> </p>
<p>Here we are using the famous <strong>question mark</strong> again to represent our dynamic parameters. Note: the ? is <strong>position sensitive</strong>, meaning that the first ? will represent the first variable from the above mapping, and the second ? represents the 2nd variable in the above mapping in the Foreach Loop Container configuration.</p>
<p>I hope after reading this post, you will rush off to to open your own SSIS packages and find opportunities to use this Loop Through Rows with Multiple Columns pattern.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2247&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/23/ssis-loop-through-rows-in-a-sql-table-with-multiple-columns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb11.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb12.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb13.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb14.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb15.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb16.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb17.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb18.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb19.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb20.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb21.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb22.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSIS #104 &#8211; When Row Count Transformation is invaluable</title>
		<link>http://bisherryli.wordpress.com/2011/12/21/ssis-104-when-row-count-transformation-is-invaluable/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/21/ssis-104-when-row-count-transformation-is-invaluable/#comments</comments>
		<pubDate>Wed, 21 Dec 2011 19:16:24 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSIS Best Practices]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2221</guid>
		<description><![CDATA[The Row Count transformation is a pretty straightforward transformation. It does the following two things: 1. It counts rows as data passes through a data flow, and 2. it stores the final count in a variable. (Note that the variable is only populated when the data flow is finished, not while the data flow is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2221&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <strong>Row Count transformation</strong> is a pretty straightforward transformation. It does the following two things:</p>
<p>1. It <strong>counts rows</strong> as data passes through a data flow, and </p>
<p>2. it stores the final count <strong>in a variable</strong>. (Note that the variable is only populated when the data flow is finished, not while the data flow is still in the middle of transferring data.)</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image4.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb4.png?w=354&#038;h=125" width="354" height="125" /></a> </p>
<p>Here is a data flow design pattern I use very often.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image5.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb5.png?w=238&#038;h=325" width="238" height="325" /></a> </p>
<p>At the end of the data flow, my variable @vNewQueueCount is populated with the row count from the data source.</p>
<p>Then I use this variable @vNewQueueCount in a Precedence Constraint expression, as shown below, to decide conditionally whether I need to process my Queue dimension or not.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image6.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb6.png?w=592&#038;h=166" width="592" height="166" /></a> </p>
<p>Configuring the Row Count transformation is simply enough. I’ll show you that later in this blog.</p>
<p>What I want to say first is why the Row Count transformation is invaluable in this specific design pattern.</p>
<p>In this design, I’ve decided to use the <strong>Recordset Destination</strong>, which is a in-memory ADO dataset and it saves data in memory in a recordset that is stored in an Integration Services package variable of the <strong>Object</strong> data type. In my next blog, I’ll show you how to use a Foreach Loop container with the Foreach ADO enumerator to process one row of the recordset at a time.</p>
<p>The <strong>Recordset Destination</strong> is a handy component to use when you do not need to (nor want to) persist your data. One drawback of using the in-memory ADO dataset is that Integration Services does not provide any out-of-box methods to get the row count in the dataset. This is when <strong>Row Count transformation</strong> becomes invaluable to me. Without too much work on my side, I am able to accomplish the following:</p>
<p>1. Retrieve data from the source, and store the data in a, ADO dataset.</p>
<p>2. Also store the row count in a variable.</p>
<p>3. Finally, be able to use the row count variable to conditionally decide whether I need to process my dimension or not.</p>
<p>Here are a few simple steps to configure the<strong> Row Count transformation</strong>.</p>
<p>1. Define a variable vNewQueueCount.</p>
<p>&#160;<a href="http://bisherryli.files.wordpress.com/2011/12/image7.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb7.png?w=400&#038;h=148" width="400" height="148" /></a> </p>
<p>2. Create a new data flow</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image8.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb8.png?w=419&#038;h=96" width="419" height="96" /></a> </p>
<p>3. Drag the <strong>Row Count transformation</strong> to the data flow design surface. On the Advance Editor, for VariableName select User::vNewQueueCount.</p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image9.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb9.png?w=605&#038;h=344" width="605" height="344" /></a> </p>
<p>Finally, you can use the variable in a precedence constraint expression to do conditional processing:</p>
<p>@vNewQueueCount &gt; 0 </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image10.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb10.png?w=539&#038;h=158" width="539" height="158" /></a> </p>
<p>Have fun with the Row Count transformation!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2221&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/21/ssis-104-when-row-count-transformation-is-invaluable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb9.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb10.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>SSRS &amp; SSAS #61 &#8211; SSRS and SSAS Integration: how bad it is and our hope with two types of data providers</title>
		<link>http://bisherryli.wordpress.com/2011/12/19/ssas-26-ssrs-and-ssas-integration-how-bad-it-is-and-our-hope-with-two-types-of-data-providers/</link>
		<comments>http://bisherryli.wordpress.com/2011/12/19/ssas-26-ssrs-and-ssas-integration-how-bad-it-is-and-our-hope-with-two-types-of-data-providers/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 17:32:12 +0000</pubDate>
		<dc:creator>Sherry Li</dc:creator>
				<category><![CDATA[SSRS Expert]]></category>

		<guid isPermaLink="false">https://bisherryli.wordpress.com/?p=2204</guid>
		<description><![CDATA[A few months ago, I had a post, SSAS #21 – Steps to create a SSRS report with MDX accessing a Cube. If you have worked on creating SSRS reports accessing cubes for a little while, you already knew that my post really doesn’t help you much in terms of solving real problems in your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2204&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few months ago, I had a post, <a href="http://bisherryli.wordpress.com/2011/05/25/ssas-21-steps-to-create-a-ssrs-report-with-mdx-accessing-a-cube/">SSAS #21 – Steps to create a SSRS report with MDX accessing a Cube</a>. If you have worked on creating SSRS reports accessing cubes for a little while, you already knew that my post really doesn’t help you much in terms of solving real problems in your work.</p>
<p>The issue of integration between Reporting Services and Analysis Services is a never ending source of pain and frustration for many BI developers. Before I talk about the pain and frustration I’ve experienced, I want to give you some hope first by showing you two types of data providers we can use in SSRS to access your cubes.</p>
<h5><strong>Data Provider 1 &#8211; Microsoft SQL Server Analysis Services</strong></h5>
<p>Many blogs, such as my blog above, showed you the steps to create SSRS reports accessing cubes in Analysis Services database without telling you a very important piece of information. That is they are using the Microsoft SQL Server Analysis Services as the data provider for the integration between SSRS and SSAS. </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb.png?w=498&#038;h=379" width="498" height="379" /></a> </p>
<p>This simple omission can be very beneficial to you, or can create frustration for you as well, depending on the nature of your project. If your cubes are designed well and your data navigation flows naturally as you would want, the drag-and-drop nature of this type of integration can be very beneficial to you. The well-liked SSAS query designer can be a life-saver for many developers who are so much experienced in creating manual MDX queries yet. On the other hand, when you start to experience serious performance issue with your SSRS reports, you would start to struggle with the un-optimized MDX queries that the integration has generated for you. </p>
<p>1) This is because this types of direct integration between SSRS and SSAS assumes that <strong>CROSSJOIN</strong> works for all data. Even without much experience in MDX, we all know that CROSSJOIN is absolutely not the best candidate for optimal performance in either TSQL or MDX.&#160;&#160; </p>
<p>2) It also assumes that we need help to create MDX queries for every report parameter. Any customized MDX queries you managed to create for your report parameters will be overwritten without any notification or your consent. It also assumes that we do not have interest in seeing the datasets it has created for our parameters by hiding them from us. This can create serious performance problems for us when many unused datasets are hidden from us.&#160;&#160;&#160;&#160; </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image1.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb1.png?w=219&#038;h=185" width="219" height="185" /></a> </p>
<p>Coupling the above two “helps” from this type of direct integration with the serious performance issue with your reports, there is nothing but pain and frustration.</p>
<p>(To be fair, this type of direct integration provides lots of benefits too. This post intends to focus on the pain and frustration, so I’ll ignore the benefits for now.) </p>
<h5><strong>Data Provider 2 – Microsoft OLE DB Provider for Analysis Services 9.0 (9.0 fro AS 2005 or 10.0 for AS 2008)</strong></h5>
<p>The OLE DB provider is not exactly better. What it interests me is that now I can put a little more customization/optimization to the MDX queries. With more customization, my hope for performance improvement (without any modifications to many shared/existing dimensions in the OLAP database) has increased a notch (if not soared).&#160;&#160;&#160;&#160; </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image2.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb2.png?w=558&#038;h=271" width="558" height="271" /></a> </p>
<p><a href="http://bisherryli.files.wordpress.com/2011/12/image3.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="image" border="0" alt="image" src="http://bisherryli.files.wordpress.com/2011/12/image_thumb3.png?w=391&#038;h=413" width="391" height="413" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/bisherryli.wordpress.com/2204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/bisherryli.wordpress.com/2204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/bisherryli.wordpress.com/2204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bisherryli.wordpress.com&amp;blog=13058142&amp;post=2204&amp;subd=bisherryli&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://bisherryli.wordpress.com/2011/12/19/ssas-26-ssrs-and-ssas-integration-how-bad-it-is-and-our-hope-with-two-types-of-data-providers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12700cc12b69eb056ff26f0d0ba8f34c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yidian11</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://bisherryli.files.wordpress.com/2011/12/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
	</channel>
</rss>
