<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>John Gallardo's Weblog : Microsoft</title><link>http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx</link><description>Tags: Microsoft</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Hiding parameter area when viewing reports</title><link>http://blogs.msdn.com/jgalla/archive/2009/03/23/hiding-parameter-area-when-viewing-reports.aspx</link><pubDate>Tue, 24 Mar 2009 00:19:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9502604</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/9502604.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=9502604</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jgalla/WindowsLiveWriter/Hidingparameterareawhenviewingreports_C939/image_2.png"&gt;&lt;img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="344" alt="image" src="http://blogs.msdn.com/blogfiles/jgalla/WindowsLiveWriter/Hidingparameterareawhenviewingreports_C939/image_thumb.png" width="581" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When rendering reports, oftentimes the application would like to minimize as much of the non-report area of the viewer control as possible.&amp;#160; This is easily accomplished when rendering the report through the built-in report viewer control hosted in the ReportServer web site (http://servername/reportserver).&amp;#160; &lt;/p&gt;  &lt;p&gt;There are two parameters which control the rendering of the viewer control area:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;rc:Parameters&lt;/li&gt;    &lt;li&gt;rc:Toolbar&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;rc:Parameters can have 3 values:&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2" width="400" border="0"&gt;&lt;tbody&gt;     &lt;tr&gt;       &lt;td valign="top" width="200"&gt;On&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Displays the parameter area as in the screenshot above.&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Off&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Completely hides the parameter area.&amp;#160; &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td valign="top" width="200"&gt;Collapsed&lt;/td&gt;        &lt;td valign="top" width="200"&gt;Renders the parameter area initially minimized, so a user can expand it if they need to view/change the parameters for a report.&lt;/td&gt;     &lt;/tr&gt;   &lt;/tbody&gt;&lt;/table&gt;  &lt;p&gt;Here is an example URL which demonstrates rendering a report with rc:Parameters=Collapsed:&lt;/p&gt;  &lt;p&gt;https://servername/ReportServer?%2fSamples%2fSQL+2008+Samples%2fAdventureWorks2008+Sample+Reports%2fEmployee+Sales+Summary+2008&amp;amp;rs:Command=Render&amp;amp;rc:Parameters=Collapsed&lt;/p&gt;  &lt;p&gt;The other way of hiding the parameter area is to render the report with rc:Toolbar=false.&amp;#160; For many applications though, there are side-effects of this approach which I don’t think are desireable.&amp;#160; These are:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It disables the automatic ping-mechanism to keep the user’s report session alive.&amp;#160; This can lead to rsExecutionNotFound errors if the user leaves the page inactive for several minutes.&lt;/li&gt;    &lt;li&gt;It also removes the navigation (next page, find, etc…) UI.&lt;/li&gt;    &lt;li&gt;By default, it will cause every page of the report to be returned to the client.&amp;#160; For long reports, this is typically not desireable.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So if you are in a situation where you want to minimize the amount of extraneous UI initially presented to the user, while still allowing flexibility in having the end user change the parameter values, consider using rc:Collapsed=true when rendering the report.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9502604" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Load Testing Reporting Services</title><link>http://blogs.msdn.com/jgalla/archive/2007/01/15/load-testing-reporting-services.aspx</link><pubDate>Tue, 16 Jan 2007 04:52:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1474462</guid><dc:creator>jgalla</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/1474462.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=1474462</wfw:commentRss><description>&lt;p&gt;This question came across one of our internal discussion aliases, and it wasn't the first time I had seen it... so I thought it might be interesting to other people as well. &lt;/p&gt; &lt;p&gt;Oftentimes, when people configure a load testing tool they set it up so that all of the connections come from the same logical user.&amp;nbsp; However, in Reporting Services we have a feature which prevents an authenticated user from performing a denial-of-service attack against the server.&amp;nbsp; We do this by limiting the number of operations that any given user (based on the user's name) can be performing at any given time.&amp;nbsp; When you hit this limit, you will get an error message like this:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;There are currently too many requests in progress for user: "ABC\XYZ". Please wait until the current requests have finished processing before issuing any more.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;At this point, there are basically two ways of resolving this issue:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Change your test scripts/application to spread the requests across multiple logical users.&lt;/li&gt; &lt;li&gt;Alter the rsReportServer.config file to extend the number of requests a user can have active.&amp;nbsp; The setting is the &amp;lt;Configuration&amp;gt; section and it is the "MaxActiveReqForOneUser" property.&amp;nbsp; The whole entry is this: &amp;lt;Add Key="MaxActiveReqForOneUser" Value="999999" /&amp;gt;.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Note that this setting can also be useful if your users are not talking directly to the server, but are instead going through an ASP.Net application which is always impersonating the same user when accessing SSRS.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1474462" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Diagnosing rsInternalError</title><link>http://blogs.msdn.com/jgalla/archive/2006/12/05/diagnosing-rsinternalcatalogexception.aspx</link><pubDate>Tue, 05 Dec 2006 20:52:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1212369</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/1212369.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=1212369</wfw:commentRss><description>&lt;p&gt;You know the one.&amp;nbsp; You try to render a report and you end up hitting the dreaded "An internal catalog exception has occurred" error message.&amp;nbsp; Generally speaking, this is an indication that something very bad happened within the server which is not necessarily due to any particular action you performed, but rather due to some internal check which failed or an exception which we were unable to recover from was thrown.&amp;nbsp; We purposefully do not display the entire error message to prevent information disclosure.&amp;nbsp; Instead, we write some more detailed information into one of our log files.&lt;/p&gt; &lt;p&gt;Tracking down the log file which contains the error can be a little tricky if you have never done it before.&amp;nbsp; I am going to assume that the error was generated as a result of interaction with the SSRS Web server, which handles all interactive (non-subscription) requests.&amp;nbsp; This is what you see when you are using the Report Viewer control in server mode, Report Manager, or talking to the ReportServer virtual directory directly via either SOAP or URL Access.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The log files for the web server are stored in %Program Files%\Microsoft SQL Server\&amp;lt;Instance&amp;gt;\Reporting Services\Log Files.&amp;nbsp; First thing you will want to do is head over there and look for the most recent file that look has a name like "ReportServer__&amp;lt;TimeStamp&amp;gt;".&amp;nbsp; There will be&amp;nbsp;a lot of files which almost look like this (such as ReportServerService__Timestamp) but we aren't interested in those just yet.&amp;nbsp; So crack open the log file which corresponds in time to when the internal catalog exception was thrown, and do a search for the string "InternalCatalogException".&amp;nbsp; Once you have found the exception, you will see a couple&amp;nbsp;of things:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;A call stack which shows where the exception occurred.  &lt;li&gt;Any previous exception which was handled and wrapped in our InternalCatalogException.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Here is an example:&lt;/p&gt; &lt;p&gt;w3wp!library!5!12/01/2006-15:36:47:: e ERROR: Throwing Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details., ;&lt;br&gt;Info: Microsoft.ReportingServices.Diagnostics.Utilities.InternalCatalogException: An internal error occurred on the report server. See the error log for more details. ---&amp;gt; System.Data.SqlClient.SqlException: Could not allocate space for object 'dbo.ChunkData'.'IX_ChunkData' in database 'ReportServerTempDB' because the 'PRIMARY' filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.&lt;br&gt;at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)&lt;br&gt;at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)&lt;br&gt;at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)&lt;br&gt;at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)&lt;br&gt;at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)&lt;br&gt;at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)&lt;br&gt;at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)&lt;br&gt;at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()&lt;br&gt;at Microsoft.ReportingServices.Library.CancelableSqlCommand.ExecuteNonQuery()&lt;br&gt;at Microsoft.ReportingServices.Library.ChunkStorage.CopyImages(Guid fromSnapshotID, Boolean fromIsPermanent, Guid toSnapshotID, Boolean toIsPermanent)&lt;br&gt;at Microsoft.ReportingServices.Library.ReportSnapshot.CopyImageChunksTo(ReportSnapshotBase target)&lt;br&gt;at Microsoft.ReportingServices.Library.RSService.RenderAsLive(CatalogItemContext reportContext, ItemProperties properties, ParameterInfoCollection effectiveParameters, Guid reportId, ClientRequest session, String description, ReportSnapshot intermediateSnapshot, DataSourceInfoCollection thisReportDataSources, Boolean cachingRequested, Boolean isLinkedReport, Warning[]&amp;amp; warnings, ReportSnapshot&amp;amp; resultSnapshotData, DateTime&amp;amp; executionDateTime, RuntimeDataSourceInfoCollection&amp;amp; alldataSources, UserProfileState&amp;amp; usedUserProfile)&lt;br&gt;at Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(CatalogItemContext reportContext, ClientRequest session, Warning[]&amp;amp; warnings, ParameterInfoCollection&amp;amp; effectiveParameters)&lt;br&gt;at Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext reportContext, ClientRequest session, Warning[]&amp;amp; warnings, ParameterInfoCollection&amp;amp; effectiveParameters, String[]&amp;amp; secondaryStreamNames)&lt;br&gt;--- End of inner exception stack trace ---  &lt;p&gt;Sometimes, this will be enough information for you to diagnose the situation and resolve it on your own.&amp;nbsp; For example, maybe the database where the RS catalog is being stored has run out of disk space.&amp;nbsp; Other times, things won't be particularly clear.&amp;nbsp; In those cases I recommend either contacting &lt;a href="http://support.microsoft.com/Default.aspx"&gt;Microsoft Support&lt;/a&gt;, or posting your question on the &lt;a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?forumid=82&amp;amp;siteid=1"&gt;SSRS Forum at MSDN&lt;/a&gt;.&amp;nbsp; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1212369" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Live Reports and rsReportNotReady Error</title><link>http://blogs.msdn.com/jgalla/archive/2006/08/30/live-reports-and-rsreportnotready-error.aspx</link><pubDate>Thu, 31 Aug 2006 03:36:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:732610</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/732610.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=732610</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/rserrors/htm/Microsoft.ReportingServices.Diagnostics.Utilities.ErrorStrings.resources.Strings_rsReportNotReady.asp"&gt;rsReportNotReady&lt;/a&gt; is only supposed to be thrown when a report is configured to run from an execution snapshot, and the execution snapshot has not yet been created.&amp;nbsp; It is a pretty rare occurrence and the whole error code is really meant to cover the small window between setting the report to run from an execution snapshot and actually calling the UpdateSnapshot() method().&lt;/p&gt; &lt;p&gt;Recently, we here on the &lt;a href="http://www.microsoft.com/sql/technologies/reporting/default.mspx"&gt;SSRS&lt;/a&gt; team saw a couple of cases where people were experiencing this error when the report was configured to execute live.&amp;nbsp; Technically, there is one valid scenario that this can happen, and that is when you request one of the streams for the report (via RenderStream() or passing StreamId on the URL to the /ReportServer endpoint) before you have actually rendered the primary stream of the report.&amp;nbsp; These customers weren't doing this though, they were rendering the report via the viewer control.&amp;nbsp; After a bit of troubleshooting, we eventually narrowed the problem down to the fact that &lt;a href="http://msdn2.microsoft.com/en-us/library/ms179599.aspx"&gt;Snapshot Isolation&lt;/a&gt; was enabled on the ReportServer and ReportServerTempDB databases.&amp;nbsp; Snapshot Isolation changes the locking semantics of the ReadCommitted isolation level, which broke some of our synchronization mechanisms -- we basically use the database as a distributed lock coordinator since we support scale-out by adding Report Server instances which don't directly communicate with each other.&amp;nbsp; Snapshot Isolation changes the locking semantics in such a way as that we cannot do this with the current implementation.&lt;/p&gt; &lt;p&gt;So what was the solution for these customers?&amp;nbsp; Disable Snapshot Isolation on the SSRS databases.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Are you still seeing the problem and you don't have Snapshot Isolation enabled on your ReportServer or ReportServerTempDB database?&amp;nbsp; If so please let me know.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=732610" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Windows Live Writer</title><link>http://blogs.msdn.com/jgalla/archive/2006/08/13/windows-live-writer.aspx</link><pubDate>Mon, 14 Aug 2006 00:58:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:698341</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/698341.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=698341</wfw:commentRss><description>&lt;p&gt;The &lt;a href="http://www.live.com"&gt;Windows Live&lt;/a&gt; folks just released &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt;.&amp;nbsp; It's a tool which runs on your desktop and lets you publish blog entries to a bunch of different weblog formats.&amp;nbsp; This is a test post on my MSDN blog.&amp;nbsp; &lt;/p&gt; &lt;p&gt;So far I think it is pretty cool.&amp;nbsp; It autodetected all of the settings on my MSDN blog, and hopefully this will publish without any problems.&amp;nbsp; I have lost more than a couple of blog posts in the web-based editor, so hopefully this will save me some of that pain.&lt;/p&gt; &lt;p&gt;&lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Go check it out!&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=698341" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Interviewed for SQLServerCentral.com</title><link>http://blogs.msdn.com/jgalla/archive/2006/08/03/interviewed-for-sqlservercentral-com.aspx</link><pubDate>Thu, 03 Aug 2006 20:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:687731</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/687731.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=687731</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://www.sqlservercentral.com/columnists/sjones/"&gt;Steve Jones&lt;/A&gt; recently interviewed me for a regular column he has on &lt;A href="http://www.sqlservercentral.com"&gt;sqlservercentral.com&lt;/A&gt;.&amp;nbsp; Check it out!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sqlservercentral.com/columnists/sjones/sqlserverspotlightonjohngallardo.asp"&gt;http://www.sqlservercentral.com/columnists/sjones/sqlserverspotlightonjohngallardo.asp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=687731" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Should I modify Reporting Services stored procedures?</title><link>http://blogs.msdn.com/jgalla/archive/2006/06/30/should-i-modify-reporting-services-stored-procedures.aspx</link><pubDate>Fri, 30 Jun 2006 20:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:652491</guid><dc:creator>jgalla</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/652491.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=652491</wfw:commentRss><description>&lt;P&gt;The answer, is quite simply "No."&lt;/P&gt;
&lt;P&gt;Someone shot&amp;nbsp;a post&amp;nbsp;from Google Groups through my inbox this morning where some people were having problems with session timeouts (they were seeing rsExecutionNotFound exceptions). Their "solution" was to edit the stored procedures that manage user session in our catalog database in attempt to prevent them from encountering this issue.&lt;/P&gt;
&lt;P&gt;This is wrong for a couple of reasons:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;If you think you are encountering a bug, please let us know about it.&amp;nbsp; You are probably not the only person hitting it.&amp;nbsp; We would like to fix the issue or provide a workaround&amp;nbsp;to make all of our customers happy.&lt;/LI&gt;
&lt;LI&gt;You don't know what you are doing.&amp;nbsp; Unless you have access to the source code for the entire product you are not going to be able to infer all of the semantics associated with the stored procedure.&amp;nbsp; Altering it will put your system in a completely untested state, making it very difficult for us to provide support for you.&lt;/LI&gt;&lt;/OL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=652491" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Reporting Services and Windows Authentication</title><link>http://blogs.msdn.com/jgalla/archive/2006/03/16/reporting-services-and-windows-authentication.aspx</link><pubDate>Fri, 17 Mar 2006 02:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:553314</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/553314.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=553314</wfw:commentRss><description>&lt;P&gt;Windows Authentication is good stuff, and rightly so many people are using it in their Reporting Services deployments.&amp;nbsp; Lately, there has been quite a rash of questions that people have regarding the inability to connect to their data sources when using Windows Authentication.&amp;nbsp; Usually the scenario is that they have RS on one box, their data is on another.&amp;nbsp; When they are developing on the RS box, everything works fine, but when connecting from other machines they run into authentication issues.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This is not a situation which is unique to RS.&amp;nbsp; The issue is usually the infamous "&lt;A href="http://support.microsoft.com/kb/264921/"&gt;double hop&lt;/A&gt;" issue with IIS.&amp;nbsp; In a nutshell, what happens is that the that credentials which are passed into IIS cannot passed to another machine for authentication.&amp;nbsp; In RS, you have a couple of workarounds.&amp;nbsp; You can choose to store the Windows credentials in our catalog where we will encrypt them and use them when establishing a connection to the data source.&amp;nbsp; Or, you can configure your network to allow &lt;A href="http://www.microsoft.com/windowsserver2003/technologies/security/kerberos/default.mspx"&gt;Kerberos delegation&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=553314" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/SSRS/default.aspx">SSRS</category></item><item><title>Using XML value() method to take advantage of a relational index</title><link>http://blogs.msdn.com/jgalla/archive/2006/01/05/509773.aspx</link><pubDate>Thu, 05 Jan 2006 22:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:509773</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/509773.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=509773</wfw:commentRss><description>&lt;P&gt;The &lt;A href="http://msdn.microsoft.com/xml/default.aspx?pull=/library/en-us/dnsql90/html/sqloptxml.asp"&gt;Performance Optimizations for XML Data Type in SQL Server 2005 whitepaper&lt;/A&gt; written by &lt;a href="http://blogs.msdn.com/spal/default.aspx"&gt;Shankar&lt;/A&gt; gives some pretty good advice for writing your XQuery statements so that they take advantage of an available XML Index.&amp;nbsp; However, oftentimes you will have to deal with incoming XML data which is represented as a variable and hence is not indexed.&amp;nbsp; In such a scenario, it is common to map some incoming values their corresponding representations within your database.&amp;nbsp; For example, you may want to map a particular customer name in an XML instance to their corresponding customer id in your relational store for the purpose of updating some record.&amp;nbsp; For mapping this value, you have basically two options, use exist() to perform the comparison in the XQuery context, or use value() to perform the comparison within the SQL context.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;After reading the performance optimization paper you will probably be inclined to use exist() method, however you might be surprised at the performance benefit you will get by using value() method in some cases.&amp;nbsp; Lets outline one of those cases now.&lt;/P&gt;
&lt;P&gt;My scenario is pretty simple, I have a table with customer information, and another table which stores calls that this customer has made.&amp;nbsp; Imagine I am a cell-phone provider or something.&amp;nbsp; I will receive chunks of XML which indicate the customer that called (referenced by some billing code), the phone number the customer called, and the number of minutes the call lasted.&amp;nbsp; Each packet of XML will contain multiple such records.&amp;nbsp; I store the data relationally in the following schema:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;create table [customers] (&lt;BR&gt;&amp;nbsp;[id] int primary key identity(1,1), &lt;BR&gt;&amp;nbsp;[billing_code] varchar(32) unique,&lt;BR&gt;&amp;nbsp;[name] varchar(32) &lt;BR&gt;) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;create table [calls] (&lt;BR&gt;&amp;nbsp;[call_id] int primary key identity(1,1),&lt;BR&gt;&amp;nbsp;[customer_id] int foreign key references [customers] (id),&lt;BR&gt;&amp;nbsp;[number] varchar(32), &lt;BR&gt;&amp;nbsp;[minutes] int&lt;BR&gt;) ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New"&gt;insert [customers] ([billing_code], [name]) values ('JOHN123', 'John')&lt;BR&gt;insert [customers] ([billing_code], [name]) values ('DENN456', 'Denny')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Note that the unique index on the [billing_code] column in the [customers] table will implicitly create a nonclustered index on that column.&lt;/P&gt;
&lt;P&gt;The goal now is to write a stored procedure which will accept the XML data, and perform the appropriate insertions into the relational data.&amp;nbsp; My first attempt will use nodes() and exist() method to map the [billing_code] to the appropriate [customer_id] for insertion into the [calls] table.&amp;nbsp; Also, let me show you an example instance which I will be parsing:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;declare @callSummary xml&lt;BR&gt;set @callSummary = &lt;BR&gt;N'&amp;lt;CallSummary&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Call billingCode="JOHN123" callTime="5" number="555 123-4567" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Call billingCode="DENN456" callTime="1" number="555 456-0000" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Call billingCode="DENN456" callTime="10" number="555 456-0010" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp; &amp;lt;Call billingCode="DENN456" callTime="15" number="555 456-0001" /&amp;gt;&lt;BR&gt;&amp;lt;/CallSummary&amp;gt;'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The resulting stored procedure which uses nodes() and exist() is the following:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;create proc parseSummaryExists &lt;BR&gt;&amp;nbsp;@callSummary xml&lt;BR&gt;as&lt;BR&gt;begin&lt;BR&gt;&amp;nbsp;insert [calls] ([customer_id], [number], [minutes])&lt;BR&gt;&amp;nbsp;&amp;nbsp;select [cust].[id], &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [call].[ref].value(&lt;/FONT&gt;&lt;A href="mailto:'@number'"&gt;&lt;FONT face="Courier New"&gt;'@number'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;, 'varchar(32)'), &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [call].[ref].value(&lt;/FONT&gt;&lt;A href="mailto:'@callTime'"&gt;&lt;FONT face="Courier New"&gt;'@callTime'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;, 'int')&lt;BR&gt;&amp;nbsp;&amp;nbsp;from @callSummary.nodes('/CallSummary/Call') [call]([ref])&lt;BR&gt;&amp;nbsp;&amp;nbsp;join [customers] [cust] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;on 1 = [call].[ref].exist(&lt;/FONT&gt;&lt;A href="mailto:'@billingCode[.=sql:column(&amp;quot;cust.billing_code&amp;quot;)]'"&gt;&lt;FONT face="Courier New"&gt;'@billingCode[.=sql:column("cust.billing_code")]'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;end&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;By looking at the plan that is generated for this update, it can be seen that we aren't really taking advantage of our index on the [billing_code] column.&amp;nbsp; Instead, we are simply scanning that index and sucking all of the values out, and joining that with each billingCode attribute from our xml instance.&amp;nbsp; This is not a solution that will scale well as we get more customers!&amp;nbsp; One problem that we have is since the comparison is being done in XQuery, we have to use XQuery comparison semantics.&amp;nbsp; This comparison is not collation-sensitive, and since it is possible for the billingCode attribute to have more than 32 characters, we have to perform the comparison using an nvarchar(max).&amp;nbsp; In other words, we simply don't have enough information in our index to perform this comparison in XQuery efficiently.&lt;/P&gt;
&lt;P&gt;Rather then trying to perform the comparison in XQuery, why not perform the comparison using T-SQL and the value() method?&amp;nbsp; Here is a similar stored proc which uses the value() method:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;create proc parseSummaryValue &lt;BR&gt;&amp;nbsp;@callSummary xml&lt;BR&gt;as&lt;BR&gt;begin&lt;BR&gt;&amp;nbsp;insert [calls] ([customer_id], [number], [minutes])&lt;BR&gt;&amp;nbsp;&amp;nbsp;select [cust].[id], &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [call].[ref].value(&lt;/FONT&gt;&lt;A href="mailto:'@number'"&gt;&lt;FONT face="Courier New"&gt;'@number'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;, 'varchar(32)'), &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [call].[ref].value(&lt;/FONT&gt;&lt;A href="mailto:'@callTime'"&gt;&lt;FONT face="Courier New"&gt;'@callTime'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;, 'int')&lt;BR&gt;&amp;nbsp;&amp;nbsp;from @callSummary.nodes('/CallSummary/Call') [call]([ref])&lt;BR&gt;&amp;nbsp;&amp;nbsp;join [customers] [cust] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;on [cust].[billing_code] = [call].[ref].value(&lt;/FONT&gt;&lt;A href="mailto:'@billingCode'"&gt;&lt;FONT face="Courier New"&gt;'@billingCode'&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;, 'varchar(32)')&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR&gt;end&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now, looking at the plan here, we can see a nested loops join where for each &amp;lt;Call&amp;gt; element in the incoming xml, we perform an index seek on the [customers] table to find the appropriate customer id.&amp;nbsp; This solution will scale in terms of the size of the incoming data, rather than the total number of customers.&lt;/P&gt;
&lt;P&gt;There are a couple of key points here to recognize.&amp;nbsp; The first is that the two queries are not the same.&amp;nbsp; One truncates the XML text node to 32 characters for the purposes of being able to perform a quick index lookup.&amp;nbsp; Depending on your scenario this may not be desireable, and you will want to perform the comparison using XQuery semantics.&amp;nbsp; In this case, you should use exist() but be aware that you may not be able to take much advantage of your existing relational indexes.&amp;nbsp; Another point is that value() is not just for "top level" projects of data from your XML instances, but can also be a useful tool for performing comparisons in the SQL context.&amp;nbsp; Finally, The last point that I am trying to make is that there is no silver bullet for getting the most performance out of your XQuery statements.&amp;nbsp; It is just as wrong to say "use exist()" as it is to say "use value()" for comparisons because they do different things.&amp;nbsp; Instead, you should carefully analyze your scenario by looking at the plans that are generated and make your decisions based on that.&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=509773" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/XQuery/default.aspx">XQuery</category><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>More Gadgets!</title><link>http://blogs.msdn.com/jgalla/archive/2005/11/01/487683.aspx</link><pubDate>Tue, 01 Nov 2005 17:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:487683</guid><dc:creator>jgalla</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jgalla/comments/487683.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jgalla/commentrss.aspx?PostID=487683</wfw:commentRss><description>&lt;a href="http://microsoftgadgets.com/default.aspx"&gt;http://microsoftgadgets.com/default.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;The &lt;a href="http://microsoftgadgets.com/blogs/gadgetnews/articles/380.aspx"&gt;"gadgets" folks&lt;/a&gt; have updated their blog to include some gadgets that you can add to &lt;a href="http://start.com"&gt;start.com&lt;/a&gt;.&amp;nbsp; I'm trying out the "Flickr" gadget as well as the "to-do" list gadget.&amp;nbsp; Are you using &lt;a href="http://start.com"&gt;start.com&lt;/a&gt; yet?&lt;br&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=487683" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jgalla/archive/tags/Microsoft/default.aspx">Microsoft</category></item></channel></rss>