<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">JohnDesch</title><subtitle type="html" /><id>http://blogs.msdn.com/b/johndesch/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/b/johndesch/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2011-11-28T15:07:00Z</updated><entry><title>Using DMVs to Monitor and Terminate Long Running MDX Queries</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2013/05/13/using-dmvs-to-monitor-and-terminate-long-running-mdx-queries.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2013/05/13/using-dmvs-to-monitor-and-terminate-long-running-mdx-queries.aspx</id><published>2013-05-14T02:48:00Z</published><updated>2013-05-14T02:48:00Z</updated><content type="html">&lt;p&gt;At one time or other, just about every DBA charged with administering a Microsoft SQL Server Analysis Services server has encountered a long running query that seems to consume machine resources with a voracious appetite. Those queries are typically executed by "Power Users" and almost invariably at a time that other users are attempting to run queries for month end reports resulting in a flury of calls asking if the server is down or encountering a performance issue. It's also rather interesting that the person registering the complaint almost always seems to be in the office of the CFO or CEO. That scenario does happen, and as one might expect, a&amp;nbsp;common request within the Business Intelligence community is for the ability to identify and terminate long running or resource intensive queries that are executing on a Microsoft SQL Server Analysis Services Server. While a query governor would be very useful,&amp;nbsp;unfortunately, Analysis Services doesn't have that type of functionality built into the product. Chris Webb's article on &lt;a title="Killing sessions automatically with SSIS" href="http://cwebbbi.wordpress.com/2008/12/04/killing-sessions-automatically-with-ssis/"&gt;Killing session automatically with SSIS&lt;/a&gt;&amp;nbsp;describes one approach to the problem using DMV queries in an SSIS Package. Tim Laqua's article &lt;a title="Dealing with long running SSAS queries using PowerShell-SSAS" href="http://timlaqua.com/2011/04/dealing-with-long-running-ssas-queries-using-powershell/"&gt;Dealing with long runnign SSAS queries using PowerShell-SSAS&lt;/a&gt;&amp;nbsp;is based on the same principle, but uses an unsupported API (Microsoft.AnalysisServices.XMLA.dll).&lt;/p&gt;
&lt;p&gt;When a query is executed, significant amounts of memory can be allocated on the server, with much of the data going into a shared cache. The query may also be using data that is already resident in a shared data cache, so the task of determining how much memory is actually being consumed by a given query would be non-trivial. I've tried it before, and was anything but satisfied with the solution that I came up with.&amp;nbsp;The conclusion that I finally reached was that the longer a query executes, especially if it's bottlenecked in Storage Engine, the more resources it's going to consume and the more users it's going to impact and the only viable option was to look at how long&amp;nbsp;a query had been executing. Those efforts, however, lead me to come up with a very simple solution that is based on a single DMV query and an XMLA Cancel command.&lt;/p&gt;
&lt;p&gt;The DMV query:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt;SELECT SESSION_SPID, SESSION_USER_NAME, SESSION_LAST_COMMAND, SESSION_LAST_COMMAND_ELAPSED_TIME_MS &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #0000ff; font-family: Consolas;"&gt;&lt;span style="color: #0000ff; font-family: Consolas;"&gt;&lt;span style="color: #0000ff; font-family: Consolas;"&gt;FROM&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Consolas;"&gt;&lt;span style="font-family: Consolas;"&gt; $SYSTEM.DISCOVER_SESSIONS ORDER BY&amp;nbsp;&lt;/span&gt;&lt;/span&gt;SESSION_LAST_COMMAND_ELAPSED_TIME_MS DESC&lt;/p&gt;
&lt;p&gt;Returns the user SPID, User Name (I definitely don't want to kill a session opened by the CIO, CFO, or CEO), the last command executed, and the duration of the command in milliseconds. And I get something that looks like the following:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: xx-small;"&gt;SESSION_SPID&amp;nbsp;SESSION_USER_NAME&amp;nbsp;SESSION_LAST_COMMAND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SESSION_LAST_COMMAND_ELAPSED_TIME_MS&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: xx-small;"&gt;4255&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NORTHAMERICA\jdesch&amp;nbsp;SELECT measures.members on 0, ([product].[product categories].members,[customer].[customer geography].members) on 1 from [Adventure Works]&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: xx-small;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 11928 &lt;/span&gt;&lt;span style="font-size: xx-small;"&gt;4239&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORTHAMERICA\jdesch&amp;nbsp;SELECT SESSION_CONNECTION_ID, SESSION_USER_NAME, SESSION_LAST_COMMAND, SESSION_LAST_COMMAND_ELAPSED_TIME_MS FROM $SYSTEM.DISCOVER_SESSIONS order by session_last_command_elapsed_time_ms desc&amp;nbsp;0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: xx-small;"&gt;3707&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORTHAMERICA\jdesch&amp;nbsp;MDSCHEMA_FUNCTIONS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size: xx-small;"&gt;3703&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;NORTHAMERICA\jdesch&amp;nbsp;MDSCHEMA_FUNCTIONS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;SPID&amp;nbsp;4239 is me executing my DMV query, so I don't want to have my connection commit suicide. I am, however, interested in what's happening with SPID 4255. Armed with that information, I can now execute an XMLA cancel command to terminate that particular connection and its associated session by executing the following:&lt;/p&gt;
&lt;p&gt;&amp;lt;Cancelxmlns=http://schemas.microsoft.com/analysisservices/2003/engine&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;SPID&amp;gt;4255&amp;lt;/SPID&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CancelAssociated&amp;gt;1&amp;lt;/CancelAssociated&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/Cancel&amp;gt;&lt;/p&gt;
&lt;p&gt;It wasn't a big jump from that to a simple C# application that uses a timer to periodically execute a single very simple DMV query against the server to check for long running queries and cancel sessions associated with queries that exceeded a configurable threshold.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10418301" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="OLAP Parameters" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/OLAP+Parameters/" /></entry><entry><title>Analysis Services Proactive Caching Operations and Errors</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/12/17/analysis-services-proactive-caching-operations-and-errors.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/12/17/analysis-services-proactive-caching-operations-and-errors.aspx</id><published>2012-12-17T23:51:33Z</published><updated>2012-12-17T23:51:33Z</updated><content type="html">&lt;div id="d0" class="Descr"&gt;One of the more interesting aspects of being involved in supporting Business Intelligence applications is the opportunity to investigate&amp;nbsp;behaviors that are either&amp;nbsp;unexpected or perhaps not so intuitively understood. Proactive Caching is one aspect of Analysis Services that is not well understood by&amp;nbsp;some and can present some&amp;nbsp;interesting issues, especially when errors related to data quality occur. A behavior that was encountered recently involved&amp;nbsp;Proactive Caching entering a loop when&amp;nbsp;partitions in a cube were configured for Proactive Caching using either Client Notifications or SQL Notifications&amp;nbsp;and the Proactive Caching operation failed. When that situation occurs,&amp;nbsp;the Proactive Caching operation is immediately re-executed then fails&amp;nbsp;and&amp;nbsp;continues executing in a loop. When this condition occurs, the only way to terminate the loop of Proactive Caching operations is to stop and re-start the service.&lt;/div&gt;
&lt;div class="Descr"&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="Descr"&gt;The key point to this discussion is that using the default ErrorConfiguration settings, data quality errors (i.e. orphaned fact rows, referential integrity issues, etc.)&amp;nbsp;as well as&amp;nbsp;other data&amp;nbsp;errors will result in&amp;nbsp;processing failures and will not cancel the alert that triggered the&amp;nbsp;Proactive Caching process operation. While it may be seen as an unexpected behavior, this is the designed behavior of Proactive Caching. For these reasons,&amp;nbsp;Proactive Caching should be used with care and closely monitored. While eliminating data quality&amp;nbsp;issues in the relational source&amp;nbsp;would be the most desirable way of controlling this, doing so is not always feasible. The recommended practice is to&amp;nbsp;enable custom ErrorConfiguration for partitions with ProactiveCaching enabled using either Client Notifications or SQL Notifications. Custom ErrorConfiguration options would include setting the ErrorConfiguration to report and ignore errors to make sure the ProactiveCaching operation doesn't enter into a loop.&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10378850" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="OLAP Parameters" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/OLAP+Parameters/" /></entry><entry><title>Using the RS.EXE utility to deploy a Report Server Project and Shared Dataset.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/12/17/using-the-rs-exe-utility-to-deploy-a-report-server-project-and-shared-dataset.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/12/17/using-the-rs-exe-utility-to-deploy-a-report-server-project-and-shared-dataset.aspx</id><published>2012-12-17T19:30:00Z</published><updated>2012-12-17T19:30:00Z</updated><content type="html">&lt;p&gt;Since broadening my area of concentration and branching out&amp;nbsp;from Microsoft Analysis Services to the broader Microsoft Business Intelligence Stack, I've encountered quite a few new challenges and opportuities. One of the more recent challenges was&amp;nbsp;how to deploy a Reporting Services project. When using BI Development Studio or, in the case of the SQL Server 2012 tool set, SQL Server Data Tools deployment is a relatively trivial matter. This deployment task, however, involved programmatic deployment of Data Sources, Reports, and Shared DataSets. It didn't take long to discover that Reporting Services ships the RS script hosting utility, which can be used for any number of administrative tasks related to a Reporting Services implementation.&lt;/p&gt;
&lt;p&gt;The RS utility is a script hosting utility that uses VB.NET script, so if you're familiar with VB.NET and scripting, it's relatively easy to create .rss files to perform just about any task that you might want to perform. There are a number of sample scripts that are available in Books On Line and there are several examples of&amp;nbsp;.rss scripts available on the web.&lt;a title="DavidElish" href="http://sqlserverselect.blogspot.com/2010/10/rsexe-and-rss-scripts-for-automation-of.html"&gt; David Elish&lt;/a&gt; has posted a useful .rss script for automation of some tasks. Jasper Smith has made the &lt;a title="ReportServicesScripter" href="http://sqldbatips.com/showarticle.asp?ID=62"&gt;Reporting Services Scripter&lt;/a&gt; utility available. Armed with that&amp;nbsp;knowledge and a false sense of security, I thought this should be easy.&lt;/p&gt;
&lt;p&gt;Just one minor problem.&amp;nbsp;Shared Datasets were&amp;nbsp;new with the&amp;nbsp;2008 R2 release and there were no updated samples that shipped with that release. The familiar Reporting Services 2005 and Reporting Services 2008 classes were there, but they didn't support Shared DataSets or deployment to a&amp;nbsp;Reporting Services server configured for SharePoint integrated mode. Fortunately, there was a new Reporting Services 2010 class that&amp;nbsp;introduced a &lt;a title="CreateCatalogItem" href="http://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.createcatalogitem(v=sql.105).aspx"&gt;CreateCatalogItem&lt;/a&gt; method and&amp;nbsp;enabled the RS utility to be&amp;nbsp;used with&amp;nbsp;Native mode&amp;nbsp;as well as&amp;nbsp;SharePoint Integrated Mode. Coincidentally, the CreateCatalogItem method can be used with Reports, DataSources, and DataSets, so after a bit of reading I was ready to code.&lt;/p&gt;
&lt;p&gt;Note that the RS utility is run from a command prompt, and on Windows Server 2008 R2 or later, it needs to be run from a command prompt with elevated permissions. In order to run the tool, you must have permissions to connect to the report server instance against which the script will be run. What follows is the code for an RS script that can be used to deploy a Reporting Services Project, including Data Sources, Shared DataSets, and Reports, to a Report Server. Hopefully you'll find it useful.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The command line for running this script is:&lt;/p&gt;
&lt;p&gt;rs.exe -i&amp;nbsp;&amp;lt;path_to_script&amp;gt; -s&amp;nbsp;&amp;lt;url_of_report_server&amp;gt;&amp;nbsp;-v ReportFolder="&amp;lt;report_folder_name&amp;gt;" -v DataSetFolder="&amp;lt;DataSet_Folder_Name&amp;gt;" -v DataSourceFolder="&amp;lt;DataSource_Folder_Name&amp;gt;" -v DataSourcePath="/&amp;lt;DataSource_Path&amp;gt;" -v filePath="&amp;lt;Path_To_Report_Server_Project_Files&amp;gt;" -eMgmt2010&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Begin Script&lt;/p&gt;
&lt;p&gt;Dim definition As [Byte]() = Nothing&lt;/p&gt;
&lt;p&gt;Dim bytedefinition as [Byte]() = nothing&lt;/p&gt;
&lt;p&gt;Dim warnings As Warning() = Nothing&lt;/p&gt;
&lt;p&gt;　&lt;/p&gt;
&lt;p&gt;'Main Entry point of utility&lt;/p&gt;
&lt;p&gt;Public Sub Main()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Initiating Deployment")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;rs.Credentials = System.Net.CredentialCache.DefaultCredentials&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;'Create the shared data source&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;CreateFolders(DataSourceFolder,"/","Data Sources","Visible")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;'Create the folder that will contain the shared data sets&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;CreateFolders(DataSetFolder, "/", "Data Set Folder", "Visible")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;'Create the folder that will contain the deployed reports&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;CreateFolders(ReportFolder, "/", "Report Folder","Visible")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Catch goof As Exception&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine(goof.Message)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;ReadFiles(filepath, "*.rds")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;ReadFiles(filepath, "*.rsd")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;ReadFiles(filepath, "*.rdl")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'Publish the report&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'PublishReport(ReportName)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;UpdateDataSources(ReportFolder, DataSourcePath)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility for creation of folders&lt;/p&gt;
&lt;p&gt;Public Sub CreateFolders(ByVal folderName as string, ByVal parentPath as string, ByVal description as String, ByVal visible as string)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Checking for Target Folders")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'CatalogItem properties&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim descriptionProp as new [Property]&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;descriptionProp.Name = "Description"&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;descriptionProp.Value= description&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim visibleProp as new [Property]&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;visibleProp.Name = "Visible"&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;visibleProp.value= visible&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim props(1) as [Property]&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;props(0) = descriptionProp&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;props(1) = visibleProp&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;rs.CreateFolder(folderName,parentPath,props)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine("Folder {0} successfully created", foldername)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof as SoapException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If goof.Message.Indexof("AlreadyExists")&amp;gt;0 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("Folder {0} already exists",foldername)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p&gt;&amp;nbsp;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility for reading files from the Report Sevices Project&lt;/p&gt;
&lt;p&gt;Public sub ReadFiles(filepath as string, fileextension as string)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Reading Files from Report Services Project")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim rptdirinfo As System.IO.DirectoryInfo&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;rptdirinfo = New System.IO.DirectoryInfo(filepath)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim filedoc As FileInfo()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;filedoc = rptdirinfo.GetFiles(fileextension)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;For rptcount As Integer = 0 To filedoc.Length-1&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If Not filedoc(rptcount).Name.ToString.Trim.ToUpper.Contains("BACKUP") Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;SELECT Case fileextension&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Case "*.rds"&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;CreateDataSource(filedoc(rptcount).tostring.trim)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Case "*.rsd"&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;CreateDataSet(filedoc(rptcount).tostring.trim)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Case "*.rdl"&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;PublishReport(filedoc(rptcount).tostring.trim)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;End Select&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Next&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof as Exception&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("In ReadFiles " + goof.message)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility for Creating Shared Data Sets contained in the project&lt;/p&gt;
&lt;p&gt;Public Sub CreateDataSet(ByVal filename as string)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim valstart as integer&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim valend as integer&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim DSDefinitionStr as string&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim DataSourceName as string&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim QueryString as string&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Dim stream As FileStream = File.OpenRead(filePath + "\" + filename )&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;definition = New [Byte](stream.Length-1) {}&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Read(definition, 0, CInt(stream.Length))&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Close()&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;For i As Integer = 0 To definition.Length - 1&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;DSDefinitionStr = DSDefinitionStr + Convert.ToString(Convert.ToChar(Convert.ToInt16(definition(i).ToString)))&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Next&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart=DSDefinitionStr.ToString.Indexof("&amp;lt;DataSourceReference&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If valstart &amp;gt; 0 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;DataSourceReference&amp;gt;") + 21&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/DataSourceReference&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;DataSourceName=DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine(DataSourceName)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch e As IOException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine(e.Message)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;filename=filename.tostring.replace(".rsd","")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Attempting to Deploy DataSet {0}", filename)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Dim item as CatalogItem&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;item=rs.CreateCatalogItem("DataSet",filename, "/" + DataSetFolder, false, definition, nothing, warnings)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If Not (warnings Is Nothing) Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Dim warning As Warning&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;For Each warning In warnings&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;if warning.message.tostring.tolower.contains("refers to the shared data source") then&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Console.WriteLine("Connecting DataSet {0} to Data Source {1}",filename, DataSourceName)&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Dim referenceData() as ItemReferenceData = rs.GetItemReferences("/" + DataSetFolder + "/" + filename,"DataSet")&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Dim references(0) as ItemReference&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Dim reference as New ItemReference()&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Dim datasourceURL = DataSourcePath + "/" + DataSourceName&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;reference.name=referenceData(0).Name&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Console.WriteLine("Reference name = " + reference.name)&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;reference.Reference=datasourceURL&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;references(0)=reference&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;rs.SetItemReferences("/" + DataSetFolder + "/" + filename, references)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;else&lt;/p&gt;
&lt;p style="padding-left: 150px;"&gt;Console.WriteLine(warning.Message)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;end if&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Next warning&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Else&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("DataSet: {0} published successfully with no warnings", filename)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof as SoapException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If goof.Message.Indexof("AlreadyExists")&amp;gt;0 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("The DataSet {0} already exists",fileName.ToString)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Else&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;If goof.Message.IndexOf("published")=-1 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.Writeline(goof.Message)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'UpdateDataSetSources(filename,DataSetFolder, DataSourceFolder,DataSourceName)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility for creating Data Sources on the Server&lt;/p&gt;
&lt;p&gt;Public Sub CreateDataSource(filename as string)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'Define the data source definition.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim dsDefinition As New DataSourceDefinition()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim DataSourceName as string&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim valstart As Integer&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim valend As Integer&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim ConnectionString As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim Extension As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim IntegratedSec As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim DataSourceID As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim PromptStr As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;PromptStr=""&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim DSDefinitionStr As String&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;DSDefinitionStr = ""&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;DataSourceName=filename.tostring.trim.substring(0,filename.tostring.trim.length-4)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Attempting to Deploy Data Source {0}", DataSourceName)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Dim stream As FileStream = File.OpenRead(filepath + "\" + filename)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;bytedefinition = New [Byte](stream.Length) {}&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Read(bytedefinition, 0, CInt(stream.Length))&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Close()&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;For i As Integer = 0 To bytedefinition.Length - 1&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;DSDefinitionStr = DSDefinitionStr + Convert.ToString(Convert.ToChar(Convert.ToInt16(bytedefinition(i).ToString)))&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Next&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof As IOException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine(goof.Message)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If DSDefinitionStr.ToString.Contains("&amp;lt;ConnectString&amp;gt;") And DSDefinitionStr.ToString.Contains("&amp;lt;/ConnectString&amp;gt;") Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;ConnectString&amp;gt;") + 15&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/ConnectString&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;ConnectionString = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If DSDefinitionStr.ToString.Contains("&amp;lt;Extension&amp;gt;") And DSDefinitionStr.ToString.Contains("&amp;lt;/Extension&amp;gt;") Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;Extension&amp;gt;") + 11&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/Extension&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Extension = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If DSDefinitionStr.ToString.Contains("&amp;lt;IntegratedSecurity&amp;gt;") And DSDefinitionStr.ToString.Contains("&amp;lt;/IntegratedSecurity&amp;gt;") Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;IntegratedSecurity&amp;gt;") + 20&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/IntegratedSecurity&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;IntegratedSec = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If DSDefinitionStr.ToString.Contains("&amp;lt;DataSourceID&amp;gt;") And DSDefinitionStr.ToString.Contains("&amp;lt;/DataSourceID&amp;gt;") Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;DataSourceID&amp;gt;") + 14&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/DataSourceID&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;DataSourceID = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If DSDefinitionStr.ToString.Contains("&amp;lt;Prompt&amp;gt;") And DSDefinitionStr.ToString.Contains("&amp;lt;/Prompt&amp;gt;") Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valstart = DSDefinitionStr.ToString.IndexOf("&amp;lt;Prompt&amp;gt;") + 8&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;valend = DSDefinitionStr.ToString.IndexOf("&amp;lt;/Prompt&amp;gt;")&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;PromptStr = DSDefinitionStr.ToString.Substring(valstart, valend - valstart)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.CredentialRetrieval = CredentialRetrievalEnum.Integrated&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.ConnectString = ConnectionString&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.Enabled = True&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.EnabledSpecified = True&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.Extension = extension&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.ImpersonateUser = False&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.ImpersonateUserSpecified = True&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;'Use the default prompt string.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;If PromptStr.ToString.Length=0 Then&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;dsdefinition.Prompt = Nothing&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Else&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;dsdefinition.Prompt = PromptStr&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End if&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;dsdefinition.WindowsCredentials = False&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;rs.CreateDataSource(DataSourceName, "/" + DataSourceFolder, False, dsdefinition, Nothing)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine("Data source {0} created successfully", DataSourceName.ToString)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof as SoapException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If goof.Message.Indexof("AlreadyExists")&amp;gt;0 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("The Data Source name {0} already exists",DataSourceName.ToString)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility to Publish the Reports&lt;/p&gt;
&lt;p&gt;Public Sub PublishReport(ByVal reportName As String)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Dim stream As FileStream = File.OpenRead(filePath + "\" + reportName )&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;definition = New [Byte](stream.Length) {}&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Read(definition, 0, CInt(stream.Length))&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;stream.Close()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch e As IOException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine(e.Message)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;reportname=reportname.tostring.replace(".rdl","")&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Attempting to Deploy Report Name {0}", reportname.tostring)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Dim item as CatalogItem&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;item=rs.CreateCatalogItem("Report",reportname, "/" + ReportFolder, false, definition,nothing, warnings)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;'warnings = rs.CreateCatalogItem(reportName, "/" + ReportFolder, False, definition, Nothing)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If Not (warnings Is Nothing) Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Dim warning As Warning&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;For Each warning In warnings&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Console.WriteLine(warning.Message)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Next warning&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Else&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("Report: {0} published successfully with no warnings", reportName)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof as SoapException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;If goof.Message.Indexof("AlreadyExists")&amp;gt;0 Then&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Console.WriteLine("The Report Name {0} already exists",reportName.ToString)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Else&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;If goof.Message.IndexOf("published")=-1 Then&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Console.WriteLine(goof.Message)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;End If&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Utility to Update The Data Sources on the Server&lt;/p&gt;
&lt;p&gt;Public Sub UpdateDataSources(ReportFolder as string, DataSourcePath as string)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;rs.Credentials = System.Net.CredentialCache.DefaultCredentials&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim item as CatalogItem&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim items as CatalogItem()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Try&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;items=rs.ListChildren("/" + ReportFolder, False)&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;For Each item in items&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Dim dataSources() as DataSource = rs.GetItemDataSources(item.Path)&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;For Each ds as DataSource in dataSources&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Dim sharedDs(0) as DataSource&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;sharedDs(0)=GetDataSource(DataSourcePath, ds.Name)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;rs.SetItemDataSources(item.Path, sharedDs)&lt;/p&gt;
&lt;p style="padding-left: 120px;"&gt;Console.WriteLine("Set " &amp;amp; ds.Name &amp;amp; " datasource for " &amp;amp; item.Path &amp;amp; " report")&lt;/p&gt;
&lt;p style="padding-left: 90px;"&gt;Next&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Next&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine("Shared data source reference set for reports in the {0} folder.", ReportFolder)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Catch goof As SoapException&lt;/p&gt;
&lt;p style="padding-left: 60px;"&gt;Console.WriteLine(goof.Detail.InnerXml.ToString())&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;End Try&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;'Function to Reference Data Sources&lt;/p&gt;
&lt;p&gt;Private Function GetDataSource(sharedDataSourcePath as string, dataSourceName as String) as DataSource&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim reference As New DataSourceReference()&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Dim ds As New DataSource&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;reference.Reference = sharedDataSourcePath &amp;amp; "/" &amp;amp; dataSourceName&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;ds.Item = CType(reference, DataSourceDefinitionOrReference)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;ds.Name = dataSourceName&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;Console.WriteLine("Attempting to Publish Data Source {0}", ds.Name)&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;GetDataSource=ds&lt;/p&gt;
&lt;p&gt;End Function&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10378759" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Reporting Services Parameters" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/Reporting+Services+Parameters/" /></entry><entry><title>WebPage Error when running a parameterized report with parameters.</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/05/16/webpage-error-when-running-a-parameterized-report-with-parameters.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/05/16/webpage-error-when-running-a-parameterized-report-with-parameters.aspx</id><published>2012-05-16T19:34:47Z</published><updated>2012-05-16T19:34:47Z</updated><content type="html">&lt;p&gt;I was recently onsite visiting one of my customers when a rather interesting issue was brought to my attention. The customer was running Reporting Services 2008 R2 in SharePoint Integrated Mode and was testing a very simple report that contained a single parameter with 485 possible values. If they selected 484 of the possible 485 parameter values, then the report rendered exactly as expected. If they selected all 485 of the possible parameter values, then Reporting Services returned an error similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Webpage error details&lt;/p&gt;
&lt;p&gt;User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT&lt;br /&gt;6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR&lt;br /&gt;3.0.30729; Media Center PC 6.0; .NET4.0C; InfoPath.3; .NET4.0E; Tablet PC 2.0)&lt;/p&gt;
&lt;p&gt;Timestamp: Tue, 15 May 2012 17:49:04 UTC&lt;/p&gt;
&lt;p&gt;Message:&lt;br /&gt;Sys.WebForms.PageRequestManagerParserErrorException: The message received from&lt;br /&gt;the server could not be parsed. Common causes for this error are when the&lt;br /&gt;response is modified by calls to Response.Write(), response filters,&lt;br /&gt;HttpModules, or server trace is enabled.&lt;/p&gt;
&lt;p&gt;Details: Error parsing near '&lt;/p&gt;
&lt;p&gt;&amp;lt;!DOCTYPE html PUB'.&lt;/p&gt;
&lt;p&gt;Line: 5&lt;/p&gt;
&lt;p&gt;Char: 62099&lt;/p&gt;
&lt;p&gt;Code: 0&lt;/p&gt;
&lt;p&gt;After searching around quite a bit (with very little luck), one of my colleagues pointed me to KB article &lt;a href="http://support.microsoft.com/kb/2661403"&gt;http://support.microsoft.com/kb/2661403.&lt;/a&gt;&amp;nbsp;The error messages there didn't exactly match the error message that we were seeing, but it was close enough that we decided to test adding the following value to the &amp;lt;appSettings&amp;gt; section of the web.config file for the IIS Server:&lt;/p&gt;
&lt;p&gt;&amp;lt;add key="aspnet:MaxHttpCollectionKeys" value="10000" /&amp;gt;&lt;/p&gt;
&lt;p&gt;After saving the web.config and running IISReset, we were able to successfully run the affected reports without encountering an error.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10305969" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="Reporting Services Parameters" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/Reporting+Services+Parameters/" /></entry><entry><title>Filters aren't applied to related tables in PowerPivot unless a measure is added to the PowerPivot Workbook</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/05/16/filters-aren-t-applied-to-related-tables-in-powerpivot-unless-a-measure-is-added-to-the-powerpivot-workbook.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/05/16/filters-aren-t-applied-to-related-tables-in-powerpivot-unless-a-measure-is-added-to-the-powerpivot-workbook.aspx</id><published>2012-05-16T19:13:00Z</published><updated>2012-05-16T19:13:00Z</updated><content type="html">&lt;p&gt;A colleague,&amp;nbsp;with whom I work on a regular basis,&amp;nbsp;recently pointed out a somewhat unexpected feature of PowerPivot PivotTables. What my colleague was seeing was that when creating a PowerPivot PivotTable, placing a column from one of the Dimension tables on rows then adding a column from a related (Parent) table in&amp;nbsp;one of&amp;nbsp;the slicers and selecting a specific member&amp;nbsp;from the slicer&amp;nbsp;the action did not apply a filter to the&amp;nbsp;related&amp;nbsp;dimension&amp;nbsp;that had been placed on rows. When a measure was added to the PivotTable, however, the dimension that was on rows the filter was magically applied. This behavior is relatively easy to reproduce using a few tables from the Adventure Works relational database. So for those who want a reason to just play with PowerPivot (take your pick of the version), here are some relatively simple steps to reproduce the behavior.&lt;/p&gt;
&lt;p&gt;Start by creating a new PowerPivot workbook that uses the Adventure&amp;nbsp; Works DW 2008 (you can also use Adventure Works DW 2008 R2) as the data source. Launch the Import Wizard and importing the following tables:&lt;/p&gt;
&lt;p&gt;DimCustomer&lt;/p&gt;
&lt;p&gt;DimGeograpy&lt;/p&gt;
&lt;p&gt;DimProduct&lt;/p&gt;
&lt;p&gt;DimProductCategory&lt;/p&gt;
&lt;p&gt;DimProductSubCategory&lt;/p&gt;
&lt;p&gt;FactInternetSales&lt;/p&gt;
&lt;p&gt;If relationships don't exist between the DimProduct, DimProductCategory, DimProductSubCategory and FactInternetsales tables aren't automatically imported, create them manually.&lt;/p&gt;
&lt;p&gt;Create a new PowerPivot PivotTable, then put&amp;nbsp;DimProductCategory.EnglishProductCategoryName in a vertical slicer (you can&amp;nbsp;use a horizontal slicer if you want). Next drop&amp;nbsp;DimProductSubCategory.EnglishProductSubcategoryName on rows. Now for a bit of fun and entertainment,&amp;nbsp;select "Bikes" from the slicer and pay careful attention to what doesn't happen with the&amp;nbsp;EnglishProductSubcategoryName members that are on rows.&amp;nbsp;Now that we're all&amp;nbsp;satisfied that the filter hasn't been applied, add&amp;nbsp;InternetSalesFact.InternetSalesAmount to the values area and note what happens with the DimProductSubCategory.EnglishProductSubcategoryName members that are on rows.&lt;/p&gt;
&lt;p&gt;This is designed behavior. &lt;span style="color: black; font-family: 'Segoe UI','sans-serif'; font-size: 10pt; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;"&gt;Cross filtering in slicers works&amp;nbsp;in relationship to&amp;nbsp;measures and is "turned off" until a measure is added to the PivotTable. So in this case, even though there are relationships between the DimProductCategory, DimProductSubCategory, DimProduct, and FactInternetSales tables, the filter applied to the DimProductCategory.EnglishProductCategoryName has no impact on the DimProductSubCategory.EnglishProductSubCategoryName members on rows until a measure is added to the PivotTable.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10305964" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="PowerPivot Filter Slicer" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/PowerPivot+Filter+Slicer/" /></entry><entry><title>Using PowerPivot Workbooks from a Mid-Tier Server Configured for Kerberos Authentication</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/04/23/using-powerpivot-workbooks-from-a-mid-tier-server-configured-for-kerberos-authentication.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/04/23/using-powerpivot-workbooks-from-a-mid-tier-server-configured-for-kerberos-authentication.aspx</id><published>2012-04-23T20:03:26Z</published><updated>2012-04-23T20:03:26Z</updated><content type="html">&lt;p&gt;I'm not entirely certain how widely known, but it is quite possible to use a PowerPivot Workbook as a data source for other client applications. For example, both Excel and Reporting Services can use a PowerPivot workbook named AdventureWorks.xlsx that resides on a PowerPivot Mid-Tier server by specifying the data source as something like:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;a href="http://my_server/powerpivot/AdventureWorks.xlsx"&gt;http://my_server/powerpivot/AdventureWorks.xlsx&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As a result, we would get a connection to a database with a name something like "AdventureWorks Sandboc 3de9890a-fa74-4fb9-be04-858b75366b68" and a cube named "Model". What really happens behind the scenes is that when the client application connects to the PowerPivot workbook, the connection is routed through a Redirector service to the Analysis Services server running in PowerPivot mode. The client then actually connects to the Analysis Services server. That's all well and good assuming that the connection to the Analysis Services server involves a single hop or that the Analysis Services PowerPivot server and SharePoint are not configured for Kerberos authentication.&lt;/p&gt;
&lt;p&gt;Obviously if the connection involves a double hop, as would be the case in a client workstation (machine A) connecting to a Reporting Services server (machine B) that uses a PowerPivot Workbook on a PowerPivot Mid-Tier Server (machine c), is going to require Kerberos authentication. Likewise, if the PowerPivot mid-tier server is configured for Kerberos authentication then it is going to expect a Kerberos ticket as part of the authentication process. In either of these scenarios, out of the box, the likely result is going to be an authentication failure with error code 401 being returned from IIS.&lt;/p&gt;
&lt;p&gt;Remember that when the data source is the PowerPivot Mid-Tier hosted PowerPivot workbook that the connection goes through a Redirector service and is ultimately routed to the Analysis Services PowerPivot instance. The 401 authentication failure error will be returned because the out-of-the-box customBindings for the Redirector service are configured to use "Ntlm" authentication which results in&amp;nbsp;an Ntlm token rather than a kerberos token being used for authentication.&amp;nbsp;In order to access the data source in this scenario, it is necessary to modify the web.config file associated with the Redirector.svc. To enable use of Kerberos authentication, it is necessary to change both of the CubsomBindings for the Redirector.svc service.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Before going further, I'll point out that enabling use of Kerberos authentication&amp;nbsp;necessitates manually editing the web.config file that is associated with the Redirector.svc.&amp;nbsp;Before editing the web.config file, it would be an extremely good idea to create a backup of the file and store it in a separate directory so that it can be restored in the event that the web.config file becomes corrupted while being edited.&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The default location for the file is&amp;nbsp;%SystemDrive%\program files\common files\web service extensions\14\ISAPI\powerpivot. Open the web.config file with a text editor and locate the &amp;lt;binding name="RedirectorBinding"&amp;gt; tag and the &amp;lt;binding name="RedirectorSecurBinding"&amp;gt; tags and change the authenticationScheme value from "Ntlm" to "Negotiage", as shown below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;binding&lt;span style="color: #ff0000;"&gt; name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;RedirectorBinding&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;webMessageEncoding &lt;span style="color: #ff0000;"&gt;webContentTypeMapperType&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Microsoft.AnalysisServices.SharePoint.Integration.Redirector.RawContentTypeMapper, Microsoft.AnalysisServices.SharePoint.Integration&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;httpTransport &lt;span style="color: #ff0000;"&gt;manualAddressing&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #ff0000;"&gt;authenticationScheme&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Ntlm&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;transferMode&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Streamed&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;9223372036854775807&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;binding&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;binding&lt;span style="color: #ff0000;"&gt; name&lt;/span&gt;="&lt;span style="color: #0000ff;"&gt;RedirectorSecureBinding&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;webMessageEncoding &lt;span style="color: #ff0000;"&gt;webContentTypeMapperType&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Microsoft.AnalysisServices.SharePoint.Integration.Redirector.RawContentTypeMapper, Microsoft.AnalysisServices.SharePoint.Integration&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;httpsTransport &lt;span style="color: #ff0000;"&gt;manualAddressing&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #ff0000;"&gt;authenticationScheme&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Ntlm&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;transferMode&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Streamed&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;9223372036854775807&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;binding&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;to&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;binding&lt;span style="color: #ff0000;"&gt; name&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;RedirectorBinding&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;webMessageEncoding &lt;span style="color: #ff0000;"&gt;webContentTypeMapperType&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Microsoft.AnalysisServices.SharePoint.Integration.Redirector.RawContentTypeMapper, Microsoft.AnalysisServices.SharePoint.Integration&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;httpTransport &lt;span style="color: #ff0000;"&gt;manualAddressing&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #ff0000;"&gt;authenticationScheme&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Negotiate&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;transferMode&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Streamed&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;9223372036854775807&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;binding&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;binding&lt;span style="color: #ff0000;"&gt; name&lt;/span&gt;="&lt;span style="color: #0000ff;"&gt;RedirectorSecureBinding&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;webMessageEncoding &lt;span style="color: #ff0000;"&gt;webContentTypeMapperType&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Microsoft.AnalysisServices.SharePoint.Integration.Redirector.RawContentTypeMapper, Microsoft.AnalysisServices.SharePoint.Integration&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;httpsTransport &lt;span style="color: #ff0000;"&gt;manualAddressing&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="background-color: #ffff00;"&gt;&lt;span style="color: #ff0000;"&gt;authenticationScheme&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Negotiate&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;transferMode&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;Streamed&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;maxReceivedMessageSize&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;9223372036854775807&lt;/span&gt;&lt;span style="color: #000000;"&gt;"&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #993300;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;/&lt;/span&gt;binding&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That should resolve the 401 error when attempting to use a PowerPivot Workbook, hosted on the PowerPivot Mid-Tier server, as a data source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10296802" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="PowerPivot Kerberos Data Source" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/PowerPivot+Kerberos+Data+Source/" /></entry><entry><title>Parameterized Reporting Services Reports with Analysis Services as a Data Source</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2012/04/16/parameterized-reporting-services-reports-with-analysis-services-as-a-data-source.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2012/04/16/parameterized-reporting-services-reports-with-analysis-services-as-a-data-source.aspx</id><published>2012-04-16T18:23:00Z</published><updated>2012-04-16T18:23:00Z</updated><content type="html">&lt;p&gt;Microsoft Analysis Services is a commonly used data source for Microsoft Reporting Services reports. The combination provides an environment for creating and rendering interactive reports that are highly performant, flexible and rich in functionality. One of the features of Reporting Services that provides end users with the ability to interact with the data is the use of parameters within the MDX queries that allow users to request different data sets. Just about anyone who has created a Reporting Services report has had an opportunity to create parameterized queries, which might look something like the following:&lt;/p&gt;
&lt;p&gt;SELECT NON EMPTY { [Measures].[Internet Freight Cost] } ON COLUMNS,&lt;/p&gt;
&lt;p&gt;NON EMPTY { ([Customer].[Customer Geography].[Customer].ALLMEMBERS ) }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS&lt;/p&gt;
&lt;p&gt;FROM ( SELECT ( STRTOSET(@Date, CONSTRAINED) ) ON COLUMNS FROM [Adventure Works])&lt;/p&gt;
&lt;p&gt;WHERE ( IIF( STRTOSET(@Date, CONSTRAINED).Count = 1,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; STRTOSET(@Date, CONSTRAINED), [Date].[Calendar].currentmember ) )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS&lt;/p&gt;
&lt;p&gt;OR&lt;/p&gt;
&lt;p&gt;SELECT NON EMPTY { [Measures].[Internet Freight Cost] } ON COLUMNS,&lt;/p&gt;
&lt;p&gt;NON EMPTY { ([Customer].[Customer Geography].[Customer].ALLMEMBERS ) }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS&lt;/p&gt;
&lt;p&gt;FROM ( SELECT ( STRTOSET(@Group, CONSTRAINED) ) ON COLUMNS FROM [Adventure Works])&lt;/p&gt;
&lt;p&gt;WHERE ( IIF( STRTOSET(@Group, CONSTRAINED).Count = 1,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;STRTOSET(@Group, CONSTRAINED), [Customer].[Customer Geography].currentmember ) )&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS&lt;/p&gt;
&lt;p&gt;The STRTOSET() function is what really enables the use of parameters in the MDX queries used within Reporting Services. The convention for parameters in Reporting Services is to place the &amp;ldquo;@&amp;rdquo; symbol in front of the parameter name. I&amp;rsquo;ve been around Analysis Services and MDX long enough to know that &lt;b&gt;DATE&lt;/b&gt; is the name for an attribute type (making it a reserved word) and &lt;b&gt;GROUP&lt;/b&gt; is an MDX Keyword. (I know, what was I thinking using a reserved word and a keyword as parameter names?) When using either of the above MDX queries with Analysis Services 2005 or Analysis Services 2008, the queries would return the data as expected. Being the intrepid soul that I am, I therefore very confidently expect that when the data source is upgraded from Analysis Services 2008 to Analysis Services 2008 R2 that my report will reliably return the data sets that I expect. Unfortunately, what I&amp;rsquo;m going to get are the error messages below:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parser: The syntax for &amp;lsquo;Date&amp;rsquo; is incorrect&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Parser: The syntax for &amp;lsquo;Group&amp;rsquo; is incorrect&lt;/p&gt;
&lt;p&gt;This is a known issue with the query parser in Analysis Services 2008 R2 (the published KB article is &lt;a href="http://support.microsoft.com/kb/2638216"&gt;http://support.microsoft.com/kb/2638216&lt;/a&gt;). The issue was addressed in Service Pack 1 Cumulative Update 4 (build number 10.50.2796) and is not present in the SQL Server 2012 Analysis Services release. I&amp;rsquo;d be surprised if everyone reading this blog were familiar with all of the reserved words and keywords used with Analysis Services, so rather than simply saying &amp;ldquo;you can look &amp;lsquo;em up in Books On Line&amp;rdquo;, you should be able to find them at the following hyperlinks:&lt;/p&gt;
&lt;p&gt;&lt;a title="Configure Attribute Types" href="http://msdn.microsoft.com/en-us/library/ms175662.aspx"&gt;Configure Attribute Types&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="MDX Reserved Words" href="http://msdn.microsoft.com/en-us/library/ms145629.aspx"&gt;MDX Reserved Words&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10294212" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="OLAP Parameters" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/OLAP+Parameters/" /></entry><entry><title>Planning for Disaster Recovery for PowerPivot Mid-Tier Server</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/b/johndesch/archive/2011/11/28/planning-for-disaster-recovery-for-powerpivot-mid-tier-server.aspx" /><id>http://blogs.msdn.com/b/johndesch/archive/2011/11/28/planning-for-disaster-recovery-for-powerpivot-mid-tier-server.aspx</id><published>2011-11-28T20:07:00Z</published><updated>2011-11-28T20:07:00Z</updated><content type="html">&lt;div class="ExternalClassCAA6A26570B545EC9EA0E133895D13F9"&gt;
&lt;p&gt;Every experienced DBA is familiar with the software equivalent of &amp;ldquo;Murphy&amp;rsquo;s Law&amp;rdquo; and the notion that if something can go wrong, it will.&amp;nbsp; We all know that hardware can and does fail. Now that I think about it, that&amp;rsquo;s where I first became acquainted with the term &amp;ldquo;mean time between failures.&amp;rdquo; As a result, bad things can occasionally happen to good databases and it&amp;rsquo;s usually at a very inopportune time. That probably explains why, as a group, we tend to be real concerned with having something that resembles a well-designed and tested plan for backing up and restoring databases after a disaster. It&amp;rsquo;s not terribly surprising that most of us are reasonably familiar with the SQL Server Recovery Models and the implications of each for disaster recovery. &amp;nbsp;Analysis Services ships with SQL Server, which probably explains why we&amp;rsquo;re administering this type of server in addition to the relational database servers. Like any other database, it can fall victim to hardware failures, corruption, fire, flood, pesky rodents or other issues that make one or more databases inaccessible.&lt;/p&gt;
&lt;p&gt;Those activities typically involve:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Regular backups of the database(s) to minimize data loss.&lt;/li&gt;
&lt;li&gt;Storage of backups in a secure on site or off site location&lt;/li&gt;
&lt;li&gt;Periodically testing the backup and recovery strategies before a real failure occurs.&lt;/li&gt;
&lt;li&gt;Assessment of the recovery plan using a cold standby server&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There is a relatively new variant of Analysis Services that is integrated with SharePoint 2010 in the PowerPivot Mid-Tier Server that was released with SQL Server 2008 R2. PowerPivot Mid-Tier Server is essentially an instance of Analysis Services, but the architecture is a bit different than the traditional Unified Dimensional Model due to the integration with SharePoint. Unfortunately, most DBAs aren&amp;rsquo;t intimately familiar with SharePoint Server and the concept of SharePoint Server Farms. SharePoint, like any other type of server, is subject to disaster so it&amp;rsquo;s a good idea to have a disaster recovery plan in place.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;span style="font-size: small;"&gt;The documentation on SharePoint 2010 Disaster Recovery is relatively sparse. One of the more comprehensive documents on SharePoint Server 2010 Disaster Recovery is on Technet (&lt;a href="http://technet.microsoft.com/en-us/library/ff628971.aspx"&gt;http://technet.microsoft.com/en-us/library/ff628971.aspx&lt;/a&gt;). Todd Klindt discusses &lt;a href="http://www.windowsitpro.com/content1/topic/sharepoint-2010-disaster-recovery/catpath/sharepoint"&gt;SharePoint 2010 Disaster Recovery&lt;/a&gt; and Randy Williams discussed &lt;a href="http://www.windowsitpro.com/content1/tabid/57/catpath/disaster-recovery3/topic/step-by-step-sharepoint-disaster-recovery"&gt;Step-by-Step SharePoint Disaster Recovery&lt;/a&gt; in some detail. As they point out, SharePoint stores configuration, content and administration data in SQL Server databases. So obviously, the first part of any plan for disaster recovery involves regular backups of the Configuration, Content, and Administration databases (and if you aren&amp;rsquo;t already taking regular backups, you obviously haven&amp;rsquo;t had the panic attack that we&amp;rsquo;ve all experienced with a notification that a production server is down). With PowerPivot Mid-Tier server, data for the PowerPivot Service Application is also stored in a SQL Server database.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: small;"&gt;&lt;/span&gt;&lt;span style="font-size: small;"&gt;What the documentation doesn&amp;rsquo;t really tell you is that with the PowerPivot Mid-Tier, the uploaded PowerPivot workbooks are stored in the Content database, so having a valid backup of that database is a definite must. Having said that, this is what I learned from the pain of experience attempting to test a disaster recovery plan using a cold standby SharePoint 2010 Server. I should note that even though I lost quite a bit of hair and am now completely gray, no databases were harmed in the process of testing this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In order for any disaster recovery plan to succeed, the cold standby SharePoint 2010 server that the production SharePoint 2010 server will need to reside in the same domain and preferably configured to use the same service accounts. Failing either of those conditions, you could be in for a lot of failures (not to mention as bald and gray as me) when attempting to pull up any Excel Workbooks that have been stored in the PowerPivot Mid-Tier server.&amp;nbsp; After more hours than I care to think about, this is what I came up with:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Setup Primary PowerPivot Mid-Tier server&lt;/li&gt;
&lt;ol&gt;
&lt;li&gt;Install SharePoint&lt;/li&gt;
&lt;li&gt;Install PowerPivot (New or Existing Farm). Which one you do depends on whether or not you ran the Configuration Wizard after installing SharePoint. If you ran the Configuration Wizard after installing SharePoint, you'll want to select the "Existing Farm" option. If you &lt;strong&gt;&lt;span style="text-decoration: underline;"&gt;&lt;em&gt;did not&lt;/em&gt;&lt;/span&gt;&lt;/strong&gt; run the Configuration Wizard after installing SharePoint, you'll want to select the "New Farm" option.&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;Test the PowerPivot Site&lt;/li&gt;
&lt;li&gt;Setup Cold Standby PowerPivot Mid-Tier server using same setup strategy that was used for the Primary&lt;/li&gt;
&lt;li&gt;Test the PowerPivot site on the Cold Standby&lt;/li&gt;
&lt;li&gt;Create a Test PowerPivot workbook and upload to the mid-tier server&lt;/li&gt;
&lt;li&gt;Verify that Data Refresh works&lt;/li&gt;
&lt;li&gt;From SSMS on the Primary server, backup the SharePoint_Content_.... Database&lt;/li&gt;
&lt;li&gt;Copy the SharePoint_Content_...bak file to the Cold Standby&lt;/li&gt;
&lt;li&gt;From SSMS on the Cold Standby, restore the SharePoint_Content_.... database from the .bak file&lt;/li&gt;
&lt;li&gt;From SharePoint Central Admin on the Cold Standby, select "Manage content databases"&lt;/li&gt;
&lt;li&gt;From the Central Administration &amp;gt; Manage Content Databases page, click on the existing SharePoint_Content_... database. That will open the Central Administration &amp;gt; Manage Content Database Settings page&lt;/li&gt;
&lt;li&gt;Check the "Remove Content Database" checkbox&lt;/li&gt;
&lt;li&gt;That will cause a "Message from webpage" with the following and rather&amp;nbsp;ominous&amp;nbsp;warning:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Warning: There are sites stored in this content database. If you &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; remove the database, those sites will no longer be accessible to &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; users. Click OK to remove the database, or Cancel to leave the &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; database connected."&lt;/li&gt;
&lt;li&gt;Click OK&lt;/li&gt;
&lt;li&gt;Click OK&lt;/li&gt;
&lt;li&gt;From the Central Administration &amp;gt; Manage Content Databases page, click "Add a content database"&lt;/li&gt;
&lt;li&gt;Set the Database Name field to the name of the database that was restored in step 9.&lt;/li&gt;
&lt;li&gt;Click OK&lt;/li&gt;
&lt;li&gt;Test the PowerPivot site on the Cold Standby server. At this point, any Excel PowerPivot Workbooks that were stored in the Primary Server should be visible and accessible on the Cold Standby server.&lt;/li&gt;
&lt;li&gt;Schedule a Data Refresh to run "Also refresh as soon as possible"&lt;/li&gt;
&lt;li&gt;Verify that the Data Refresh was successful.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Your Disaster Recovery test should have been successful.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For purposes of disclosure, I do work for Microsoft.&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10242133" width="1" height="1"&gt;</content><author><name>John Desch MSFT</name><uri>http://blogs.msdn.com/johndesch_4000_hotmail.com/ProfileUrlRedirect.ashx</uri></author><category term="PowerPivot Disaster Recovery" scheme="http://blogs.msdn.com/b/johndesch/archive/tags/PowerPivot+Disaster+Recovery/" /></entry></feed>