<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Developer&#039;s Blog &#187; memory dump</title>
	<atom:link href="http://blog.hoegaerden.be/tag/memory-dump/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hoegaerden.be</link>
	<description>SQL Server, BI, .NET, IT and anything else I have been playing with.</description>
	<lastBuildDate>Wed, 01 Feb 2012 16:15:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Memory Dumps And Crazy Code Samples</title>
		<link>http://blog.hoegaerden.be/2010/02/06/memory-dumps-and-crazy-code-samples/</link>
		<comments>http://blog.hoegaerden.be/2010/02/06/memory-dumps-and-crazy-code-samples/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 10:53:29 +0000</pubDate>
		<dc:creator>Valentino Vranken</dc:creator>
				<category><![CDATA[Reporting Services]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[memory dump]]></category>
		<category><![CDATA[SSRS]]></category>

		<guid isPermaLink="false">http://blog.hoegaerden.be/2010/02/06/memory-dumps-and-crazy-code-samples/</guid>
		<description><![CDATA[I usually don’t write posts just to mention a link to another site.  Except when I’ve come across articles which are so good that I want everyone to know about them.  Here are a couple of articles in that particular category. What Does Microsoft Do With Those Memory Dumps? The first one is written by [...]]]></description>
			<content:encoded><![CDATA[<p>I usually don’t write posts just to mention a link to another site.  Except when I’ve come across articles which are so good that I want everyone to know about them.  Here are a couple of articles in that particular category.</p>
<h2>What Does Microsoft Do With Those Memory Dumps?</h2>
<p>The first one is written by <strong>Adam W. Saxton</strong>, a member of the <a title="CSS SQL Server Engineers blog" href="http://blogs.msdn.com/psssql/default.aspx" target="_blank">Microsoft Customer Service and Support (CSS) SQL Server Escalation Services team</a>.</p>
<p>The subject of the post is an issue that developers of Reporting Services reports may come across: <strong><em>“InvalidReportParameterException</em></strong> <strong>with Data Driven Subscription”</strong>.  The report complains about an invalid parameter while the parameters seem to be okay, visually.  Then the author goes on to describe the actual issue: trailing spaces!  If you’ve been doing BI for a while, this is a quite common issue.  Adam also shows the difference between the <a title="BOL 2008: LEN (Transact-SQL)" href="http://msdn.microsoft.com/en-us/library/ms190329.aspx" target="_blank">LEN()</a> and the <a title="BOL 2008: DATALENGTH (Transact-SQL)" href="http://msdn.microsoft.com/en-us/library/ms173486.aspx" target="_blank">DATALENGTH()</a> functions.</p>
<p>But that’s not the reason that I’m mentioning that article here.  The best part starts following the Summary chapter, and is entitled <strong>Techie Details</strong>.  In that extra chapter he shows how the CSS team uses those crash memory dumps which I’m sure you’ve all seen now and then. </p>
<p>I won’t give you any details about that, just<strong> </strong><a title="InvalidReportParameterException with Data Driven Subscription" href="http://blogs.msdn.com/psssql/archive/2009/12/10/invalidreportparameterexception-with-data-driven-subscription.aspx" target="_blank"><strong>have a look at the article</strong></a>.  If you’re a developer, there’s some very valuable information there!</p>
<p>I am definitely looking forward to seeing his pre-conference session at the <a title="PASS European Conference 2010" href="http://www.sqlpass.org/summit/eu2010/" target="_blank">SQL PASS European Conference in Germany</a> this year: <a title="Pre-Conference Sessions: PASS European Conference 2010 - Tackling Top Reporting Services Issues" href="http://www.sqlpass.org/summit/eu2010/Agenda/PreConference/TacklingTopReportingServicesIssues.aspx" target="_blank">Tackling Top Reporting Services Issues</a>!</p>
<h2>Some Crazy Code Samples</h2>
<p>The second article that I’d like to mention here is written by <a title="Phil Factor" href="http://www.simple-talk.com/author/phil-factor/" target="_blank">Phil Factor</a>, a regular at the <a title="simple-talk" href="http://www.simple-talk.com" target="_blank">Simple-Talk</a> site.</p>
<p>This article is called <a title="Laying out SQL Code" href="http://www.simple-talk.com/sql/t-sql-programming/laying-out-sql-code" target="_blank">Laying out SQL Code</a> and mentions some database naming conventions and T-SQL coding layout, as the title already implies.  Even if you’re not interested in that (although as a serious developer you should be!!), the article is worth the effort of reading just for its code samples.</p>
<p>Here’s my favorite one:</p>
<pre class="code"><span style="color: blue">CREATE TABLE </span>"╚╦╩╗" <span style="color: gray">( </span>"└┬┴┐" <span style="color: blue">nvarchar</span><span style="color: gray">(</span>10<span style="color: gray">))
</span><span style="color: blue">DECLARE </span>@ <span style="color: blue">nvarchar</span><span style="color: gray">(</span>10<span style="color: gray">)  </span><span style="color: blue">set </span>@<span style="color: gray">=</span><span style="color: red">'═'
</span><span style="color: blue">INSERT  INTO </span>"╚╦╩╗"
        <span style="color: gray">( </span>"└┬┴┐" <span style="color: gray">)
        </span><span style="color: blue">SELECT  </span><span style="color: magenta">replicate</span><span style="color: gray">(</span>@<span style="color: gray">,</span>5<span style="color: gray">)

</span><span style="color: blue">SELECT  </span><span style="color: gray">*
</span><span style="color: blue">FROM    </span>"╚╦╩╗"</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>And just to prove to you that this really is valid code, here’s the result:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Result of crazy query" src="http://blog.hoegaerden.be/wp-content/uploads/image173.png" border="0" alt="Result of crazy query" width="123" height="71" /></p>
<p>So, how about that database for that plumbing company? <img src='http://blog.hoegaerden.be/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>BTW: when running that code without paying attention to the details (such as what DB your SSMS is connected to), you may end up with something like this:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Silly table stored in master DB - that's not a best practice!" src="http://blog.hoegaerden.be/wp-content/uploads/image174.png" border="0" alt="Silly table stored in master DB - that's not a best practice!" width="192" height="94" /> </p>
<p>So you may want to clean up after running the query using this statement:</p>
<pre class="code"><span style="color: blue">drop table </span>"╚╦╩╗"</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Have fun!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.hoegaerden.be%2F2010%2F02%2F06%2Fmemory-dumps-and-crazy-code-samples%2F&amp;title=Memory%20Dumps%20And%20Crazy%20Code%20Samples" id="wpa2a_2"><img src="http://blog.hoegaerden.be/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.hoegaerden.be/2010/02/06/memory-dumps-and-crazy-code-samples/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

