<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Jason's Technical Topics</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jason_howell/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jason_howell/feed.xml</link>
    <description>A collection of technical situations and solutions I&amp;#039;ve run across while using SQL Server, focusing on SQL Analysis Services, SQL Integration Services, and plenty of other random topics.</description>
    <lastBuildDate>Sat, 11 Apr 2015 07:39:52 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>What is the RPC and RPC Out option on a SQL Server linked-server?</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/what-is-the-rpc-and-rpc-out-option-on-a-sql-server-linked-server</link>
      <pubDate>Wed, 01 Oct 2014 16:43:00 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2014/10/01/what-is-the-rpc-and-rpc-out-option-on-a-sql-server-linked-server/</guid>
      <description><![CDATA[Someone&nbsp;asked me this week - what are the relevance of the RPC and RPC Out settings on a linked...]]></description>
      <content:encoded><![CDATA[<p>Someone&nbsp;asked me this week - what are the relevance of the RPC and RPC Out settings on a linked server? Do you need both of them or only one of them set to True?</p>
<p>The documentation is online in this article, but it doesn't clearly show examples or provide enough context, so I will try to do that here.<a href="https://technet.microsoft.com/en-us/library/ms186839(v=SQL.105).aspx">https://technet.microsoft.com/en-us/library/ms186839(v=SQL.105).aspx</a></p>
<hr style="width: 100%;" width="100%" />
<p>1. The first <strong>RPC</strong> setting is mainly for a legacy feature called <em><strong>Remote Server</strong></em>, which is documented here. <a href="https://msdn.microsoft.com/en-us/library/ms190187.aspx">https://msdn.microsoft.com/en-us/library/ms190187.aspx</a></p>
<p>You probably will not be using remote servers in SQL Server 2005 -SQL Server 2014 versions.</p>
<p>If you do happen to use "remote servers", the <strong>RPC</strong> setting enables a certain security feature. If it is turned off, when the second server (the one receiving the login attempt from the first server to which the client connected) tries to validate the remote login, it fails with error</p>
<p style="padding-left: 30px;"><span style="color: #800000;">18482 &ldquo;Could not connect to server '%.*ls' because '%.*ls' is not defined as a remote server. Verify that you have specified the correct server name. %.*ls.&rdquo;</span></p>
<table border="1">
<tbody>
<tr>
<td>
<p>EXEC master.dbo.sp_serveroption @server=N'MYREMOTESERVER', @optname=N'rpc', @optvalue=N'true'&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/4722.LinkedServerRPCSetting.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65/4722.LinkedServerRPCSetting.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/4722.LinkedServerRPCSetting.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65/4722.LinkedServerRPCSetting.jpg" alt="" border="0" /></a>&nbsp;</p>
<p><span style="font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">Kudos to my peer Ignacio Alonso Portillo for helping figure out this legacy option.</span></p>
<p>&nbsp;</p>
<hr style="width: 100%;" width="100%" />
<p>2. The <strong>RPC OUT</strong>&nbsp; setting is very pertinent to <strong>linked servers</strong> on SQL Server 2005 -SQL Server 2014 versions.</p>
<p>Think about an RPC (Remote Procedure Call) as being a<em> stored procedure</em> being <em>run remotely</em> from Server 1 to linked Server 2 "myserver".</p>
<p>There are various syntaxes, the first using 4 part naming servername.databasename.schemaname.procedurename , the second here using EXECUTE(databasename.schemaname.procedurename ) AT servername convention.</p>
<p>We can test with a simple procedure sp_helpdb that lives in master database, and will list out the databases and some of their key properties.</p>
<ul>
<li>EXEC [myserver].master.dbo.sp_helpdb</li>
<li>EXEC ('master.dbo.sp_helpdb') AT myserver</li>
</ul>
<p>These kind of remote stored procedure calls will be blocked unless RPC OUT is set to True.</p>
<p style="padding-left: 30px;"><span style="color: #800000;">Msg 7411, Level 16, State 1, Line 1&nbsp; Server 'myserver' is not configured for RPC.</span></p>
<p>&nbsp;</p>
<p>You can set it to True or False in the linked server's properties (a right click menu in from the Linked Server Name in SQL Server Management Studio) .</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/6518.LinkedServerRPCOutSetting.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65/6518.LinkedServerRPCOutSetting.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/6518.LinkedServerRPCOutSetting.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65/6518.LinkedServerRPCOutSetting.jpg" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Or you can set it by calling the stored procedure to set the server options like this test:</p>
<table border="2">
<tbody>
<tr>
<td>
<p>&nbsp;<span style="color: #808080;">-- Test RPC OUT as false and get the error</span></p>
<p>EXEC master.dbo.sp_serveroption @server=N'MYSERVER', @optname=N'rpc out', @optvalue=<span style="background-color: #ff99cc;">N'false'</span></p>
<p>GO</p>
<p>EXEC [myserver].master.dbo.sp_helpdb</p>
<p><span style="color: #800000;">-- Msg 7411, Level 16, State 1, Line 1</span></p>
<p><span style="color: #800000;">-- Server 'myserver' is not configured for RPC.</span></p>
<p>GO</p>
<p><span style="color: #999999;">&nbsp;--&nbsp;Test RPC OUT as true and see success</span></p>
<p>EXEC master.dbo.sp_serveroption @server=N'MYSERVER', @optname=N'rpc out', @optvalue=<span style="background-color: #ccffcc;">N'true'</span></p>
<p>GO</p>
<p>EXEC [myserver].master.dbo.sp_helpdb</p>
<p><span style="color: #339966;">-- Command(s) completed successfully.</span></p>
<p>&nbsp;</p>
</td>
</tr>
</tbody>
</table>
<hr style="width: 90%;" width="90%" />
<p><br />I hope this helps someone out there. Let me know if not. ~Jason</p>]]></content:encoded>
    </item>
    <item>
      <title>SSIS error when deploying from VS 2013 to SSISDB in SQL 2012</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/ssis-error-when-deploying-from-vs-2013-to-ssisdb-in-sql-2012</link>
      <pubDate>Tue, 30 Sep 2014 18:39:00 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2014/09/30/ssis-error-when-deploying-from-vs-2013-to-ssisdb-in-sql-2012/</guid>
      <description><![CDATA[An SSIS package has been developed in SSDT-BI Microsoft Visual Studio Professional 2013&nbsp;(freely...]]></description>
      <content:encoded><![CDATA[<p>An SSIS package has been developed in <a href="https://www.microsoft.com/en-us/download/details.aspx?id=42313">SSDT-BI Microsoft Visual Studio Professional 2013</a>&nbsp;(freely available download).</p>
<p>When we deploy the package to SSISDB in SQL Server 2012 RTM or SP1 (11.0.3153.0) and run it, it returns the following error, because the SSIS 2014 package format is not downgradable to SSIS 2012 version format.</p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;"The package failed to load due to error 0xC0010014</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">""One or more error occurred. There should be more specific errors preceding this one that explains the details of the errors. This message is used as a return value from functions that encounter errors."". This occurs when CPackage::LoadFromXML fails.</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.Dts.Runtime.Package.LoadFromXML(String packageXml, IDTSEvents events)</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.Dts.Runtime.Project.LoadPackage(IProjectStorage storage, Package package, String streamName, IDTSEvents events)</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.Dts.Runtime.PackageItem.Load(IDTSEvents events)</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.Dts.Runtime.PackageItem.LoadPackage(IDTSEvents events)</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.IntegrationServices.Server.ISServerExec.ISServerExecutionEvents.LoadPackage(PackageItem item)</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.IntegrationServices.Server.ISServerExec.ProjectOperator.StartPackage()</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">&nbsp;&nbsp; at Microsoft.SqlServer.IntegrationServices.Server.ISServerExec.ProjectOperator.PerformOperation()"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><span style="color: #ff0000;">"Package:Error: Package migration from version 8 to version 6 failed with error 0xC001700A ""The version number in the package is not valid. The version number cannot be greater than current version number.""."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">"Package:Error: Error loading value ""&lt;DTS:Property xmlns:DTS=""<a href="https://www.microsoft.com/SqlServer/Dts"><span style="color: #ff0000;">www.microsoft.com/SqlServer/Dts</span></a>"" DTS:Name=""PackageFormatVersion""&gt;8&lt;/DTS:Property&gt;"" from node ""DTS:Property""."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;">"Package:Error: The version number in the package is not valid. The version number cannot be greater than current version number."</span></p>
<p style="padding-left: 30px;"><span style="color: #ff0000;"><strong>&nbsp;</strong></span></p>
<p>The underlying cause is that currently (Sept 2014 timeframe) SSDT BI 2014 for Visual Studio 2013 does not support SSIS packages for SQL Server 2012.</p>
<p>It is a common feature request, and the product group is well aware of the demand.</p>
<p><a href="https://connect.microsoft.com/SQLServer/feedbackdetail/view/944882/ssdt-bi-2014-backward-compatibility-for-ssis-2012">https://connect.microsoft.com/SQLServer/feedbackdetail/view/944882/ssdt-bi-2014-backward-compatibility-for-ssis-2012</a></p>
<p>At present SSDT for VS 2013 only works with SQL Server 2014. You have to use <a href="https://www.microsoft.com/en-us/download/details.aspx?id=36843">SSDT-BI for Visual Studio 2012</a> with SQL Server 2012 SSISDB.</p>
<p>&nbsp;</p>
<p>Thanks, Jason</p>]]></content:encoded>
    </item>
    <item>
      <title>Analysis Services fails on a cluster with “An attempt was made to access a socket in a way forbidden by its access permissions”</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/analysis-services-fails-on-a-cluster-with-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissions</link>
      <pubDate>Wed, 24 Jul 2013 13:48:17 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2013/07/24/analysis-services-fails-on-a-cluster-with-an-attempt-was-made-to-access-a-socket-in-a-way-forbidden-by-its-access-permissions/</guid>
      <description><![CDATA[The problem  On a clustered SQL Server 2008 R2 installation, we have installed SQL Server in two...]]></description>
      <content:encoded><![CDATA[<h2>The problem</h2>  <p>On a clustered SQL Server 2008 R2 installation, we have installed SQL Server in two separate instances on each cluster node. </p>  <p>One Analysis Services resource will start, but the second one will not come online.</p>  <p>The error is shown in the application event log and in the MSOLAP\LOG\msmdsrv.log</p>  <p>Error(s): event id: 27 - failed to initialize SQL SQM timer   <br /><font color="#ff0000">The service cannot be started: The following system error occurred: <strong>An attempt was made to access a socket in a way forbidden by its access permissions</strong>.</font></p>  <p>&#160;</p>  <h2>The cause</h2>  <p>We found the first Analysis Services instance is listening on all IP addresses to port 2383 on the active node, so the second new instance cannot listen on its default port 2383 on the same node.</p>  <p>We could fail the second instance to the opposite node and it would come online fine. On the first node, we checked to see if the 2383 port is already in use.</p>  <p>&#160;</p>  <h3>1. Find the PID (process idenfitier) for msmdsrv.exe:</h3>  <p> Using task manager, look at the list of Processes.    <br />In the view menu, select the columns to view, and click PID (Process ID) to show that extra column.     <br />Check the box in task manager that says &quot;Show processes for all users&quot;     <br />Now sort the list of processes by name. Locate msmdsrv.exe process.     <br />Found PID 5228 </p>  <p>   <br /></p>  <h3>2. Checked which ports the first working AS instance is listening on using Netstat and cross referencing that pid </h3>  <p>netstat -ano &gt; output.txt    <br />In the output.txt text look for the PID of the msmdsrv.exe to see which ports its listening on. Search (Control+F) for the PID number.    <br />TCP 0.0.0.0:2383 PID 5228     <br />TCP [::]:2383 PID 5228     <br />So this indicates that the first msmdsrv.exe instance (pid 5228) is listening on ALL IP addresses. </p>  <p>&#160;</p>  <p><strong>Shortcut tip: </strong>you can pipe (|) output from netstat into findstr tool to narrow down the output quickly. </p>  <p>netstat -ano |findstr 2383</p>  <p>netstat -ano |findstr 5228</p>  <p>   <br />3. The problem is when the second instance start up, it cannot bind to its own IP address on port 2383 because the first instance has that port taken already. </p> TCP 0.0.0.0:2383 PID 5228   <br />TCP [::]:2383 PID 5228   <p>   <br />We need to limit each instance to only its dedicated IP address from the cluster resources and not all IPs on the node.     <br /></p>  <p>The default port in described in <a href="https://technet.microsoft.com/en-us/library/cc646023.aspx">https://technet.microsoft.com/en-us/library/cc646023.aspx</a></p>  <p><strong>Note </strong>the default port is 2838 for default instances, and this is retained as a setting in the OLAP\CONFIG\mdmsdsrv.ini from the shared disk.    <br />To confirm, find the port tag <strong>&lt;Port&gt;0&lt;/Port&gt;&#160; </strong>in the msmdsrv.ini. Zero indicates dynamic port assignment, which is 2383 for default instances, and dynamic on named instances.    <br /></p>  <h2>The resolution</h2>  <p>Check each Analysis Services resource in the cluster manager, to view the properties. </p>  <p>On the General Tab note the setting &quot;Use Network Name for computer name&quot; See also <a href="https://support.microsoft.com/kb/198893">https://support.microsoft.com/kb/198893</a> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5852.image_5E9A93EB.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5852.image_5F00_5E9A93EB.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0216.image_thumb_3930A07D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0216.image_5F00_thumb_5F00_3930A07D.png" width="388" height="343" /></a></p>  <p>   <br />This setting was unchecked on the first working AS instance. This means that the resource perceives the node name and all IPs,&#160; instead of just the cluster resource IP and cluster virtual name.&#160; </p>  <p>The second failing AS instance was a victim of this setting on the first instance. This setting was causing the first AS instance to bind to the 2383 port on all IPs and preventing the new AS instance from coming online on the same node. </p>  <p>&#160;</p>  <p>So we <strong>check </strong>the setting &quot;Use Network Name for computer name&quot; to limit the instance to see only its IP dependency and its virtual name.     <br />Then restart the AS instance where the change was made - take offline. Bring online in the cluster manager.    <br />That solved the problem. </p>  <p>Now both instances can coexist on the same node and by failed over successfully. </p>  <p>We can run Netstat -ano to see that each msmdsrv.exe process uses port 2383 but on different IP addresses.</p>]]></content:encoded>
    </item>
    <item>
      <title>Cannot reopen an Analysis Services Tabular Project the second time– error database already exists in the detached state</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/cannot-reopen-an-analysis-services-tabular-project-the-second-time-error-database-already-exists-in-the-detached-state</link>
      <pubDate>Mon, 22 Jul 2013 19:56:58 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2013/07/22/cannot-reopen-an-analysis-services-tabular-project-the-second-time-error-database-already-exists-in-the-detached-state/</guid>
      <description><![CDATA[Using SQL Server 2012 Analysis Services running in Tabular mode, we get this error every time we...]]></description>
      <content:encoded><![CDATA[<p>Using SQL Server 2012 Analysis Services running in Tabular mode, we get this error every time we open an existing Tabular Project solution. Even creating a new Analysis Services Tabular Project, closing it, and opening a second time again causes the same error.</p>  <p><strong><font color="#ff0000">An error occurred while opening the model. Click Details for more information.</font></strong></p>  <p><font color="#ff0000">The operation cannot be executed since the database with the name of &lt;name&gt;, ID of &lt;ID&gt; already exists in the detached state in folder '\\?\D:\MSAS11.InstanceName\OLAP\Data\Datababase_c7f3679b-1d5f-44e8-b6d0-25d2de10b7fc.0.db'. Either attach the database or delete the folder and retry the operation. </font></p>  <p>To resolve this error, view the properties of Analysis Services, and ensure that your default Data Directory folder is browsable.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7534.image_7A8FB7EA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7534.image_5F00_7A8FB7EA.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7484.image_thumb_239A56E7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7484.image_5F00_thumb_5F00_239A56E7.png" width="309" height="321" /></a></p>  <p>On the <strong>Analysis Server Properties </strong>page, <strong>General</strong> tab, check the box to <font color="#ff0000"><strong>Show Advanced (All) Properties</strong></font>.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4300.image_4585B96B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4300.image_5F00_4585B96B.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8867.image_thumb_6BEA2D67.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8867.image_5F00_thumb_5F00_6BEA2D67.png" width="766" height="452" /></a></p>  <p>&#160;</p>  <p>Note your <font color="#0000ff">DataDir</font> – this the folder where the tabular databases files live.</p>  <p>My default directory is <font face="Courier New">C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Data</font></p>  <p>&#160;</p>  <p>Now note your <font color="#00ff00">AllowedBrowsingFolders</font><font color="#000000">. This is a pipe | character delimited list of all the folders that the service is allowed to browse and show files in. Without this, Analysis Services will just not enumerate the directories.</font></p>  <p><font face="Courier New">C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Backup\|C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Log\|C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Data\</font></p>  <p>&#160;</p>  <p>The problem we found was that the <strong>DataDir </strong>value was not in the <strong>AllowedBrowsingFolders </strong>list, so we added it to the string - |C:\Program Files\Microsoft SQL Server\MSAS11.TABULAR\OLAP\Data\</p>  <p>This could easily happen if the Default DataDir was changed, but the AllowedBrowsingFolders was not updated to reflect the change.</p>  <h2><strong>Internals</strong></h2>  <p>To figure this out I ran a profiler trace to watch the Command Begin and Command End events in particular.</p>  <p>&#160;</p>  <p>I observed this pattern when it works:</p>  <h3>1. Observe the temporary database creation</h3>  <p>When I make a new Tabular project project in SSDT, the Analysis Services service creates a temporary tabular database, which consists of a folder and an XML pointer file to the folder.&#160; This database is not visible in Management Studio, but is visible in the storage underneath the data folder itself.</p>  <p>Under the DataDir folder, ie.&#160; C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Data, I see two indicators of the new tabular project being staged.</p>  <ul>   <li>/TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082.0.db/ (folder) </li>    <li>/TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082.1.db.xml (file to point to the folder) </li> </ul>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6330.image_4FDBFF2D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6330.image_5F00_4FDBFF2D.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4101.image_thumb_444641EE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4101.image_5F00_thumb_5F00_444641EE.png" width="644" height="66" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4111.image_2667BDED.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4111.image_5F00_2667BDED.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8420.image_thumb_6CE4ADF5.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8420.image_5F00_thumb_5F00_6CE4ADF5.png" width="644" height="47" /></a></p>  <p>&#160;</p>  <h3>2. Observe the detach XMLA</h3>  <p>When I close the Visual Studio project, it issues a detach command to remove the temporary database. The files in the folder should remain.</p>  <table cellspacing="0" cellpadding="2" width="766" border="1"><tbody>     <tr>       <td valign="top" width="764">&lt;Detach xmlns=&quot;https://schemas.microsoft.com/analysisservices/2003/engine&quot;&gt;          <br />&lt;Object&gt;           <br />&lt;DatabaseID&gt;TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082&lt;/DatabaseID&gt;           <br />&lt;/Object&gt;           <br />&lt;/Detach&gt; </td>     </tr>   </tbody></table>  <p>At this time of the detach, the Analysis Services deletes the .xml file pointer to the database, but the database .db folder and its contents remains in tact. </p>  <ul>   <li><strike>/TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082.1.db.xml</strike> (gets deleted) </li>    <li>/TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082.0.db/ (folder remains) </li> </ul>  <p>&#160;</p>  <h3>3. Observe the attach XMLA</h3>  <p>When I open the same project again from the recently used list, it checks for existing folders, and attaches the same existing database using XMLA for attach. </p>  <h4>A. MDX query check for the existing database by running an internal stored procedure</h4>  <p>&#160;<strong>SystemGetSubdirs 'C:\Program Files\Microsoft SQL Server\MSAS11.TABULAR\OLAP\Data'</strong> </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5125.image_5A2FB43E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5125.image_5F00_5A2FB43E.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3414.image_thumb_23555FF8.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3414.image_5F00_thumb_5F00_23555FF8.png" width="644" height="272" /></a></p>  <h4>B.&#160; XMLA is issued to Attach the existing database from the listing of folder detected</h4>  <table cellspacing="0" cellpadding="2" width="1336" border="1"><tbody>     <tr>       <td valign="top" width="1334">&lt;Attach xmlns=&quot;https://schemas.microsoft.com/analysisservices/2003/engine&quot;&gt;         <br /> &lt;Folder&gt;C:\Program Files\Microsoft SQL Server\MSAS11.TABULAR\OLAP\Data\TabularProject6_jason_9f18f33a-4391-4ed7-9c39-95b18307d082.0.db&lt;/Folder&gt;           <br />&lt;ReadWriteMode xmlns=&quot;https://schemas.microsoft.com/analysisservices/2008/engine/100&quot;&gt;ReadWrite&lt;/ReadWriteMode&gt;           <br />&lt;/Attach&gt; </td>     </tr>   </tbody></table>  <h4>C. Runs query to see the tabular data. </h4>  <p>SELECT TOP 1000 [Model].[$DimEmployee].[EmployeeKey], [Model].[$DimEmployee].[ParentEmployeeKey], [Model].[$DimEmployee].[EmployeeNationalIDAlternateKey], [Model].[$DimEmployee].[ParentEmployeeNationalIDAlternateKey], [Model].[$DimEmployee].[SalesTerritoryKey], [Model].[$DimEmployee].[FirstName], [Model].[$DimEmployee].[LastName], [Model].[$DimEmployee].[MiddleName], [Model].[$DimEmployee].[NameStyle], [Model].[$DimEmployee].[Title], [Model].[$DimEmployee].[HireDate], [Model].[$DimEmployee].[BirthDate], [Model].[$DimEmployee].[LoginID], [Model].[$DimEmployee].[EmailAddress], [Model].[$DimEmployee].[Phone], [Model].[$DimEmployee].[MaritalStatus], [Model].[$DimEmployee].[EmergencyContactName], [Model].[$DimEmployee].[EmergencyContactPhone], [Model].[$DimEmployee].[SalariedFlag], [Model].[$DimEmployee].[Gender], [Model].[$DimEmployee].[PayFrequency], [Model].[$DimEmployee].[BaseRate], [Model].[$DimEmployee].[VacationHours], [Model].[$DimEmployee].[SickLeaveHours], [Model].[$DimEmployee].[CurrentFlag], [Model].[$DimEmployee].[SalesPersonFlag], [Model].[$DimEmployee].[DepartmentName], [Model].[$DimEmployee].[StartDate], [Model].[$DimEmployee].[EndDate], [Model].[$DimEmployee].[Status], [Model].[$DimEmployee].[EmployeePhoto] FROM [Model].[$DimEmployee]</p>    <p>&#160;</p>  <h3>4. Contrast to the observations on the failing broken instance</h3>  <p>On the broken computer, when we get the error, I notice the same query is run, but instead of ATTACH XMLA statement, instead a XMLA ALTER/Create&#160; statement is used to generate a new database, and we see the error message.</p>  <p>The real cause is that when the list of browsable folders cannot see the default data folder, then this query runs without any error, but returns no results</p>  <p>Made a new MDX connection to the tabular Analysis Service instance and ran it: </p>  <p>&#160;<strong>SystemGetSubdirs 'C:\Program Files\Microsoft SQL Server\MSAS11.TABULAR\OLAP\Data'</strong> </p>  <p>&lt;no result!&gt;</p>  <p>&#160;</p>  <p>Therefore on the broken instance, Analysis Services perceives there is no data folder matching the tabular project name. It tries to use the databasename_username_GUID to create a fresh database to stage the tabular model. The .db folder already exists and was detached earlier, so this causes a name collision and the error. The error is not lying, but the confusing thing is that we don’t see it create/detach/attach sequence because its hidden behind the scenes in the magic implementation.</p>  <p><font color="#ff0000">The operation cannot be executed since the database with the name of &lt;name&gt;, ID of &lt;ID&gt; already exists in the detached state in folder '\\?\C:\MSAS11.InstanceName\OLAP\Data\Datababase_c7f3679b-1d5f-44e8-b6d0-25d2de10b7fc.0.db'. Either attach the database or delete the folder and retry the operation. </font></p>]]></content:encoded>
    </item>
    <item>
      <title>Cache Warming on an Analysis Services Tabular server</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/cache-warming-on-an-analysis-services-tabular-server</link>
      <pubDate>Mon, 22 Jul 2013 19:05:28 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2013/07/22/cache-warming-on-an-analysis-services-tabular-server/</guid>
      <description><![CDATA[SQL Server 2012 introduces the new tabular BISM modeling in Analysis Services.&#160; If you have...]]></description>
      <content:encoded><![CDATA[<p>SQL Server 2012 introduces the new tabular BISM modeling in Analysis Services.&#160; If you have many tabular databases deployed, or several large tabular databases, a server restart can cause a performance hit. The typical scenario is that when the Analysis Services service starts, it does not immediately load and warm the cache of the database files. The first user will have to wait for their database to load which can take 30 seconds up to a few minutes, depending on how many GB of files there are to load.&#160; </p>  <p>The database will get loaded on demand when the first connection is made to that database.&#160; The Vertipaq engine will read all the database files from the disk and use the RAM as a cache to populate the data structures in memory. </p>  <p>For example, when using Management Studio, when you connect to the tabular instance shortly after starting the service, it will query metadata from ALL databases. The SSMS window may become nonresponsive until the server replies with all the metadata requested.</p>  <p>One simple way to forcibly warm the cache ahead of time is to run a simple Discover command to query each database metadata.</p>  <p>&#160;</p>  <p>I have also filed a design change request to request the Analysis Services product group to please add a feature to autoload some or all databases. This could be triggered internally by the service whenever it starts to save user effort from creative workarounds. If you like the idea file it on <a href="https://connect.microsoft.com/sql">https://connect.microsoft.com/sql</a></p>  <h2>A simple workaround is to run a cache warming query:</h2>  <p>Make a new MDX query window in Management Studio and runthis kind of query to illustrate how a simple cache warmer would work. This isn’t practical, because by the time Management Studio has shown you the list of databases, it has already queries all the metadata and the data files are loaded in RAM.</p>  <blockquote>   <p><font face="Courier New">SELECT * FROM $System.DBSCHEMA_CATALOGS</font>&#160; </p> </blockquote>  <p>   <br />Make a new XMLA command window and run:</p>  <blockquote>   <p><font face="Courier New">&lt;Discover xmlns=&quot;urn:schemas-microsoft-com:xml-analysis&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;RequestType&gt;DBSCHEMA_CATALOGS&lt;/RequestType&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;Restrictions /&gt;        <br />&#160;&#160;&#160;&#160;&#160;&#160; &lt;Properties /&gt;        <br />&lt;/Discover&gt;</font></p> </blockquote>  <h2>Automation to open the databases:</h2>  <h3>1. ASCMD.exe</h3>  <p>To automate calling those we could use ASCMD.exe, which is an old sample back from 2005 days.&#160;&#160; <br /><a href="https://msdn.microsoft.com/en-us/library/ms365187(v=SQL.90).aspx">https://msdn.microsoft.com/en-us/library/ms365187(v=SQL.90).aspx</a></p>  <p>You could make a batch file that you run shortly after starting the service.</p>  <p>&#160;</p>  <h3>2. Schedule it</h3>  <p>Maybe a SQL Agent job is sufficient to run the code on a schedule every couple of minutes. However, it is harder to trigger it to start whenever the service restarts. I can use a <b>SQL Server Analysis Services Query</b> job step type.    <br /></p>  <p>The job interface requires a database name, which is not very useful for the discover query we need to run, so that’s annoying, but at least its automated.</p>  <p>   <br /><strong>Note: </strong>that the default SQL Agent Service Account may not have access to Analysis Services databases to run any query. If you use a domain account for your Agent service account, you may add the domain account into the AS security to run the query;&#160; but if the Agent service is started with the system account or the NT Service\SQLAgent$ account, you would need to create a credential and proxy and specify the “Run as” on the job step to run as another user, and give that credential/proxy account rights in Analysis Services.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8105.clip_image001_35856E97.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8105.clip_5F00_image001_5F00_35856E97.jpg"><img title="clip_image001" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0624.clip_image001_thumb_5BE9E293.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0624.clip_5F00_image001_5F00_thumb_5F00_5BE9E293.jpg" width="644" height="474" /></a></p>  <p>&#160;</p>  <h3>3. Windows Task Scheduler</h3>  <p>Similarly you could use Windows Task Scheduler to run a batch file or start a powershell script. </p>  <h4><font style="font-weight: bold">A. Note in the Windows Event Viewer events when your AS Tabular instance starts.</font></h4>  <p>There is an Event 0 (289) from the source MSOLAP$InstanceName when my service starts up- that may be a good trigger to launch the powershell script.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8078.image_1D841EE0.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8078.image_5F00_1D841EE0.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2543.image_thumb_0658A462.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2543.image_5F00_thumb_5F00_0658A462.png" width="915" height="134" /></a></p>  <blockquote>   <p>Log Name:&#160;&#160;&#160;&#160;&#160; Application     <br />Source:&#160;&#160;&#160;&#160;&#160;&#160;&#160; MSOLAP$TABULAR      <br />Date:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 7/22/2013 9:14:44 PM      <br />Event ID:&#160;&#160;&#160;&#160;&#160; 0      <br />Task Category: (289)      <br />Level:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Information      <br />Keywords:&#160;&#160;&#160;&#160;&#160; Classic      <br />User:&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; N/A      <br />Description:      <br />Service started. Microsoft SQL Server Analysis Services 64 Bit Developer (x64) CTP 11.0.3000.0.      <br /></p> </blockquote>  <h4>B. Make a powershell script in notepad&#160; to prime the Analysis Services tabular databases. </h4>  <p><strong></strong>Save the script with the .ps1 extension in a folder which is easily accessible. </p>  <p>Mine may not be perfect, but it is simply to load the sqlps, connect to my analysis services tabular instance, and run a query. Change the server name and instance name to match your computer.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8015.image_3D358959.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8015.image_5F00_3D358959.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5633.image_thumb_5F8D1ED2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5633.image_5F00_thumb_5F00_5F8D1ED2.png" width="644" height="133" /></a></p>  <blockquote>   <p><font face="Courier New">import-module sqlps       <br />cd SQLAS\MyServername\MyInstanceName        <br />Invoke-ASCmd -Query &quot;SELECT * FROM $System.DBSCHEMA_CATALOGS&quot;</font></p> </blockquote>  <p>Test your script in the powershell command first before proceeding.</p>  <blockquote>   <p><font face="Courier New">Powershell C:\Scripts\CacheWarmer.ps1</font></p> </blockquote>  <p>&#160;</p>  <h4>C. Now use Task Scheduler to watch for this event and trigger the cache warm up routine.</h4>  <p>Start &gt; Run &gt; MMC.exe. Add the Task Scheduler snapin. Connect to the local server.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6646.image_0CA20BA1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6646.image_5F00_0CA20BA1.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0804.image_thumb_58044016.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0804.image_5F00_thumb_5F00_58044016.png" width="644" height="274" /></a></p>  <h4>D. Click the menu option in the Actions pane to Create Task…</h4>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4213.image_52B55965.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4213.image_5F00_52B55965.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4075.image_thumb_54F1E221.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4075.image_5F00_thumb_5F00_54F1E221.png" width="644" height="195" /></a></p>  <p>Pick the triggering event at <strong>Application</strong>, your <strong>MSOLAP</strong>$InstanceName, <strong>Event ID 0</strong></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2352.image_6FBE082D.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2352.image_5F00_6FBE082D.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3022.image_thumb_6664D3AA.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3022.image_5F00_thumb_5F00_6664D3AA.png" width="644" height="215" /></a></p>  <p>Have it start a program - <strong>powershell </strong>and run your cachewarmer.ps1 script (as an argument – use double quotes around the path if it has spaces)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1222.image_3D5CC55F.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1222.image_5F00_3D5CC55F.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2620.image_thumb_11ABFB63.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2620.image_5F00_thumb_5F00_11ABFB63.png" width="644" height="255" /></a></p>  <h4>E. You can Finish the wizard, and view the properties. </h4>  <p>If you need to change the account which runs the routine, do so in the properties. The account will need rights within your Analysis Services to run the query. </p>  <h4>F. Test the Task, by stopping and starting (restart) your tabular instance service.</h4>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0675.image_6CAE3AE9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0675.image_5F00_6CAE3AE9.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1106.image_thumb_00C75773.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1106.image_5F00_thumb_5F00_00C75773.png" width="644" height="219" /></a></p>  <h4>G. Now check your task scheduler status and see if it ran.</h4>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6825.image_45768265.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6825.image_5F00_45768265.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3113.image_thumb_55191E27.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3113.image_5F00_thumb_5F00_55191E27.png" width="800" height="122" /></a></p>  <p>You can close the windows and check the history after you restart the services a few times to test it.</p>]]></content:encoded>
    </item>
    <item>
      <title>Script Component Recompile in SQL Server 2012 Integration Services (SSIS) to refresh metadata</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/script-component-recompile-in-sql-server-2012-integration-services-ssis-to-refresh-metadata</link>
      <pubDate>Tue, 05 Mar 2013 14:08:39 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2013/03/05/script-component-recompile-in-sql-server-2012-integration-services-ssis-to-refresh-metadata/</guid>
      <description><![CDATA[In SQL Server releases 2005-2008 R2 there is a programmatic approach to be able to dynamically...]]></description>
      <content:encoded><![CDATA[<p>In SQL Server releases 2005-2008 R2 there is a programmatic approach to be able to dynamically change dataflow columns and their data types in a dataflow task from the SSIS programmatic APIs, and have a Script Component still work magically (most of the time).</p>  <p>In Microsoft Customer Service and Support we saw this from time to time, at this was normally fine, but in the case where the metadata changes significantly, such as by changing a data type or changing the order or number of columns, the Script Component would start to misbehave since it may touch the wrong column or wrong data type and leave the data flow buffers in an unexpected&#160; state. </p>  <p><strong></strong></p>  <h3><font style="font-weight: bold">Pseudo code example of the problem</font></h3>  <p>Time 1: Original SSIS package design with a Dataflow task having 3 columns: ColA ColB ColC    <br />Script Component in that Dataflow: Col(ColA).value=1; Col(ColB).value=2, Col(ColC).value=3</p>  <p>Then later someone changes the SSIS package design programmatically to introduce new columns.    <br />Time 2: change inputs metadata to ColA, ColC, ColD</p>  <p>Then the Dataflow Script Component could incorrectly do things like use the ordinal position of columns and change the values incorrectly.    <br />Col(ColA).value=1; Col(ColC).value=2, Col(ColD).value=3</p>  <p>This, above could cause data corruption too since you might be writing wrong types. If you put extra numbers of columns, or less numbers of columns, there are some unintended side effects. </p>  <p>&#160;</p>  <h2><font style="font-weight: bold">So let’s prevent corruption and unexpected values by giving a true error in SSIS 2012</font></h2>  <p>Therefore, the red flag went off in my mind after seeing this a couple of times, and I requested the product team to investigate a way to be sure that SSIS Dataflow buffers match what the Script Component expected when it was designed with the VSTA code editor. The solution is to have a verification mechanism that remembers the original metadata and if the column metadata changes since the task, and raise an error <strong>MetadataCheckumMisMatch </strong>when the metadata is known to be changed/mismatched.</p> <font color="#ff0000">Error:&#160; &quot;The component metedata is out of sync with the compiled script. Recompile the script using the Script Component Editor.&quot;    <br /></font>  <p><font color="#ff0000">Error: &quot;Script Source&quot; failed validation and returned validation status &quot;VS_ISBROKEN&quot;.</font> </p>  <p><em>Note the error is misspelled in the product – yes I know.</em></p>  <p>&#160;</p>  <p>Therefore, in SQL 2012, if you programmatically edit the dataflow task design and change the input or output metadata which is hooked up to a Script Component (as a source, as a transformation, or as a destination) then you may see this error and you will wonder how to fix the problem.</p>  <p>&#160;</p>  <h2><font style="font-weight: bold">To recompile the Script Component programmatically in SSIS 2008 – R2 we have these posts to help us</font></h2>  <p>It was not well supported to do Script Component programmatically in SQL 2008, since you could not compile the script dynamically- the only supported way was is to open BIDS and click the Script Editor button. </p>  <p>There was a way to show the VSTA IDE and save the contents, which could be done programmatically. We blogged the workaround in SQL 2008 days</p>  <p>&#160;</p>  <ul>   <li><a href="https://dougbert.com/blog/post/Recompile-VSTA-scripts-programmatically-in-SSIS.aspx">https://dougbert.com/blog/post/Recompile-VSTA-scripts-programmatically-in-SSIS.aspx</a> </li>    <li><a href="https://dougbert.com/blog/post/adding-a-vsta-script-task-programmatically.aspx">https://dougbert.com/blog/post/adding-a-vsta-script-task-programmatically.aspx</a> </li> </ul>  <p>&#160;</p>  <p>The gist is showing the IDE window, and closing it again automatically saved and recompiled the script code into binary code that gets saves into the SSIS package tags.</p>  <blockquote>   <p>comp.ShowIDE();      <br />comp.CloseIDE();</p> </blockquote>  <p>&#160;</p>  <h2><strong>How to Recompile a Script Component programmatically in SSIS 2012</strong> </h2>  <p><strong></strong>    <br />In SQL Server 2012 SSIS the script design was reworked to use a newer approach using the VSTA 3.0 editor, so there are a few differences now in how to open the Script and effectively recompile it with the current metadata values. This code sample shows how to take an existing package (.dtsx in this approach) and loop over all tasks to find the dataflow tasks, and then find all the script components within, to then open and save the code fresh, so that the script code gets the current dataflow pipeline metadata (to avoid the metadata is out of sync error). The <font style="background-color: #ffff00">highlighted lines </font>are the meaty bits of this code. I don’t claim to be a developer, so please watch out for any bugs I may introduce with this code sample.</p>  <p>This sample is a C# for Visual Studio 2010 .Net 4.0</p>  <p><font size="2" face="Courier New">using System;     <br />using System.Collections.Generic;      <br />using System.Linq;      <br />using System.Text;      <br />using Microsoft.SqlServer.Dts.Design;      <br />using Microsoft.SqlServer.Dts.Runtime;      <br />using Microsoft.SqlServer.Dts.Pipeline.Wrapper;      <br />using Microsoft.SqlServer.Dts.Pipeline;      <br />using Microsoft.SqlServer.VSTAHosting;      <br />using Microsoft.SqlServer.IntegrationServices.VSTA;</font></p>  <p>   <br /><font size="2" face="Courier New">/* References     <br />*<strong> // General SSIS references</strong>      <br />* C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.Dts.Design\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.Dts.Design.dll      <br />* C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.SqlServer.DTSPipelineWrap.dll      <br />* C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.SQLServer.DTSRuntimeWrap.dll      <br />* C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.PipelineHost\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SQLServer.PipelineHost.dll      <br />* C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.ScriptTask\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.ScriptTask.dll      <br />* C:\Program Files (x86)\Microsoft SQL Server\110\SDK\Assemblies\Microsoft.SQLServer.ManagedDTS.dll</font></p>  <p><font size="2" face="Courier New"> * <strong>// Script related references</strong>      <br />* C:\Program Files (x86)\Microsoft SQL Server\110\DTS\PipelineComponents\Microsoft.SqlServer.TxScript.dll      <br />* or C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.TxScript\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.TxScript.dll      <br />* C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.VSTAScriptingLib\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.VSTAScriptingLib.dll      <br />* C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.IntegrationServices.VSTA\v4.0_11.0.0.0__89845dcd8080cc91\Microsoft.SqlServer.IntegrationServices.VSTA.dll      <br />*/</font></p>  <p>   <br /><font size="2" face="Courier New">namespace RunFromClientAppCS     <br />{      <br />&#160;&#160;&#160; class Program      <br />&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; static void Main(string[] args)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string pkgLocation;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Package pkg;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Application app;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DTSExecResult pkgResults;</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pkgLocation =     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; @&quot;c:\folder\Package.dtsx&quot;;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; app = new Application();      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pkg = app.LoadPackage(pkgLocation, null);</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; try     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TaskHost th = (TaskHost)pkg.Executables[&quot;Data Flow Task&quot;];</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Executables pExecs = pkg.Executables;</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach (Executable pExec in pExecs)     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; TaskHost taskHost = (TaskHost)pExec;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Executable name = &quot; + taskHost.Name);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Test if the task is a data flow      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (taskHost.InnerObject is Microsoft.SqlServer.Dts.Pipeline.Wrapper.MainPipe)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Cast the Executable as a data flow     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; MainPipe pipe = (MainPipe)taskHost.InnerObject;</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Loop over each object in the dataflow     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; foreach (IDTSComponentMetaData100 comp in pipe.ComponentMetaDataCollection)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Found Component Name = &quot; + comp.Name);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Find the Script Components      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (comp.Name==&quot;Script Component&quot;)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //Recompile the the Script Compoentn      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; CManagedComponentWrapper compWrap = comp.Instantiate();      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ScriptComponentHost scriptComp = (compWrap as IDTSManagedComponent100).InnerObject as ScriptComponentHost;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!<font style="background-color: #ffff00">scriptComp.LoadScriptFromComponent())</font>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(&quot;Failed to load script information from the component&quot;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (scriptComp.CurrentScriptingEngine.VstaHelper == null)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(&quot;Vsta 3.0 is not installed properly&quot;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!<font style="background-color: #ffff00">scriptComp.CurrentScriptingEngine.LoadProjectFromStorage())</font>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(&quot;Failed to load project files from storage object&quot;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!<font style="background-color: #ffff00">scriptComp.SaveScriptProject())</font>      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; throw new Exception(&quot;Failed to save project&quot;);      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Recompiled Success: &quot; + comp.Name);</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; scriptComp.CurrentScriptingEngine.DisposeVstaHelper();     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;&#160; Component Name = &quot; + comp.Name);     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; catch (Exception e)      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(e.Message.ToString());</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Run the Package to make sure it works.     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pkgResults = pkg.Execute();      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.WriteLine(&quot;Package Execution Result = &quot; + pkgResults.ToString());      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Console.ReadKey();      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</font></p>  <p><font size="2" face="Courier New">&#160;&#160;&#160; }     <br />}</font>    <br /></p>  <p>&#160;</p>  <h2>Note: a security Gotcha for the %temp% folder</h2>  <p>There is a gotcha which isn’t immediately apparent.</p>  <p>If you try to run this C# code from within a service when the Windows user profile is not loaded, it may fail. The code uses the temp folder for the users profile. Therefore, if you run this code from an SSIS parent package to recompile scripts in a child package, let’s say from a SQL Agent job or from stored procedures, then it may very well fail.&#160; The call SaveScriptProject() doesn’t throw an error, it just doesn’t recompile the code.</p>  <p>You can add the proxy account, or the service account to have permissions to the TEMP folder which is failing. </p>  <p>There are generally two environment variables %TEMP% and %TMP%, and two sets – one for the user, and one for the system. If a users profile is not loaded, as is the case when an SSIS job runs as a proxy account user, then the system TEMP may be used.</p>  <p>When the service account for SQL Server launches something, the child process may perceive some system default TEMP folder. If a full user profile is loaded, it would presumably pick the user’s own TEMP folder under C:\Users\&lt;AccountName&gt;\Appdata\Local\Temp.&#160;&#160;&#160; In theory, you could also change the TEMP pointer to point to a different folder if your system admin pushes back. That is the System variables in this case, but that is indeed global and affects all services on the box.</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2068.clip_image002_50CA94C3.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2068.clip_5F00_image002_5F00_50CA94C3.jpg"><img title="clip_image002" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5618.clip_image002_thumb_2037170B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5618.clip_5F00_image002_5F00_thumb_5F00_2037170B.jpg" width="593" height="540" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>How do I ensure Analysis Services client TCP connectivity is encrypted?</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/how-do-i-ensure-analysis-services-client-tcp-connectivity-is-encrypted</link>
      <pubDate>Tue, 26 Feb 2013 15:26:52 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2013/02/26/how-do-i-ensure-analysis-services-client-tcp-connectivity-is-encrypted/</guid>
      <description><![CDATA[SQL Server Analysis Services often deals with sensitive financial numbers, sales figures,&#160; and...]]></description>
      <content:encoded><![CDATA[<p>SQL Server Analysis Services often deals with sensitive financial numbers, sales figures,&#160; and strategic information used by businesses. Therefore it is natural to want to protect and encrypt data when is it queries to and fro from the Analysis Services over the TCP layers in Windows.</p>  <p>I’m am going to talk about network traffic encryption (incoming queries, results sent to clients like Management Studio and Excel, and writeback values sent from client to Analysis Services) and&#160; not storage encryption (ie. database files and hard drive) here. I’m ignoring storage encryption in this blog post since it is another beast, and unless you have physical access to the hard drive or backup tapes, it doesn’t matter as much in todays secure data centers. .</p>  <p>&#160;</p>  <h2>Option 1: Tell Windows to Encrypt everything in the TCP traffic on your internal network</h2>  <p>You could require Windows to&#160; encrypt all network traffic on computers using windows features called IPSec and AuthIP. That’s outside my scope here, since that is complex to set up, and is usually a company wide effort as part of a security strategy, but its worth mentioning, since it means you encrypt traffic at a lower level and can secure systems more holistically.</p>  <p>External references:</p>  <li>Step-by-Step Guide to Internet Protocol Security (IPSec) <a title="https://technet.microsoft.com/en-us/library/bb742429.aspx" href="https://technet.microsoft.com/en-us/library/bb742429.aspx">https://technet.microsoft.com/en-us/library/bb742429.aspx</a> </li>  <li>IPsec Configuration (Windows) <a title="https://msdn.microsoft.com/en-us/library/windows/desktop/bb736264(v=vs.85).aspx" href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb736264(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/bb736264(v=vs.85).aspx</a>     <p>&#160;</p>    <h2>Option 2: Encrypt in the Analysis Services TCP conversations</h2>    <p>Or you could do encryption on a per-service basis.</p>    <p>Many DBAs are familiar with SQL Server Database Engine where you can tell the client provider like SQL Native Client (SQLNCLI) to force protocol encryption, and provide a signed certificate to use, either self-signed or by using a trustworthy&#160; certificate authority. Details here <a title="https://support.microsoft.com/kb/318605" href="https://support.microsoft.com/kb/318605">https://support.microsoft.com/kb/318605</a>&#160;</p>    <p>The SQL Engine options are <strong>Force Protocol Encryption / ForceEncryption</strong>&#160; on the server, and connection string options Use <strong>Encryption for Data=True</strong> in OLEDB, <strong>Encrypt=YES</strong> in ODBC provider and SQL Native Client. Those methods use crypto APIs and either self-signed or 3rd party signed certificates (bring your own cert)&#160; to encrypt the TCP traffic. </p>    <p>Things are not the same for Analysis Services. Analysis Services and <strong>MSOLAP</strong> OLE DB provider used to connect to SQL Server Analysis Services&#160; does not have feature parity with SQL Native Client (used for SQL Engine connections) where it can do server encryption or client encryption in this fashion with a couple of connection string switches and registry keys to turn on ForceEncryption on the server side to tell it which certificate to use. </p>    <p>Analysis Services’ implements&#160; may be better or worse depending on your view point, but I’ll just say its different.</p>    <p>&#160;</p>    <h3><font style="font-weight: bold">A. The client can override via connection string options to encrypt or not to encrypt, but its not common to do so.</font></h3>    <p>Let’s go to Mosha’s blog here, which explains that Analysis Services traffic (XMLA over TCP) is <strong>by default</strong> compressed and encrypted.</p>    <p><a title="https://sqlblog.com/blogs/mosha/archive/2005/12/02/analysis-services-2005-protocol-xmla-over-tcp-ip.aspx" href="https://sqlblog.com/blogs/mosha/archive/2005/12/02/analysis-services-2005-protocol-xmla-over-tcp-ip.aspx">https://sqlblog.com/blogs/mosha/archive/2005/12/02/analysis-services-2005-protocol-xmla-over-tcp-ip.aspx</a></p>    <p>As he explains these options can be turned on, or turned&#160; off if you want to sniff network traffic with Netmon or Wireshark and read the query and the results. So if your goal is to make data less secure for monitoring purposes, you could use these extra text connection string options, and you could see the plain text traffic (via network tracing) and decode which query is coming from the client.</p>    <p><em>Most secure client connection string options:</em> <strong>Protection Level=<font color="#4bacc6">pkt privacy</font></strong>;<strong>Transport Compression=<font color="#4bacc6">Compressed</font></strong>;</p>    <p><em>Least secure (for monitoring traffic with a sniffer): </em><strong>Protection Level=<font color="#ff0000">none</font></strong>;<strong>Transport Compression=<font color="#ff0000">none</font>;</strong>Protocol Format=<font color="#ff0000">XML</font>;</p>    <p>To get this sniffing technique to work, I also had to allow anonymous logon (very dangerous). IN the msmdsrv.ini file I disabled authentication: &lt;RequireClientAuthentication&gt;0&lt;/RequireClientAuthentication&gt;</p>    <p>Since I need to run a query without authentication as anonyous, I added a role and put anonymous into the role, and allow read permissions in the sample Adventureworks database. XMLA:</p>    <blockquote>     <p>&lt;Batch xmlns='https://schemas.microsoft.com/analysisservices/2003/engine' Transaction='true'&gt; &lt;Alter AllowCreate=&quot;true&quot; ObjectExpansion=&quot;ObjectProperties&quot; xmlns=&quot;https://schemas.microsoft.com/analysisservices/2003/engine&quot;&gt; &lt;Object&gt; &lt;DatabaseID&gt;<strong>AdventureWorksDW2012Multidimensional-EE</strong>&lt;/DatabaseID&gt; &lt;RoleID&gt;Role&lt;/RoleID&gt; &lt;/Object&gt; &lt;ObjectDefinition&gt; &lt;Role xmlns:xsd=&quot;https://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;https://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ddl2=&quot;https://schemas.microsoft.com/analysisservices/2003/engine/2&quot; xmlns:ddl2_2=&quot;https://schemas.microsoft.com/analysisservices/2003/engine/2/2&quot; xmlns:ddl100_100=&quot;https://schemas.microsoft.com/analysisservices/2008/engine/100/100&quot; xmlns:ddl200=&quot;https://schemas.microsoft.com/analysisservices/2010/engine/200&quot; xmlns:ddl200_200=&quot;https://schemas.microsoft.com/analysisservices/2010/engine/200/200&quot; xmlns:ddl300=&quot;https://schemas.microsoft.com/analysisservices/2011/engine/300&quot; xmlns:ddl300_300=&quot;https://schemas.microsoft.com/analysisservices/2011/engine/300/300&quot; xmlns:ddl400=&quot;https://schemas.microsoft.com/analysisservices/2012/engine/400&quot; xmlns:ddl400_400=&quot;https://schemas.microsoft.com/analysisservices/2012/engine/400/400&quot;&gt; &lt;ID&gt;Role&lt;/ID&gt; &lt;Name&gt;Role&lt;/Name&gt; &lt;Members&gt; &lt;Member&gt; &lt;Name&gt;<strong>NT AUTHORITY\ANONYMOUS LOGON</strong>&lt;/Name&gt; &lt;/Member&gt; &lt;/Members&gt; &lt;/Role&gt; &lt;/ObjectDefinition&gt; &lt;/Alter&gt; &lt;Alter AllowCreate=&quot;true&quot; ObjectExpansion=&quot;ObjectProperties&quot; xmlns=&quot;https://schemas.microsoft.com/analysisservices/2003/engine&quot;&gt; &lt;Object&gt; &lt;DatabaseID&gt;<strong>AdventureWorksDW2012Multidimensional-EE</strong>&lt;/DatabaseID&gt; &lt;DatabasePermissionID&gt;DatabasePermission&lt;/DatabasePermissionID&gt; &lt;/Object&gt; &lt;ObjectDefinition&gt; &lt;DatabasePermission xmlns:xsd=&quot;https://www.w3.org/2001/XMLSchema&quot; xmlns:xsi=&quot;https://www.w3.org/2001/XMLSchema-instance&quot; xmlns:ddl2=&quot;https://schemas.microsoft.com/analysisservices/2003/engine/2&quot; xmlns:ddl2_2=&quot;https://schemas.microsoft.com/analysisservices/2003/engine/2/2&quot; xmlns:ddl100_100=&quot;https://schemas.microsoft.com/analysisservices/2008/engine/100/100&quot; xmlns:ddl200=&quot;https://schemas.microsoft.com/analysisservices/2010/engine/200&quot; xmlns:ddl200_200=&quot;https://schemas.microsoft.com/analysisservices/2010/engine/200/200&quot; xmlns:ddl300=&quot;https://schemas.microsoft.com/analysisservices/2011/engine/300&quot; xmlns:ddl300_300=&quot;https://schemas.microsoft.com/analysisservices/2011/engine/300/300&quot; xmlns:ddl400=&quot;https://schemas.microsoft.com/analysisservices/2012/engine/400&quot; xmlns:ddl400_400=&quot;https://schemas.microsoft.com/analysisservices/2012/engine/400/400&quot;&gt; &lt;ID&gt;DatabasePermission&lt;/ID&gt; &lt;Name&gt;DatabasePermission&lt;/Name&gt; &lt;RoleID&gt;Role&lt;/RoleID&gt; &lt;Process&gt;true&lt;/Process&gt; &lt;ReadDefinition&gt;Allowed&lt;/ReadDefinition&gt; &lt;Read&gt;Allowed&lt;/Read&gt; &lt;Administer&gt;true&lt;/Administer&gt; &lt;/DatabasePermission&gt; &lt;/ObjectDefinition&gt; &lt;/Alter&gt; &lt;/Batch&gt;</p>   </blockquote>    <p>&#160;</p> </li>  <li>   <p>For the brave of heart and curious, you can even use management studio to test this, or Excel. For Excel you could edit the .odc file and add the connection string switches.</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7485.image_7337CB78.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7485.image_5F00_7337CB78.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6825.image_thumb_4E3A0AFF.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6825.image_5F00_thumb_5F00_4E3A0AFF.png" width="428" height="264" /></a></p>    <p>&#160;</p>    <p>That works for me. Let’s try the opposite approach:</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0243.image_44E0D67C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0243.image_5F00_44E0D67C.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3782.image_thumb_06E745BE.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3782.image_5F00_thumb_5F00_06E745BE.png" width="428" height="272" /></a></p>    <p>You’ll be blocked by default though, as you’ll see why in Part B below.</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7433.image_7D8E113A.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7433.image_5F00_7D8E113A.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7411.image_thumb_3F94807C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7411.image_5F00_thumb_5F00_3F94807C.png" width="623" height="220" /></a></p>    <p>&#160;</p>    <h3><font style="font-weight: bold">B. The Analysis Server won’t let unencrypted client traffic in by default.</font></h3>    <p>But the client can only choose to not encrypt if the Analysis Server lets it choose. By default the clients have little choice. You would have to adjust the Analysis Services server to remove the defaults and allow such&#160; unencrypted conversations or not via the msmdsrv.ini file settings. </p>    <p>&#160;</p>    <p>By default, it does require all client connections to be&#160; encrypted for both administration and data, so there is really no need to touch these settings. The only reason to turn these options would be for some kind of traffic monitoring exercise&#160; or troubleshooting.</p>    <p><a href="https://msdn.microsoft.com/en-us/library/ms175415.aspx">https://msdn.microsoft.com/en-us/library/ms175415.aspx</a> </p> </li>  <li><b>Security \ AdministrativeDataProtection \ RequiredProtectionLevel</b>     <p>The default setting of 1 requires that all administrative data be encrypted. A setting of 0 allows for clear text, and a setting of 2 allows for clear text with signatures (which is weaker than encryption). </p> </li>  <li><b>Security \ DataProtection \ RequiredProtectionLevel</b>     <p>The default setting of 1 requires that all data be encrypted. A setting of 0 allows for clear text, and a setting of 2 allows for clear text with signatures (which is weaker than encryption).</p> </li>  <li>   <p><strong>Network \ Requests \ EnableCompression</strong></p>    <p><strong>EnableCompression</strong> is a Boolean server property that dictates whether data by default is compressed when it goes across the wire. This property appears twice in the General page of the Analysis Server Properties page. It appears once under Network \ Requests and once under Network \ Responses. The default value for requests is <strong>False</strong> because requests are relatively short. The default value for responses is <strong>True</strong> because responses are generally large amounts of data. To control whether requests and responses are streamed in binary format, see the <strong>EnableBinaryXML</strong> server property. You can also override this server behavior by specifying <strong>Transport Compression</strong> connection string property.</p>    <p>&#160;</p>    <h3><font style="font-weight: bold">C. So by default the Analysis Services TCP traffic is encrypted by default but how is it done?</font></h3>    <p>The good news as shared above is that is it always encrypted unless you loosen the restrictions via the server settings.</p>    <p>This begs the question, well how does AS do the encryption?&#160; So let’s assume you haven’t changed the connection string from the client, and the server defaults are in place… then how does it work?</p>    <p>The short story is that AS doesn’t do much of the work, but rather relies on <strong>Windows SSPI (Security Support Provider Interface) </strong>to do the heavy lifting of encryption on its behalf. This means depending on the SSPI authentication method chosen, NTLM or Kerberos protocols does the encrypting of the login packets and data&#160; buffers exchanged over TCP.</p>    <p>I did some monitoring of my system, and I see these core Windows SSPI dll’s do the work. </p>    <p>1. When I used <strong>SSPI=NTLM;</strong> in the MSOLAP connection&#160; string, it goes one route for the encryption…</p>    <p><font color="#ff0000">msmdsrv.exe --&gt; SSPICLI.dll --&gt; msv1_0.dll</font></p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1638.image_7D246EF6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1638.image_5F00_7D246EF6.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3716.image_thumb_635038C7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3716.image_5F00_thumb_5F00_635038C7.png" width="431" height="231" /></a></p>    <p>     <br />2. When I used <strong>SSPI=Kerberos;</strong> in the MSOLAP connection string, it goes an entirely different route for the encryption through many more layers of dlls.&#160; I confirm I get &quot;Microsoft Kerberos V1.0&quot; and I get KERB_ETYPE_AES256_CTS_HMAC_SHA1_96 on my Windows 8 testing, and I saw it load the cipher through some debugging magic (sorry I can’t share the internals).</p>    <p><font color="#ff0000">Msmdsrv.exe --&gt; SSPICLI.dll --&gt; kerberos.dll --&gt; Crypdll.dll ---&gt; bcrypt.dll --&gt; bcryptPrimitives.dll</font></p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5367.image_20E02742.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5367.image_5F00_20E02742.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3125.image_thumb_49EAC63E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3125.image_5F00_thumb_5F00_49EAC63E.png" width="427" height="229" /></a></p>    <p>So I could pick NTLM vs. Kerberos from the client connection string, to influence how the encryption is done. However, that doesn’t guarantee everyone in the company will remember to do that on a manual basis.</p>    <p>Is there any systematic approach to force one way or the other way for consistency and security? Stay tuned in part D.</p>    <p>&#160;</p>    <h3><font style="font-weight: bold">D. Can I chose how the Analysis Services does the encryption?</font></h3>    <p>In the most secure environments, you may want to be sure you use a top encryption cipher to be sure you know the traffic is encrypted safely to comply with your corporate standards, or government mandates (acronyms like FIPS, Sarbanes Oxley, and HIPPA come to mind)</p>    <p>&#160;</p>    <h3><font style="font-weight: bold">1. Pick Kerberos or NTLM or both</font></h3>    <p>If needed, you can restrict Analysis Services to use Kerberos authentication only, thus disabling NTLM (which encrypts differently), or visa versa.</p>    <p>To do so, edit the msmdsrv.ini file and replace the self closing tag <strong>&lt;SecurityPackageList/&gt;</strong> (which represented both NTLM or Kerberos are allowed)&#160; with this tag<font color="#ff0000"> <strong>&lt;SecurityPackageList&gt;Kerberos&lt;/SecurityPackageList&gt; </strong><font color="#000000">or </font><font color="#ff0000"><strong>&lt;SecurityPackageList&gt;NTLM&lt;/SecurityPackageList&gt;</strong></font></font></p>    <p>Restart Analysis Services after the change to be sure the change is picked up and any open connections are cleared to enforce the new requirement.</p>    <p>In case you don’t know, the msmdsrv.ini file is a text file that lives in the default locations such as these, where the version and InstanceName may vary.</p> </li>  <li>&quot;C:\Program Files\Microsoft SQL Server\MSAS10.InstanceName\OLAP\Config\msmdsrv.ini&quot; </li>  <li>&quot;C:\Program Files\Microsoft SQL Server\MSAS10_50.InstanceName\OLAP\Config\msmdsrv.ini&quot; </li>  <li>&quot;C:\Program Files\Microsoft SQL Server\MSAS11.InstanceName\OLAP\Config\msmdsrv.ini&quot;    <p>&#160;</p>    <h3><font style="font-weight: bold">2. An aside: Don’t forget the SPNs for Kerberos</font></h3>    <p>If you decide to opt for <strong>Kerberos</strong> only, in order for double hop to work, you need to be sure to create the <strong>MSOlapSvc.3</strong> SPN in the Active Directory on the domain service account (or the computer object depending on the service account) using the <strong>SetSPN.exe</strong> tool, so that Kerberos will work, and double hop will work as needed. Full instructions here&#160; <a href="https://support.microsoft.com/kb/917409">https://support.microsoft.com/kb/917409</a></p>    <p>NTLM cannot do double hop, so it is a more limited way to do authentication, and the SPN is not needed for NTLM to work.</p>    <p>&#160;</p>    <h3><font style="font-weight: bold">3. If needed, force a Cipher and Strength for NTLM or Kerberos</font></h3>    <h3><font size="3">Caveat 1: I don’t have many versions of windows to test with. I think this options work easily in newer versions of Windows such as Win 7, Win 2008 R2, Win 8 only.</font></h3>    <p><font size="3">Caveat 2:&#160; </font><font color="#ff0000">Also, if you set these things at a group policy, you can impact (and potentially break) a whole bunch of computers, so proceed with caution and test test test in a lab environment first!!!!</font></p>    <p><font color="#ff0000"></font></p>    <p>There are both <strong>group</strong> <strong>security policy </strong>and<strong> local security policy </strong>settings for both NTLM and Kerberos to restrict which cipher and cipher strength is used for the encryption used by NTLM and Kerberos.</p>    <p>Check it out in your Administrative tools from the&#160; start menu.</p>    <p>Start &gt; Run &gt; <strong>gpedit.msc</strong>&#160;&#160; (or use WIn key + R)</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0083.image_79A86EBD.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0083.image_5F00_79A86EBD.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1072.image_thumb_4DF7A4C1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1072.image_5F00_thumb_5F00_4DF7A4C1.png" width="225" height="153" /></a></p>    <p>Local Computer Policy</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt; Computer Configuration</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt; Windows Settings</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt; Security Settings</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt; Local Policies</p>    <p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &gt; Security Options</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0488.image_28F9E448.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0488.image_5F00_28F9E448.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1050.image_thumb_3FBBBC82.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1050.image_5F00_thumb_5F00_3FBBBC82.png" width="644" height="261" /></a></p>    <p>The three relevant settings are highlighted above, and color coded for illustration:</p> </li>  <li><font color="#ff0000">Network security: Configure encryption types allowed for Kerberos</font> </li>  <li><font color="#4bacc6">Network security: Minimum session security for NTLM SSP based (including secure RPC) clients</font> </li>  <li><font color="#4bacc6">Network security: Minimum session security for NTLM SSP based (including secure RPC) servers</font>     <p>So to pick the cipher, you can do so on each individual computer via the <strong>Local Security Policy</strong> snap in shown above, or you can deploy the encryption encryption restrictions to many computers using a <strong>Group Security Policy </strong>across an organization unit of multiple computers in the company<strong>. </strong>As I said before, be careful with group policies, since you may break something. </p>    <p>To roll out any group policy with these Kerberos or NTLM restrictions, you could put the computers which need to be encrypted into the Organizational Unit (OU) with this policy defined to ensure the policy will take effect on those clients. Be aware that restricting the cipher may affect other applications outside of Excel and Analysis Services which also rely upon Kerberos authentication, so be sure to test line of business applications thoroughly with this configuration.</p>    <p>In the above settings, the detailed property dialogue lists each cipher is listed with a checkbox, to enable each cipher individually according to your security requirements. Such as AES256_HMAC_SHA1 as shown here for Kerberos: <font color="#ff0000">Network security: Configure encryption types allowed for Kerberos</font></p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2158.image_561161C7.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2158.image_5F00_561161C7.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6355.image_thumb_0A458B0E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6355.image_5F00_thumb_5F00_0A458B0E.png" width="432" height="259" /></a></p>    <p>And for NTLM a much shorter list of ciphers:</p> </li>  <li><font color="#4bacc6">Network security: Minimum session security for NTLM SSP based (including secure RPC) clients</font> </li>  <li><font color="#4bacc6">Network security: Minimum session security for NTLM SSP based (including secure RPC) servers</font> <!--EndFragment-->    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5270.image_47D57988.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5270.image_5F00_47D57988.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5466.image_thumb_6718205B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5466.image_5F00_thumb_5F00_6718205B.png" width="431" height="267" /></a></p>    <p>&#160;</p>    <p>Note: Different versions of Windows and functional&#160; different levels of domain controllers will offer different options, so I can’t exhaustively tell if you this will work on your environment or not. Some options are new to Win 7 and 2008 R2 releases too. </p>    <p>NTLM <a title="https://technet.microsoft.com/en-us/library/dd566199(v=ws.10).aspx" href="https://technet.microsoft.com/en-us/library/dd566199(v=ws.10).aspx">https://technet.microsoft.com/en-us/library/dd566199(v=ws.10).aspx</a></p>    <p>Kerberos: <a title="https://technet.microsoft.com/en-us/library/dd560670(v=WS.10).aspx" href="https://technet.microsoft.com/en-us/library/dd560670(v=WS.10).aspx">https://technet.microsoft.com/en-us/library/dd560670(v=WS.10).aspx</a></p>    <p>A good reference about the newer options: <a title="https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx" href="https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx">https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx</a></p>    <p>&#160;</p>    <h3><font style="font-weight: bold" color="#ff0000">Another Caveat:</font></h3>    <p>Because I am not intimately familiar with all the internals of how NTLM and Kerberos works, the Explain tab is helpful to clarify, so I’ll paste&#160; references to read more.&#160; I don’t have the answers to exactly how these settings work, or which versions of windows can do each kind of encryption, so I’ll leave it to you to test and research the specifics. </p>    <ul>     <li>Network security: Configure encryption types allowed for <font color="#ff0000"><strong>Kerberos</strong></font> <a title="https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx" href="https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx">https://blogs.msdn.com/b/openspecification/archive/2011/05/31/windows-configurations-for-kerberos-supported-encryption-type.aspx</a> </li>      <li>Network security: Minimum session security for NTLM SSP based (including secure RPC) <font color="#4bacc6"><strong>clients</strong></font>&#160; <a title="https://technet.microsoft.com/en-us/library/cc736506(v=ws.10).aspx" href="https://technet.microsoft.com/en-us/library/cc736506(v=ws.10).aspx">https://technet.microsoft.com/en-us/library/cc736506(v=ws.10).aspx</a> </li>      <li>Network security: Minimum session security for NTLM SSP based (including secure RPC) <font color="#4bacc6"><strong>servers</strong></font> <a title="https://technet.microsoft.com/en-us/library/cc776157(v=WS.10).aspx" href="https://technet.microsoft.com/en-us/library/cc776157(v=WS.10).aspx">https://technet.microsoft.com/en-us/library/cc776157(v=WS.10).aspx</a>         <br /></li>   </ul>    <p>&#160;</p>    <h2>Option 3: Use HTTPS with the msmdpump.dll Data Pump to use a custom certificate</h2>    <p>You can have clients like Excel, Management Studio, Report Servers, and custom apps which use MSOLAP provider to connect to an HTTP or HTTPS&#160; address to talk to Analysis Services and run queries. </p>    <p>They could remotely access Analysis Services across the WAN/internet (scary for security purposes) or just on your local intranet behind a safe firewall.</p>    <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7851.image_2BC74B4E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7851.image_5F00_2BC74B4E.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8424.image_thumb_78F744D9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8424.image_5F00_thumb_5F00_78F744D9.png" width="433" height="254" /></a></p>    <p>&#160;</p>    <p>This kind of set up is&#160; done with an ISAPI extension called the data pump. The msmdpump.dll is a DLL which ships in the Program Files folders and can be put into IIS to do the HTTP(S) connectivity work, and converting the traffic to TCP connectivity to Analysis Services. This means you can use HTTP traffic over port 80 or a port of your choosing, and leave the Analysis Services ports like 2383 (default instance) port 2382 (SQL Browser for AS) or dynamic ports (used in AS named instances) closed in the firewalls. If you secure the conversation (as I suggest you do) as HTTPS, the default port becomes TCP 443, which is usually already open on most firewalls.</p>    <p>When configured, the msmdpump acts as a middle man living in your IIS server, to forward the HTTP(S) queries (port 80 or port 443 traffic) and result sets to a fro the Analysis Services (port 2383 or dynamic port traffic). The data pump uses the same MSOLAP OLEDB provider (the copy installed locally on the IIS machine)&#160; to talk to the Analysis Services on your behalf. It has a msmdpump.ini configuration file to point to the right instance of Analysis Services (hostname for default, or hostname\instance name). You can have IIS on a dedicated server or on the same machine as Analysis Services depending on your hardware and virtualization VM options. Authentication of the client application can be done to impersonate the caller (an IIS setting to allow Digest or Basic security) or to allow anonymous (anyone) to have access. Impersonation is nice, since the calling application can connect using its Windows credentials and see the security as if it was connected directly to the Analysis Services. </p>    <p>To securely encrypt&#160; the HTTP conversations, just add the S – HTTPS. That means you’ll need a certificate that IIS can use to secure the URL and encrypt the traffic. Its best to use a certificate authority (there are several 3rd party&#160; like VeriSign, or even build your own Microsoft certificate authority)&#160; to get the certificate, so it can be independently verified each time a new request comes in to be sure it is a secure connection. The complexity is to enable the IIS configuration for SSL enabled, with the optional Trusted Certificate on client side, and setting&#160; &quot;Require Client Certificate&quot; on IIS. </p>    <p>The details of a variety of IIS versions and SSL options&#160; are complex, but here are some references. </p> </li>  <li>Instructions on Win 2003&#160;&#160; <a title="https://technet.microsoft.com/en-us/library/cc917711.aspx" href="https://technet.microsoft.com/en-us/library/cc917711.aspx">https://technet.microsoft.com/en-us/library/cc917711.aspx</a> </li>  <li>Instructions on Win XP <a title="https://technet.microsoft.com/en-US/library/cc917712.aspx" href="https://technet.microsoft.com/en-US/library/cc917712.aspx">https://technet.microsoft.com/en-US/library/cc917712.aspx</a> </li>  <li>Instructions on IIS 7 <a title="https://msdn.microsoft.com/en-us/library/gg492140.aspx" href="https://msdn.microsoft.com/en-us/library/gg492140.aspx">https://msdn.microsoft.com/en-us/library/gg492140.aspx</a> </li>  <li><a title="Steps of Configuring Analysis Service Data Pump on IIS 7.docx" href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/06/44/76/Steps%20of%20Configuring%20Analysis%20Service%20Data%20Pump%20on%20IIS%207.docx" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-06-44-76/Steps-of-Configuring-Analysis-Service-Data-Pump-on-IIS-7.docx">Steps of Configuring Analysis Service Data Pump on IIS 7.docx</a>     <p>I see there are numerous forum postings discussing failure with HTTPS and Excel, so it is a bit temperamental, so plan some time to test and be sure to try the various different client applications if you opt for msmdpump over HTTPS.</p>     </li>]]></content:encoded>
    </item>
    <item>
      <title>Analysis Services Synchronization fails with permissions error</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/analysis-services-synchronization-fails-with-permissions-error</link>
      <pubDate>Wed, 05 Dec 2012 19:10:52 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2012/12/05/analysis-services-synchronization-fails-with-permissions-error/</guid>
      <description><![CDATA[When you want to run Synchronization to copy an Analysis Services database from one server to...]]></description>
      <content:encoded><![CDATA[<p>When you want to run Synchronization to copy an Analysis Services database from one server to another, the account running the synchronization needs to be a server admin in the Analysis Services instance receiving the database.</p>  <p>&#160;</p>  <p><strong>For example, when running a job to do synchronization from a SQL Agent job, you may see the following error:</strong></p>  <p>Executed as user: domain\SQLAgent. </p>  <p>Microsoft.AnalysisServices.Xmla.XmlaException: Either the ‘domain\SQLAgent’&#160; user does not have permission to restore the 'MyDB' database, or the database already exists. Backup and restore errors: An error occurred while synchronizing the ‘MyDb’ database. </p>  <p>   <br />at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForSoapFault&lt;XmlReader reader, XmlaResult xmlaResult, Boolean throwError) at Microsoft.AnalysisServices.Xmla.XmlaClient.CheckForErrormlReader reader. XmlaResult xmlaResult, Boolean throwliError) </p>  <p>at Microsoft.AnalysisServices.Xmla.XmlaClient. SendMessage(Boolean endReceivalliException.Boolean readSession, Boolean readNamespaceCompatibility) </p>  <p>at Microsoft.AnalysisServices.Xmla.XmlaClient.SendMessageAndReturnResult(String&amp; result. Boolean skipResult) </p>  <p>at Microsoft.AnalysisServices.Xmla.XmlaClient.Execute(String command. String properties. String&amp; result. Boolean skipResult. Boolean propertiesXmllsComplete) </p>  <p>at Microsoft.SqlServer.Management.Smo.Olap.SoapClient.ExecuteStatement(String stmt, StatementType stmtType. Boolean withResults, String properties. String parameters. Boolean restrictionListElement, String discoverType. String catalog) </p>  <p>at Microsolt.SqlServer.Management.Smo.Olap.SoapClient.SendCommand(String command, Boolean withResults,String properties) </p>  <p>at OlapEvent(SCH_STEPX pStep. SUBSYSTEMX pSubSystem. SUBSYSTEMPARAMSX pSubSystemParams. Boolean IQueryFlag). The step tailed.</p>  <p>&#160;</p>  <p><strong>To add the permissions:</strong></p>  <p>1. Open the Management Studio window, and connect to your instance of Analysis Services.</p>  <p>2. Right click the server name and view the Properties</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7446.image_2966AE19.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7446.image_5F00_2966AE19.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5315.image_thumb_389D16E6.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5315.image_5F00_thumb_5F00_389D16E6.png" width="297" height="484" /></a></p>  <p>3. View the security page, and note if there are any users already present </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0272.image_63E43E9E.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0272.image_5F00_63E43E9E.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4061.image_thumb_6238942C.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4061.image_5F00_thumb_5F00_6238942C.png" width="644" height="277" /></a></p>  <p>&#160;</p>  <p>4. Click the Add button and enter the name of the account which needs to run the synchronization, such as domain\account</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7510.image_65DBD06B.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7510.image_5F00_65DBD06B.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0753.image_thumb_455490B9.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0753.image_5F00_thumb_5F00_455490B9.png" width="133" height="60" /></a></p>  <p>&#160;</p>  <p>By the way…. if you are going to run synchronization, you may want to set up the scheduled job&#160; in SQL Agent and on the job step use a Proxy Account. Then you can limit the jobs which use the credentials of the proxy account, and add that account as a Server Admin in Analysis Services so that you don’t open up the SQL Agent account so widely to run work in Analysis Services.</p>  <p>Here are the instructions on using Proxy Accounts</p>      <p>1. Make an appropriate windows account (local account or domain account) in Users and Groups, or ask the Domain Admin to do so. </p>  <p>2. Make a credential (a saved account+password) in SQL Server Database Engine. <a title="https://msdn.microsoft.com/en-us/library/ms190703(v=sql.105).aspx" href="https://msdn.microsoft.com/en-us/library/ms190703(v=sql.105).aspx">https://msdn.microsoft.com/en-us/library/ms190703(v=sql.105).aspx</a></p>  <p>3. Make a proxy account to map the credential to a certain kind of jobs. <a title="https://msdn.microsoft.com/en-us/library/ms189064(v=SQL.105).aspx" href="https://msdn.microsoft.com/en-us/library/ms189064(v=SQL.105).aspx">https://msdn.microsoft.com/en-us/library/ms189064(v=SQL.105).aspx</a></p>  <p>4. Change the job step which launches the XMLA command or the SSIS package which runs your synchronization to use the proxy account.</p>]]></content:encoded>
    </item>
    <item>
      <title>SQL 2012 Data Mining Add-in for Office 2013 prerequisites error</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/sql-2012-data-mining-add-in-for-office-2013-prerequisites-error</link>
      <pubDate>Thu, 29 Nov 2012 13:49:21 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2012/11/29/sql-2012-data-mining-add-in-for-office-2013-prerequisites-error/</guid>
      <description><![CDATA[If you try to install the Data Mining Add-in into Office 2013 the setup may fail with the...]]></description>
      <content:encoded><![CDATA[<p>If you try to install the Data Mining Add-in into Office 2013 the setup may fail with the prerequisite error. This may happen if you are using the ClickToRun install of Office, chances are you still have Office 2010 or another version side-by-side, as ClickToRun&#160; doesn’t uninstall previous versions of Office that are installed.&#160; </p>  <p>Error:</p>  <p>Setup is missing prerequisites:</p>  <p>- 32-bit version of Microsoft Office 2010</p>  <p>Go to <a href="https://go.microsoft.com/fwlink/?LinkID=216742">https://go.microsoft.com/fwlink/?LinkID=216742</a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1727.clip_image002_72374492.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1727.clip_5F00_image002_5F00_72374492.gif"><img title="clip_image002" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/7587.clip_image002_thumb_48C30352.gif" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/7587.clip_5F00_image002_5F00_thumb_5F00_48C30352.gif" width="642" height="326" /></a></p>  <p>&#160;</p>  <p>The resolution is to use the Service Pack 1 version (or later) of the SQL Server 2012 Data Mining Add-ins. This download is for 2012 SP1:</p>  <p><a title="https://www.microsoft.com/en-us/download/details.aspx?id=35578" href="https://www.microsoft.com/en-us/download/details.aspx?id=35578">https://www.microsoft.com/en-us/download/details.aspx?id=35578</a></p>  <p>&#160;</p>  <p>There is a way to hack it a bit by telling the installer that Office is installed, and skipping the check by doing this kind of command line:</p>  <p>MSIEXEC /I C:\temp\SQL_AS_DMAddin.msi OFFICE2010PRESENT=1</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting Error in an Excel 2010 PivotTable “The field that you are moving cannot be placed in that PivotTable area” when referring to PowerPivot data sources</title>
      <link>https://docs.microsoft.com/archive/blogs/jason_howell/getting-error-in-an-excel-2010-pivottable-the-field-that-you-are-moving-cannot-be-placed-in-that-pivottable-area-when-referring-to-powerpivot-data-sources</link>
      <pubDate>Wed, 26 Sep 2012 13:28:36 GMT</pubDate>
      <dc:creator><![CDATA[JasonHowell]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jason_howell/2012/09/26/getting-error-in-an-excel-2010-pivottable-the-field-that-you-are-moving-cannot-be-placed-in-that-pivottable-area-when-referring-to-powerpivot-data-sources/</guid>
      <description><![CDATA[We kept getting this error when attempt to drag and drop dimensions attributes into a PivotTable in...]]></description>
      <content:encoded><![CDATA[<p>We kept getting this error when attempt to drag and drop dimensions attributes into a PivotTable in Excel 2010 </p>  <p>“The field that you are moving cannot be placed in that PivotTable area”</p>  <p>We were trying to use an Excel workbook to drop in dimension attributes that are sourced from data living in the PowerPivot for Sharepoint Farm. We had our ODC file pointing to Analysis Services (MSOLAP provider) and the data source as the HTTP address of the XLSX living in the sharepoint farm. This means we are using Excel Services to feed in data to the client’s Excel Pivot Table from the server side PowerPivot workbook.</p>  <p>I used the sample PowerPivot workbooks from here to do some trial and error <a title="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=102" href="https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=102">https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&amp;id=102</a></p>  <h2>I confirm the problem is by design. Here’s why…</h2>  <p>You cannot use cube dimensional attributes in the Values area box in an Excel PivotTable. That is the way regular PivotTables work. You may have been spoiled by PowerPivot Pivot Tables which allow you to drop in dimensional data attributes from a hierarchy into the Values area. </p>  <p>If you need this in a regular PivotTable to do the same for a PowerPivot workbook, there is a workaround. You can create the implicit measures in the server side PowerPivot workbook to get the ones that you need to share with the read only users ahead of time.</p>  <p>The PowerPivot workbook when stored in PowerPivot for Sharepoint, and accessed via Excel Services over HTTP is much like a Tabular Cube being accessed via MSOLAP provider.</p>  <p>To quote this KB article <strong>Differences between OLAP and non-OLAP PivotTables in Excel: </strong><a href="https://support.microsoft.com/kb/234700">https://support.microsoft.com/kb/234700</a></p>  <blockquote>   <p>Layout and Design Differences</p>    <p><b>Dimensions vs. Measures</b></p>    <p>When you are working with a PivotTable report based on OLAP source data, <font style="background-color: rgb(255, 255, 0);">dimensions can be used only as row, column, or page fields.</font> Measures can be used only as data fields. <font style="background-color: rgb(255, 255, 0);">When you drag a dimension to the data field drop area, or a measure to the row, column, or page field drop area, you receive the following error message:</font></p>    <p><font style="background-color: rgb(255, 255, 0);">The field that you are moving cannot be placed in that PivotTable area.</font></p>    <p>When a PivotTable report based on OLAP source data is active, the PivotTable toolbar displays an icon next to each row of fields. The icon indicates where Excel will allow you to place the field in your PivotTable report. If the icon is darker in the upper left, then the field is a dimension that you can drag to the row, column, or page field drop areas. If the icon is darker in the lower right, then the field is a measure that you can drag to the data field drop area.</p> </blockquote>  <p><b></b></p>  <h2>The confusion between classic Excel Pivot Tables and PowerPIvot Pivot Tables</h2>  <p>There is a conceptual difference between a classic Excel OLAP-based pivot table and a PowerPivot pivot table.</p>  <p>When using your source workbook as a regular PivotTable in this manner, you can only use those fields that are measures. In your case, the only measures that you have designed is “Sum of MeasuresDistinct Count of patient”. This is one of the advanced modeling activities that PowerPivot supports that Excel pivot tables do not.</p>  <ul>   <li>In a PowerPivot pivot table, you can pull down any numeric measure.</li>    <li>In a classic Excel pivot table, you can only use measures in the cube</li> </ul>  <p>In PowerPIvot, when you pull down a numeric and drop it into the Values area , we create what we call an “implicit measure” behind your back. Classic Excel pivot tables cannot do that kind of automatic implicit measure.</p>  <p><b></b></p>  <h2>Possible Solution:</h2>  <p>What I suggest that you do is to take your numeric fields and drop them into the Values area in the <u>original</u> PowerPIvot workbook which lives in the PowerPivot gallery in Sharepoint. Doing so will create the implicit measure for you. </p>  <p>Then when you walk through the process to refer from Excel Services regular PivotTable to the PowerPivot “cube” in sharepoint, you will see a new measure group that you can drag down in the Excel pivot table.</p>  <p>It will show the implicit measures and their aggregate type (Count of, Sum of, etc).</p>  <p>Example of the PowerPivot workbook:</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5148.clip_image0024_226B5572.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5148.clip_5F00_image0024_5F00_226B5572.jpg"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image002[4]" border="0" alt="clip_image002[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5557.clip_image0024_thumb_4F804240.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5557.clip_5F00_image0024_5F00_thumb_5F00_4F804240.jpg" width="244" height="182" /></a><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6786.clip_image0044_40D5965B.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6786.clip_5F00_image0044_5F00_40D5965B.jpg"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image004[4]" border="0" alt="clip_image004[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6116.clip_image0044_thumb_43121F17.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6116.clip_5F00_image0044_5F00_thumb_5F00_43121F17.jpg" width="126" height="100" /></a></p>  <p>=====================================</p>  <p><b>Let’s prove it gives the error by design, and try the workaround:</b></p>  <p><b>A&gt; I can repro the problem like this:</b></p>  <p>1. Upload your favorite PowerPivot xlsx into the PowerPivot gallery in Sharepoint.</p>  <p><a href="https://site/PowerPivot/PowerPivot%20Healthcare%20Audit.xlsx">https://site/PowerPivot/PowerPivot Healthcare Audit.xlsx</a></p>  <p>2. Now make an Excel workbook which refers to data on the HTTP address of the PowerPivot workbook.</p>  <p>Let’s point the Excel piivot table to data in the server side PowerPivot HTTP via Excel Services.</p>  <p>The steps are listed in the following article under the heading “Import data from PowerPivot Workbook”.    <br /><a href="https://technet.microsoft.com/en-us/library/gg399165.aspx">https://technet.microsoft.com/en-us/library/gg399165.aspx</a>    <br /></p>  <p>&#160;</p>  <p>As the MSDN article said, refer to Analysis Services in the Data tab</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6523.clip_image0064_067A207A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6523.clip_5F00_image0064_5F00_067A207A.jpg"><img style="display: inline; background-image: none;" title="clip_image006[4]" border="0" alt="clip_image006[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0842.clip_image0064_thumb_456BA115.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0842.clip_5F00_image0064_5F00_thumb_5F00_456BA115.jpg" width="644" height="297" /></a></p>  <p>Point to the HTTP address of the PowerPivot workbook in Sharepoint.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0358.clip_image0084_122F67AC.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0358.clip_5F00_image0084_5F00_122F67AC.jpg"><img style="display: inline; background-image: none;" title="clip_image008[4]" border="0" alt="clip_image008[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0358.clip_image0084_thumb_6A1CB88C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0358.clip_5F00_image0084_5F00_thumb_5F00_6A1CB88C.jpg" width="644" height="455" /></a></p>  <p>The PowerPivot’s internal cube will appear</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5148.clip_image0104_5DAE9563.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5148.clip_5F00_image0104_5F00_5DAE9563.jpg"><img style="display: inline; background-image: none;" title="clip_image010[4]" border="0" alt="clip_image010[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6622.clip_image0104_thumb_275D6D54.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6622.clip_5F00_image0104_5F00_thumb_5F00_275D6D54.jpg" width="644" height="467" /></a></p>  <p>Rename if desired, and finish the ODC connection.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4062.clip_image0124_143C40A8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4062.clip_5F00_image0124_5F00_143C40A8.jpg"><img style="display: inline; background-image: none;" title="clip_image012[4]" border="0" alt="clip_image012[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4478.clip_image0124_thumb_532DC143.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4478.clip_5F00_image0124_5F00_thumb_5F00_532DC143.jpg" width="585" height="484" /></a></p>  <p>3. We can insert a PivotTable report into the workbook when prompted.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0456.clip_image0144_2B1B1224.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0456.clip_5F00_image0144_5F00_2B1B1224.jpg"><img style="display: inline; background-image: none;" title="clip_image014[4]" border="0" alt="clip_image014[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4456.clip_image0144_thumb_49F18602.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4456.clip_5F00_image0144_5F00_thumb_5F00_49F18602.jpg" width="644" height="435" /></a></p>  <p>4. We can add measures from the PowerPivot’s “cube” into the Aggregated Values pane.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6710.clip_image0164_418DB0AB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6710.clip_5F00_image0164_5F00_418DB0AB.jpg"><img style="display: inline; background-image: none;" title="clip_image016[4]" border="0" alt="clip_image016[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0358.clip_image0164_thumb_2E6C83FF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0358.clip_5F00_image0164_5F00_thumb_5F00_2E6C83FF.jpg" width="644" height="422" /></a></p>  <p>5. We&#160; can add Dimensional data into Rows or Columns</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4150.clip_image0184_1F55A525.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4150.clip_5F00_image0184_5F00_1F55A525.jpg"><img style="display: inline; background-image: none;" title="clip_image018[4]" border="0" alt="clip_image018[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4555.clip_image0184_thumb_1E110C46.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4555.clip_5F00_image0184_5F00_thumb_5F00_1E110C46.jpg" width="644" height="386" /></a></p>  <p>6. We cannot add Dimensional attribute data into the Aggregated Values pane.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1423.clip_image0204_31BDF5DA.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1423.clip_5F00_image0204_5F00_31BDF5DA.jpg"><img style="display: inline; background-image: none;" title="clip_image020[4]" border="0" alt="clip_image020[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8272.clip_image0204_thumb_028C0A43.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8272.clip_5F00_image0204_5F00_thumb_5F00_028C0A43.jpg" width="644" height="407" /></a></p>  <p>&#160;</p>  <p><b>B&gt; Contrast that with an OLAP based PivotTable. The same error applies to any PivotTable pointing to Adventureworks Multidimensional OLAP. Dimensional data cannot be places in Values pane.</b></p>  <p>1. Make a ODC connection to a multidimensional Analysis Server (MSOLAP provider where the Data Source is an AS server ,not the http PowerPivot .xlsx workbook)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8688.clip_image0224_73752B68.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8688.clip_5F00_image0224_5F00_73752B68.jpg"><img style="display: inline; background-image: none;" title="clip_image022[4]" border="0" alt="clip_image022[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0456.clip_image0224_thumb_3266AC04.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0456.clip_5F00_image0224_5F00_thumb_5F00_3266AC04.jpg" width="404" height="484" /></a></p>  <p>2. Create a Excel PivotTable based on that connection.</p>  <p>&#160;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0358.clip_image0244_7F2A729A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0358.clip_5F00_image0244_5F00_7F2A729A.jpg"><img style="display: inline; background-image: none;" title="clip_image024[4]" border="0" alt="clip_image024[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2806.clip_image0244_thumb_7732D038.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2806.clip_5F00_image0244_5F00_thumb_5F00_7732D038.jpg" width="383" height="278" /></a></p>  <p>3. Try to move a dimensional hierarchy attribute into the Values box.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4478.clip_image0264_0B4BECC2.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4478.clip_5F00_image0264_5F00_0B4BECC2.jpg"><img style="display: inline; background-image: none;" title="clip_image026[4]" border="0" alt="clip_image026[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5545.clip_image0264_thumb_4E47BB2F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5545.clip_5F00_image0264_5F00_thumb_5F00_4E47BB2F.jpg" width="572" height="484" /></a></p>  <p><b>C. Let’s compare to a PowerPivot Pivot table where Dimensional Data can be dropped into the Values box.</b></p>  <p><b></b></p>  <p>1. Click the PowerPivot ribbon &gt; Pivot Table button</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/3005.clip_image0284_73D13890.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/3005.clip_5F00_image0284_5F00_73D13890.jpg"><img style="display: inline; background-image: none;" title="clip_image028[4]" border="0" alt="clip_image028[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6204.clip_image0284_thumb_20E6255F.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6204.clip_5F00_image0284_5F00_thumb_5F00_20E6255F.jpg" width="644" height="132" /></a></p>  <p>2. Note the PowerPivot Field List is different – and has 6 area boxes rather than the 4 above.</p>  <p>In a PowerPivot Pivot table you can use Dimensional data in the aggregated Values box. The same field which fails in a regular Pivot Table (as shown above) can be added just fine.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4150.clip_image0304_52055FFF.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4150.clip_5F00_image0304_5F00_52055FFF.jpg"><img style="display: inline; background-image: none;" title="clip_image030[4]" border="0" alt="clip_image030[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/5633.clip_image0304_thumb_108AADA6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/5633.clip_5F00_image0304_5F00_thumb_5F00_108AADA6.jpg" width="549" height="484" /></a></p>  <p>So dropping a dimensional measure created the “Count of _____” implicit measure on your behalf.</p>  <p><b></b></p>  <p><b>D. Now Let’s try to resolve the&#160; problem by making implicit measures in the PowerPivot living in Sharepoint.</b></p>  <p><b></b></p>  <p>In the original PowerPivot workbook in the Gallery, the BI Developer can designate which fields should be declared as implicit measures.</p>  <p>1. Open the PowerPivot workbook from the gallery.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/2313.clip_image0324_6877FE86.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/2313.clip_5F00_image0324_5F00_6877FE86.jpg"><img style="display: inline; background-image: none;" title="clip_image032[4]" border="0" alt="clip_image032[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/4643.clip_image0324_thumb_2E88BB9A.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/4643.clip_5F00_image0324_5F00_thumb_5F00_2E88BB9A.jpg" width="644" height="224" /></a></p>  <p>2. Open the Workbook in Excel (make sure the PowerPivot for Excel add-in is installed)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0743.clip_image0344_2286CB66.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0743.clip_5F00_image0344_5F00_2286CB66.jpg"><img style="display: inline; background-image: none;" title="clip_image034[4]" border="0" alt="clip_image034[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0456.clip_image0344_thumb_5AC5427E.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0456.clip_5F00_image0344_5F00_thumb_5F00_5AC5427E.jpg" width="644" height="164" /></a></p>  <p>3. Make a new sheet and using the PowerPivot ribbon, add a “PivotTable” (the PowerPivot kind) and use the dimensional values that you need to use later in Excel Services in the PowerPivot field list for Values to create the implicit measures, such as COUNT OF ____ and SUM OF ____ shown here. </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1732.clip_image0364_1303B997.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1732.clip_5F00_image0364_5F00_1303B997.jpg"><img style="display: inline; background-image: none;" title="clip_image036[4]" border="0" alt="clip_image036[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0434.clip_image0364_thumb_388D36F8.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0434.clip_5F00_image0364_5F00_thumb_5F00_388D36F8.jpg" width="549" height="484" /></a></p>  <p>4. Save the workbook, so the new implicit measures are added back into the PowerPivot for Sharepoint server.</p>  <p>5. Now on the client in a different regular workbook, opened from Excel Services, or from Excel 2010 client itself… make a regular Pivot Table and choose the HTTP connection to the PowerPivot&#160; XLSX in sharepoint (http uses MSOLAP via Excel Services)</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/8360.clip_image0384_5763AAD6.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/8360.clip_5F00_image0384_5F00_5763AAD6.jpg"><img style="display: inline; background-image: none;" title="clip_image038[4]" border="0" alt="clip_image038[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/1325.clip_image0384_thumb_0882E577.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/1325.clip_5F00_image0384_5F00_thumb_5F00_0882E577.jpg" width="644" height="317" /></a></p>  <p>6. In this workbook, you can see the implicit measures which were defined automatically in the PowerPivot “cube” itself living in Sharepoint. I can use those implicit measures in the regular PivotTable as aggregated values.</p>  <p>Voila! </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/0743.clip_image0404_7C80F542.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/0743.clip_5F00_image0404_5F00_7C80F542.jpg"><img style="display: inline; background-image: none;" title="clip_image040[4]" border="0" alt="clip_image040[4]" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/35/65/metablogapi/6138.clip_image0404_thumb_1AEB362C.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-35-65-metablogapi/6138.clip_5F00_image0404_5F00_thumb_5F00_1AEB362C.jpg" width="644" height="441" /></a></p>]]></content:encoded>
    </item>
  </channel>
</rss>