<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Xerratus</title>
    <link>http://www.xerratus.com/</link>
    <description>Happily stressed out, since 1974</description>
    <language>en-us</language>
    <copyright>Xerratus</copyright>
    <lastBuildDate>Sun, 03 Aug 2008 18:20:58 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.7174.0</generator>
    <managingEditor>john@xerratus.com</managingEditor>
    <webMaster>john@xerratus.com</webMaster>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=b067c10f-f5b9-4804-b173-34e40614c649</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,b067c10f-f5b9-4804-b173-34e40614c649.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,b067c10f-f5b9-4804-b173-34e40614c649.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b067c10f-f5b9-4804-b173-34e40614c649</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Over the weekend I helped launch a website
that was located in the US but opted to host the site on a Canadian dedicated server. 
One of the first things I did while setting up the server was to change the regional
settings from "en-CA" to "en-US" (control panel -&gt; regional and language options). 
After pushing the site up to the server, I noticed during my testing that everywhere
I was displaying dates (using the built-in .ToLongDateString() function of the DateTime
object), the incorrect format was showing up.  Further more, transaction dates
were being entered into the database incorrectly as well.<br /><br />
en-CA formats:<br /><br />
Short date: "dd/MM/yyyy"<br />
Long date: "MMMM-dd-yy"<br /><br />
en-US formats:<br /><br />
Short date: "M/d/yyyy"<br />
Long date: "dddd, MMMM dd, yyyy"<br /><br />
So, the computers region was setup correctly but the incorrect dates were still being
shown.  Since the dates were being driven by a .NET object, I next looked at
the .NET Framework (I'm running 2.0).  The solution I found was to modify the <a href="http://www.xerratus.com/ct.ashx?id=b067c10f-f5b9-4804-b173-34e40614c649&amp;url=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhy4kkhe0%2528VS.80%2529.aspx">globalization
element</a> of the web.config by adding the following to the &lt;system.web&gt; element:<br /><br /><div style="font-family: Monospace; font-size: 10pt; background-color: white;"><span style="color: Blue;">&lt;</span><span style="color: rgb(163, 21, 21);">globalization<br /></span><span style="color: Blue;"></span><span style="color: Red;">   fileEncoding</span><span style="color: Blue;">=</span><span style="color: Black;">"</span><span style="color: Blue;">utf-8</span><span style="color: Black;">"<br /></span><span style="color: Blue;"></span><span style="color: Red;">   requestEncoding</span><span style="color: Blue;">=</span><span style="color: Black;">"</span><span style="color: Blue;">utf-8</span><span style="color: Black;">"<br /></span><span style="color: Blue;"></span><span style="color: Red;">   responseEncoding</span><span style="color: Blue;">=</span><span style="color: Black;">"</span><span style="color: Blue;">utf-8</span><span style="color: Black;">"<br /></span><span style="color: Blue;"></span><span style="color: Red;">   culture</span><span style="color: Blue;">=</span><span style="color: Black;">"</span><span style="color: Blue;">en-US</span><span style="color: Black;">"<br /></span><span style="color: Blue;"></span><span style="color: Red;">   uiCulture</span><span style="color: Blue;">=</span><span style="color: Black;">"</span><span style="color: Blue;">en-US</span><span style="color: Black;">"<br /></span><span style="color: Blue;">/&gt;</span></div><br />
Furthermore, since this was a dedicated server and all of the sites were going to
be US sites we moved this from the web.config to the machine.config so that all new
sites would not run into this problem.<br /><br /><p></p><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=b067c10f-f5b9-4804-b173-34e40614c649" /></body>
      <title>.ToLongDateString() showing incorrect format on international server (Windows 2008 running IIS7)</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,b067c10f-f5b9-4804-b173-34e40614c649.aspx</guid>
      <link>http://www.xerratus.com/2008/08/03/ToLongDateStringShowingIncorrectFormatOnInternationalServerWindows2008RunningIIS7.aspx</link>
      <pubDate>Sun, 03 Aug 2008 18:20:58 GMT</pubDate>
      <description>Over the weekend I helped launch a website that was located in the US but opted to host the site on a Canadian dedicated server.&amp;nbsp; One of the first things I did while setting up the server was to change the regional settings from "en-CA" to "en-US" (control panel -&amp;gt; regional and language options).&amp;nbsp; After pushing the site up to the server, I noticed during my testing that everywhere I was displaying dates (using the built-in .ToLongDateString() function of the DateTime object), the incorrect format was showing up.&amp;nbsp; Further more, transaction dates were being entered into the database incorrectly as well.&lt;br&gt;
&lt;br&gt;
en-CA formats:&lt;br&gt;
&lt;br&gt;
Short date: "dd/MM/yyyy"&lt;br&gt;
Long date: "MMMM-dd-yy"&lt;br&gt;
&lt;br&gt;
en-US formats:&lt;br&gt;
&lt;br&gt;
Short date: "M/d/yyyy"&lt;br&gt;
Long date: "dddd, MMMM dd, yyyy"&lt;br&gt;
&lt;br&gt;
So, the computers region was setup correctly but the incorrect dates were still being
shown.&amp;nbsp; Since the dates were being driven by a .NET object, I next looked at
the .NET Framework (I'm running 2.0).&amp;nbsp; The solution I found was to modify the &lt;a href="http://www.xerratus.com/ct.ashx?id=b067c10f-f5b9-4804-b173-34e40614c649&amp;amp;url=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fhy4kkhe0%2528VS.80%2529.aspx"&gt;globalization
element&lt;/a&gt; of the web.config by adding the following to the &amp;lt;system.web&amp;gt; element:&lt;br&gt;
&lt;br&gt;
&lt;div style="font-family: Monospace; font-size: 10pt; background-color: white;"&gt;
&lt;span style="color: Blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;globalization&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&amp;nbsp;&amp;nbsp; fileEncoding&lt;/span&gt;&lt;span style="color: Blue;"&gt;=&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;/span&gt;&lt;span style="color: Blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&amp;nbsp;&amp;nbsp; requestEncoding&lt;/span&gt;&lt;span style="color: Blue;"&gt;=&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;/span&gt;&lt;span style="color: Blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&amp;nbsp;&amp;nbsp; responseEncoding&lt;/span&gt;&lt;span style="color: Blue;"&gt;=&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;/span&gt;&lt;span style="color: Blue;"&gt;utf-8&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&amp;nbsp;&amp;nbsp; culture&lt;/span&gt;&lt;span style="color: Blue;"&gt;=&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;/span&gt;&lt;span style="color: Blue;"&gt;en-US&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;&lt;/span&gt;&lt;span style="color: Red;"&gt;&amp;nbsp;&amp;nbsp; uiCulture&lt;/span&gt;&lt;span style="color: Blue;"&gt;=&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;/span&gt;&lt;span style="color: Blue;"&gt;en-US&lt;/span&gt;&lt;span style="color: Black;"&gt;"&lt;br&gt;
&lt;/span&gt;&lt;span style="color: Blue;"&gt;/&amp;gt;&lt;/span&gt; 
&lt;/div&gt;
&lt;br&gt;
Furthermore, since this was a dedicated server and all of the sites were going to
be US sites we moved this from the web.config to the machine.config so that all new
sites would not run into this problem.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=b067c10f-f5b9-4804-b173-34e40614c649" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,b067c10f-f5b9-4804-b173-34e40614c649.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,6ee504f1-2dc9-4b0a-bdb4-ef74457ed753.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,6ee504f1-2dc9-4b0a-bdb4-ef74457ed753.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Here's one I just had to solve.  I
had an xml string that was being passed to a sproc that used sp_xml_preparedocument
to insert the values using OPENXML.  Problem was that the sproc was throwing
the following error:<br /><br />
'An invalid character was found in text'<br /><br />
The odd thing was that the xml in question was valid in Visual Studio before it passed
it to the sproc and did not have any illegal characters.  What I found was that
by simply changing the input value from varchar(max) to nvarchar(max) sp_xml_preparedocument
was able to parse the xml just fine.  
<br /><br />
For a quick refresher, <a href="http://www.xerratus.com/ct.ashx?id=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753&amp;url=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fms186939.aspx">read
up on nchar and nvarchar in T-SQL</a>.<br /><p></p><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753" /></body>
      <title>Fix for invalid character in sproc calling sp_xml_preparedocument that has valid vs.NET xml</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,6ee504f1-2dc9-4b0a-bdb4-ef74457ed753.aspx</guid>
      <link>http://www.xerratus.com/2008/07/31/FixForInvalidCharacterInSprocCallingSpxmlpreparedocumentThatHasValidVsNETXml.aspx</link>
      <pubDate>Thu, 31 Jul 2008 18:34:09 GMT</pubDate>
      <description>Here's one I just had to solve.&amp;nbsp; I had an xml string that was being passed to a sproc that used sp_xml_preparedocument to insert the values using OPENXML.&amp;nbsp; Problem was that the sproc was throwing the following error:&lt;br&gt;
&lt;br&gt;
'An invalid character was found in text'&lt;br&gt;
&lt;br&gt;
The odd thing was that the xml in question was valid in Visual Studio before it passed
it to the sproc and did not have any illegal characters.&amp;nbsp; What I found was that
by simply changing the input value from varchar(max) to nvarchar(max) sp_xml_preparedocument
was able to parse the xml just fine.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
For a quick refresher, &lt;a href="http://www.xerratus.com/ct.ashx?id=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753&amp;amp;url=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fms186939.aspx"&gt;read
up on nchar and nvarchar in T-SQL&lt;/a&gt;.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=6ee504f1-2dc9-4b0a-bdb4-ef74457ed753" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,6ee504f1-2dc9-4b0a-bdb4-ef74457ed753.aspx</comments>
      <category>Programming</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=8a307ce0-fd79-49b8-9a56-7d8b2f48488b</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,8a307ce0-fd79-49b8-9a56-7d8b2f48488b.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,8a307ce0-fd79-49b8-9a56-7d8b2f48488b.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=8a307ce0-fd79-49b8-9a56-7d8b2f48488b</wfw:commentRss>
      <slash:comments>6</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">The other day, <a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;url=http%3a%2f%2fmsdn.microsoft.com%2fvstudio%2f">Visual
Studio 2005</a> threw an odd error, seemingly out of the blue, that stated something
to the effect "Error loading property page" (sorry didn't grab a screen shot of it
because I didn't think it was anything) while trying to open a config file. 
After clicking "OK", the file opened without any formatting, just black and white
text.  To say the least, I was a little bummed; I love formatting.<br /><br /><img src="http://www.xerratus.com/content/binary/xml-format-fix-1.png" border="0" /><br /><br />
Unfortunately, the day it happened, I was a bit swamped with work.  In all actuality,
this happened over two weeks ago, I've just been too busy to look into it.  This
morning however, I decided to take a few minutes before my day got started and look
into fixing this problem.  First off, I wasn't sure what to Google and the vague
things I could come up with were yielding little useful results.  I then decided
to see if I could see if Visual Studio could tell me anything further.<br /><br />
I opened up "options", selected "Text Editor" then "XML".  The general property
page seemed fine.  I then clicked on the "Formatting" option and there it was:
"an error occurred loading this property page".  I now had something to search
for.<br /><br /><img src="http://www.xerratus.com/content/binary/xml-format-fix-2.png" border="0" /><br /><br />
Going back to Google, I searched for <a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;url=http%3a%2f%2fwww.google.com%2fsearch%3fhl%3den%26q%3dvisual%2bstudio%2b2005%2boptions%2bxml%2bformatting%2b%2522an%2berror%2boccurred%2bloading%2bthis%2bproperty%2bpage%2522%26btnG%3dGoogle%2bSearch"><i>visual
studio 2005 options xml formatting "an error occurred loading this property page"</i></a> and
the first result was this forum <a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;url=http%3a%2f%2fforums.asp.net%2fp%2f1126081%2f2210073.aspx">post</a> which
held the answer by <a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;url=http%3a%2f%2fforums.asp.net%2fmembers%2fBenson-Yu-_2D00_-MSFT.aspx">Benson
Yu - MSFT</a>.<br /><blockquote>The issue was resolved by running “devenv /setup” in Visual Studio 2005
Command Prompt.</blockquote>Nice!  So, I tried it out.<br /><br /><img src="http://www.xerratus.com/content/binary/xml-format-fix-3.png" border="0" /><br /><br />
Note: I did this while Visual Studio was open and yes, it worked without needing to
close it.<br /><br />
After the command prompt ran (which did take a minute or two, so be patient) I went
back to Visual Studios XML formatting option and saw that my options were there again.<br /><br /><img src="http://www.xerratus.com/content/binary/xml-format-fix-4.png" border="0" /><br /><br />
The web.config file I had opened was still black and white, so I closed and reopened
it and my formatting was returned.<br /><br /><img src="http://www.xerratus.com/content/binary/xml-format-fix-5.png" border="0" /><br /><br />
All is well again... now, back to work.<br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b" /></body>
      <title>Visual Studio 2005 xml formatting "an error occurred loading this property page"</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,8a307ce0-fd79-49b8-9a56-7d8b2f48488b.aspx</guid>
      <link>http://www.xerratus.com/2008/03/28/VisualStudio2005XmlFormattingAnErrorOccurredLoadingThisPropertyPage.aspx</link>
      <pubDate>Fri, 28 Mar 2008 15:57:33 GMT</pubDate>
      <description>The other day, &lt;a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;amp;url=http%3a%2f%2fmsdn.microsoft.com%2fvstudio%2f"&gt;Visual
Studio 2005&lt;/a&gt; threw an odd error, seemingly out of the blue, that stated something
to the effect "Error loading property page" (sorry didn't grab a screen shot of it
because I didn't think it was anything) while trying to open a config file.&amp;nbsp;
After clicking "OK", the file opened without any formatting, just black and white
text.&amp;nbsp; To say the least, I was a little bummed; I love formatting.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/xml-format-fix-1.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Unfortunately, the day it happened, I was a bit swamped with work.&amp;nbsp; In all actuality,
this happened over two weeks ago, I've just been too busy to look into it.&amp;nbsp; This
morning however, I decided to take a few minutes before my day got started and look
into fixing this problem.&amp;nbsp; First off, I wasn't sure what to Google and the vague
things I could come up with were yielding little useful results.&amp;nbsp; I then decided
to see if I could see if Visual Studio could tell me anything further.&lt;br&gt;
&lt;br&gt;
I opened up "options", selected "Text Editor" then "XML".&amp;nbsp; The general property
page seemed fine.&amp;nbsp; I then clicked on the "Formatting" option and there it was:
"an error occurred loading this property page".&amp;nbsp; I now had something to search
for.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/xml-format-fix-2.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Going back to Google, I searched for &lt;a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;amp;url=http%3a%2f%2fwww.google.com%2fsearch%3fhl%3den%26q%3dvisual%2bstudio%2b2005%2boptions%2bxml%2bformatting%2b%2522an%2berror%2boccurred%2bloading%2bthis%2bproperty%2bpage%2522%26btnG%3dGoogle%2bSearch"&gt;&lt;i&gt;visual
studio 2005 options xml formatting "an error occurred loading this property page"&lt;/i&gt;&lt;/a&gt; and
the first result was this forum &lt;a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;amp;url=http%3a%2f%2fforums.asp.net%2fp%2f1126081%2f2210073.aspx"&gt;post&lt;/a&gt; which
held the answer by &lt;a href="http://www.xerratus.com/ct.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b&amp;amp;url=http%3a%2f%2fforums.asp.net%2fmembers%2fBenson-Yu-_2D00_-MSFT.aspx"&gt;Benson
Yu - MSFT&lt;/a&gt;.&lt;br&gt;
&lt;blockquote&gt;The issue was resolved by running “devenv /setup” in Visual Studio 2005
Command Prompt.&lt;/blockquote&gt;Nice!&amp;nbsp; So, I tried it out.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/xml-format-fix-3.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Note: I did this while Visual Studio was open and yes, it worked without needing to
close it.&lt;br&gt;
&lt;br&gt;
After the command prompt ran (which did take a minute or two, so be patient) I went
back to Visual Studios XML formatting option and saw that my options were there again.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/xml-format-fix-4.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
The web.config file I had opened was still black and white, so I closed and reopened
it and my formatting was returned.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/xml-format-fix-5.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
All is well again... now, back to work.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=8a307ce0-fd79-49b8-9a56-7d8b2f48488b" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,8a307ce0-fd79-49b8-9a56-7d8b2f48488b.aspx</comments>
      <category>Screen capture</category>
      <category>Visual Studio 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=a5abf43f-bf71-4e86-b9a9-8e5feaa41774</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,a5abf43f-bf71-4e86-b9a9-8e5feaa41774.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,a5abf43f-bf71-4e86-b9a9-8e5feaa41774.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=a5abf43f-bf71-4e86-b9a9-8e5feaa41774</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Happy St. Patty's Day... 
<br /><br /><p></p><img src="http://www.xerratus.com/content/binary/greenbeer.jpg" border="0" /><br /><br />
Drink up!<br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=a5abf43f-bf71-4e86-b9a9-8e5feaa41774" /></body>
      <title>Green Beer-a-licious</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,a5abf43f-bf71-4e86-b9a9-8e5feaa41774.aspx</guid>
      <link>http://www.xerratus.com/2008/03/17/GreenBeeralicious.aspx</link>
      <pubDate>Mon, 17 Mar 2008 17:36:27 GMT</pubDate>
      <description>Happy St. Patty's Day... &lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.xerratus.com/content/binary/greenbeer.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Drink up!&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=a5abf43f-bf71-4e86-b9a9-8e5feaa41774" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,a5abf43f-bf71-4e86-b9a9-8e5feaa41774.aspx</comments>
      <category>Holiday</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=50bf28ed-88d4-4a80-b575-ce23f7538076</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,50bf28ed-88d4-4a80-b575-ce23f7538076.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,50bf28ed-88d4-4a80-b575-ce23f7538076.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=50bf28ed-88d4-4a80-b575-ce23f7538076</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Recently, I <a href="http://www.xerratus.com/ct.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076&amp;url=http%3a%2f%2fwww.xerratus.com%2f2007%2f12%2f20%2fUninstalledVistaAndReinstalledXP.aspx">uninstalled
Vista and reinstalled XP</a> on my work laptop.  Upon doing so, I had to reinstall
all of my developer tools.  One of them was Visual Studio 2005.  Oddly enough,
When I installed Firefox I opted to have it run as my default browser (when I was
on Vista I had IE).  It didn't occur to me that this would cause any problems. 
That was until I started debugging applications.<br /><br />
At first, all seemed fine.  Actually I thought it was going really good because
after stopping the debugger, the web page remained open, something that didn't happen
with IE.  But, as time went on, I found that my system slowed down once I started
debugging anything.  Looking at the processes, I found that Firefox was using
about 2 GB's of RAM.  Try sucking that into Visual Studio to debug.  Yeah,
that'll cause some slow downs.  <br /><br />
So, I decided that, as much as I like Firefox, I'll set IE as my default browser. 
Unfortunately, after doing this, Visual Studio kept debugging with Firefox and causing
havoc with my machine.  So, I did a quick search and found this obscure forum
thread that explained how to <a href="http://www.xerratus.com/ct.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076&amp;url=http%3a%2f%2fwww.msdner.com%2fdev-archive%2f195%2f6-56-1959920.shtm">reset
Visual Studio's browser</a>.  And it's pretty simple.<br /><br />
First, open a web project.  Find any .aspx page and right click it and select
"Browse with.."<br /><br /><img src="http://www.xerratus.com/content/binary/vs-set-default-browser-browse-with.jpg" border="0" /><br /><br />
There you should see a list of all available browsers plus the built in one.<br /><br /><img src="http://www.xerratus.com/content/binary/vs-set-default-browser-select-default.jpg" border="0" /><br /><br />
Select IE from the list and click "Set as Default".<br /><br /><img src="http://www.xerratus.com/content/binary/vs-set-default-browser-set-default.jpg" border="0" /><br /><br />
Close either by clicking "Browse" or "Cancel".  It doesn't matter which because
the setting has been saved by this point. 
<br /><br />
Debug your application and notice that IE now opens up.  And much faster I might
add.<br /><br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076" /></body>
      <title>Changing Visual Studios Default Debugging Browser</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,50bf28ed-88d4-4a80-b575-ce23f7538076.aspx</guid>
      <link>http://www.xerratus.com/2008/01/17/ChangingVisualStudiosDefaultDebuggingBrowser.aspx</link>
      <pubDate>Thu, 17 Jan 2008 23:22:16 GMT</pubDate>
      <description>Recently, I &lt;a href="http://www.xerratus.com/ct.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076&amp;amp;url=http%3a%2f%2fwww.xerratus.com%2f2007%2f12%2f20%2fUninstalledVistaAndReinstalledXP.aspx"&gt;uninstalled
Vista and reinstalled XP&lt;/a&gt; on my work laptop.&amp;nbsp; Upon doing so, I had to reinstall
all of my developer tools.&amp;nbsp; One of them was Visual Studio 2005.&amp;nbsp; Oddly enough,
When I installed Firefox I opted to have it run as my default browser (when I was
on Vista I had IE).&amp;nbsp; It didn't occur to me that this would cause any problems.&amp;nbsp;
That was until I started debugging applications.&lt;br&gt;
&lt;br&gt;
At first, all seemed fine.&amp;nbsp; Actually I thought it was going really good because
after stopping the debugger, the web page remained open, something that didn't happen
with IE.&amp;nbsp; But, as time went on, I found that my system slowed down once I started
debugging anything.&amp;nbsp; Looking at the processes, I found that Firefox was using
about 2 GB's of RAM.&amp;nbsp; Try sucking that into Visual Studio to debug.&amp;nbsp; Yeah,
that'll cause some slow downs. &amp;nbsp;&lt;br&gt;
&lt;br&gt;
So, I decided that, as much as I like Firefox, I'll set IE as my default browser.&amp;nbsp;
Unfortunately, after doing this, Visual Studio kept debugging with Firefox and causing
havoc with my machine.&amp;nbsp; So, I did a quick search and found this obscure forum
thread that explained how to &lt;a href="http://www.xerratus.com/ct.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076&amp;amp;url=http%3a%2f%2fwww.msdner.com%2fdev-archive%2f195%2f6-56-1959920.shtm"&gt;reset
Visual Studio's browser&lt;/a&gt;.&amp;nbsp; And it's pretty simple.&lt;br&gt;
&lt;br&gt;
First, open a web project.&amp;nbsp; Find any .aspx page and right click it and select
"Browse with.."&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/vs-set-default-browser-browse-with.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
There you should see a list of all available browsers plus the built in one.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/vs-set-default-browser-select-default.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Select IE from the list and click "Set as Default".&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/vs-set-default-browser-set-default.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Close either by clicking "Browse" or "Cancel".&amp;nbsp; It doesn't matter which because
the setting has been saved by this point. 
&lt;br&gt;
&lt;br&gt;
Debug your application and notice that IE now opens up.&amp;nbsp; And much faster I might
add.&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=50bf28ed-88d4-4a80-b575-ce23f7538076" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,50bf28ed-88d4-4a80-b575-ce23f7538076.aspx</comments>
      <category>Visual Studio 2005</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=328f2567-33e3-4873-9c5e-93fd5d1ae616</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,328f2567-33e3-4873-9c5e-93fd5d1ae616.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,328f2567-33e3-4873-9c5e-93fd5d1ae616.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=328f2567-33e3-4873-9c5e-93fd5d1ae616</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">This one has been plaguing me for years:
What is the best way to create a dynamic stored procedure that allows null inputs
to filter results?  To solve this, over the years, I've tried a few things, below
are just a couple:<br /><ul><li>
Build a SELECT statement string together concatenating non-null values then execute
the string.</li><li>
Use IF statements to narrow down the type of filtering requested and run the pre-built
SQL statement with the corresponding non-null values.</li></ul>
The problem with the above solutions is that neither rely on one solid select statement.<br /><br />
Today, while working on another request to come up with a dynamic stored procedure
for a specific report a client wants, I had an epiphany.  If I use isnull() in
conjunction to with the actual value, I can get the desired results, no matter what
input(s) are null -if any or all.<br /><br />
Here's the magic line that allows just that:<br /><br /><font color="#0000ff">WHERE</font> D1.MarketID = <font color="#ff00ff">isnull</font>(@MarketID,
D1.MarketID) 
<br /><br />
Now, we all know that isnull() returns the first non-null value.  So, if @MarketID
is null, then we just return the actual value of the row in question; D1.MarketId. 
For a fact, D1.MarketID will ALWAYS equal D1.MarketID.  That's it!  <br /><br />
So, if we create a sproc that takes in five different values (filters), all of which
can be null, utilize the above isnull() trick, we can let out business layer decide
which results to return simply by passing in an actual value or a <font color="#2b91af">DBNull</font>.Value
to the call.  The stored procedure finally becomes dumb and all of the logic
is finally in the hands of the business logic, where it should be, in a non-<a href="http://www.xerratus.com/ct.ashx?id=328f2567-33e3-4873-9c5e-93fd5d1ae616&amp;url=http%3a%2f%2fa.in.urbandict.net%2fdefine.php%3fterm%3dkludgie">kludgie</a> (pronounced
"Hacked") way.<br /><br />
Here is a quick example:<br /><br /><font color="#0000ff">CREATE PROC</font> Reporting_Impressions<br />
    @MarketID <font color="#0000ff">int</font> = NULL,<br />
    @StartDate <font color="#0000ff">datetime</font> = NULL,<br />
    @EndDate <font color="#0000ff">datetime</font> = NULL,<br />
    @Page <font color="#0000ff">varchar</font>(25) = NULL,<br />
    @LocationID <font color="#0000ff">uniqueidentifier</font> = NULL<br /><font color="#0000ff">AS</font><br /><br /><font color="#0000ff">SELECT</font> D1.LocationId, D1.LocationName, D1.MarketId, D1.MarketName, 
<br />
D1.DisplayedOnPage, count(D1.DisplayedDate) <font color="#0000ff">AS</font> TotalImpressions<br /><font color="#0000ff">FROM</font> PremiumMerchant_Displays <font color="#0000ff">AS</font> D1 <font color="#0000ff">WITH</font>(NOLOCK) 
<br /><font color="#808080">INNER JOIN</font> PremiumMerchant_Displays <font color="#0000ff">AS</font> D2 <font color="#0000ff">WITH</font>(NOLOCK) 
<br /><font color="#0000ff">ON</font> D1.LocationId = D2.LocationId <font color="#808080">AND</font> D1.MarketId
= D2.MarketId <font color="#808080">AND</font><br />
D1.DisplayedOnPage = D2.DisplayedOnPage <font color="#808080">AND</font> D1.ImpressionId
&lt;&gt; D2.ImpressionId<br /><font color="#0000ff">WHERE</font> D1.MarketID = <font color="#ff00ff">isnull</font>(@MarketID,
D1.MarketID) 
<br /><font color="#808080">AND</font> D1.DisplayedOnPage = <font color="#ff00ff">isnull</font>(@Page,
D1.DisplayedOnPage)<br /><font color="#808080">AND</font> D1.LocationId = <font color="#ff00ff">isnull</font>(@LocationID,
D1.LocationId)<br /><font color="#808080">AND</font> D1.DisplayedDate &gt;= <font color="#ff00ff">isnull</font>(@StartDate,
D1.DisplayedDate)<br /><font color="#808080">AND</font> D1.DisplayedDate &lt;= <font color="#ff00ff">isnull</font>(@EndDate,
D1.DisplayedDate)<br /><font color="#0000ff">GROUP BY</font> D1.LocationId, D1.LocationName, D1.MarketId,
D1.MarketName, D1.DisplayedOnPage<br /><br />
GO<br /><br />
And here are some various ways to call this procedure:<br /><br /><font color="#006400">--Specific market id</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions 4, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font><br /><br /><font color="#006400">--All, no filters</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font><br /><br /><font color="#006400">--Date range</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions <font color="#808080">NULL</font>, <font color="#ff0000">'1/1/2008
7:00:00 AM'</font>, <font color="#ff0000">'2/15/2008 11:00:00 AM'</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font><br /><br /><font color="#006400">--Specific page</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#ff0000">'Home'</font>, <font color="#808080">NULL</font><br /><br /><font color="#006400">--Specific Location</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#808080">NULL</font>, <font color="#ff0000">'B40B82C9-A41A-49DA-8950-3CBFF4488AEA'</font><br /><br /><font color="#006400">--Specific market id and page for a given date range</font><br /><font color="#0000ff">EXEC</font> Reporting_Impressions 4, <font color="#ff0000">'1/1/2008
7:00:00 AM'</font>, <font color="#ff0000">'2/15/2008 11:00:00 AM'</font>, <font color="#ff0000">'Directory'</font>, <font color="#808080">NULL</font><br /><br />
As you can see, there is only one stored procedure with many different results, all
of which are dependent on the number of non-null inputs and snuggled within a nice,
clean, single select statement.<br /><br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=328f2567-33e3-4873-9c5e-93fd5d1ae616" /></body>
      <title>A better way to create a dynamic SQL stored procedure</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,328f2567-33e3-4873-9c5e-93fd5d1ae616.aspx</guid>
      <link>http://www.xerratus.com/2008/01/11/ABetterWayToCreateADynamicSQLStoredProcedure.aspx</link>
      <pubDate>Fri, 11 Jan 2008 20:31:59 GMT</pubDate>
      <description>This one has been plaguing me for years: What is the best way to create a dynamic stored procedure that allows null inputs to filter results?&amp;nbsp; To solve this, over the years, I've tried a few things, below are just a couple:&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Build a SELECT statement string together concatenating non-null values then execute
the string.&lt;/li&gt;
&lt;li&gt;
Use IF statements to narrow down the type of filtering requested and run the pre-built
SQL statement with the corresponding non-null values.&lt;/li&gt;
&lt;/ul&gt;
The problem with the above solutions is that neither rely on one solid select statement.&lt;br&gt;
&lt;br&gt;
Today, while working on another request to come up with a dynamic stored procedure
for a specific report a client wants, I had an epiphany.&amp;nbsp; If I use isnull() in
conjunction to with the actual value, I can get the desired results, no matter what
input(s) are null -if any or all.&lt;br&gt;
&lt;br&gt;
Here's the magic line that allows just that:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt; D1.MarketID = &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@MarketID,
D1.MarketID) 
&lt;br&gt;
&lt;br&gt;
Now, we all know that isnull() returns the first non-null value.&amp;nbsp; So, if @MarketID
is null, then we just return the actual value of the row in question; D1.MarketId.&amp;nbsp;
For a fact, D1.MarketID will ALWAYS equal D1.MarketID.&amp;nbsp; That's it! &amp;nbsp;&lt;br&gt;
&lt;br&gt;
So, if we create a sproc that takes in five different values (filters), all of which
can be null, utilize the above isnull() trick, we can let out business layer decide
which results to return simply by passing in an actual value or a &lt;font color="#2b91af"&gt;DBNull&lt;/font&gt;.Value
to the call.&amp;nbsp; The stored procedure finally becomes dumb and all of the logic
is finally in the hands of the business logic, where it should be, in a non-&lt;a href="http://www.xerratus.com/ct.ashx?id=328f2567-33e3-4873-9c5e-93fd5d1ae616&amp;amp;url=http%3a%2f%2fa.in.urbandict.net%2fdefine.php%3fterm%3dkludgie"&gt;kludgie&lt;/a&gt; (pronounced
"Hacked") way.&lt;br&gt;
&lt;br&gt;
Here is a quick example:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;CREATE PROC&lt;/font&gt; Reporting_Impressions&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@MarketID &lt;font color="#0000ff"&gt;int&lt;/font&gt; = NULL,&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@StartDate &lt;font color="#0000ff"&gt;datetime&lt;/font&gt; = NULL,&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@EndDate &lt;font color="#0000ff"&gt;datetime&lt;/font&gt; = NULL,&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@Page &lt;font color="#0000ff"&gt;varchar&lt;/font&gt;(25) = NULL,&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;@LocationID &lt;font color="#0000ff"&gt;uniqueidentifier&lt;/font&gt; = NULL&lt;br&gt;
&lt;font color="#0000ff"&gt;AS&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; D1.LocationId, D1.LocationName, D1.MarketId, D1.MarketName, 
&lt;br&gt;
D1.DisplayedOnPage, count(D1.DisplayedDate) &lt;font color="#0000ff"&gt;AS&lt;/font&gt; TotalImpressions&lt;br&gt;
&lt;font color="#0000ff"&gt;FROM&lt;/font&gt; PremiumMerchant_Displays &lt;font color="#0000ff"&gt;AS&lt;/font&gt; D1 &lt;font color="#0000ff"&gt;WITH&lt;/font&gt;(NOLOCK) 
&lt;br&gt;
&lt;font color="#808080"&gt;INNER JOIN&lt;/font&gt; PremiumMerchant_Displays &lt;font color="#0000ff"&gt;AS&lt;/font&gt; D2 &lt;font color="#0000ff"&gt;WITH&lt;/font&gt;(NOLOCK) 
&lt;br&gt;
&lt;font color="#0000ff"&gt;ON&lt;/font&gt; D1.LocationId = D2.LocationId &lt;font color="#808080"&gt;AND&lt;/font&gt; D1.MarketId
= D2.MarketId &lt;font color="#808080"&gt;AND&lt;/font&gt; 
&lt;br&gt;
D1.DisplayedOnPage = D2.DisplayedOnPage &lt;font color="#808080"&gt;AND&lt;/font&gt; D1.ImpressionId
&amp;lt;&amp;gt; D2.ImpressionId&lt;br&gt;
&lt;font color="#0000ff"&gt;WHERE&lt;/font&gt; D1.MarketID = &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@MarketID,
D1.MarketID) 
&lt;br&gt;
&lt;font color="#808080"&gt;AND&lt;/font&gt; D1.DisplayedOnPage = &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@Page,
D1.DisplayedOnPage)&lt;br&gt;
&lt;font color="#808080"&gt;AND&lt;/font&gt; D1.LocationId = &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@LocationID,
D1.LocationId)&lt;br&gt;
&lt;font color="#808080"&gt;AND&lt;/font&gt; D1.DisplayedDate &amp;gt;= &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@StartDate,
D1.DisplayedDate)&lt;br&gt;
&lt;font color="#808080"&gt;AND&lt;/font&gt; D1.DisplayedDate &amp;lt;= &lt;font color="#ff00ff"&gt;isnull&lt;/font&gt;(@EndDate,
D1.DisplayedDate)&lt;br&gt;
&lt;font color="#0000ff"&gt;GROUP BY&lt;/font&gt; D1.LocationId, D1.LocationName, D1.MarketId,
D1.MarketName, D1.DisplayedOnPage&lt;br&gt;
&lt;br&gt;
GO&lt;br&gt;
&lt;br&gt;
And here are some various ways to call this procedure:&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--Specific market id&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions 4, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--All, no filters&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--Date range&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#ff0000"&gt;'1/1/2008
7:00:00 AM'&lt;/font&gt;, &lt;font color="#ff0000"&gt;'2/15/2008 11:00:00 AM'&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--Specific page&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#ff0000"&gt;'Home'&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--Specific Location&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;, &lt;font color="#ff0000"&gt;'B40B82C9-A41A-49DA-8950-3CBFF4488AEA'&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#006400"&gt;--Specific market id and page for a given date range&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;EXEC&lt;/font&gt; Reporting_Impressions 4, &lt;font color="#ff0000"&gt;'1/1/2008
7:00:00 AM'&lt;/font&gt;, &lt;font color="#ff0000"&gt;'2/15/2008 11:00:00 AM'&lt;/font&gt;, &lt;font color="#ff0000"&gt;'Directory'&lt;/font&gt;, &lt;font color="#808080"&gt;NULL&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
As you can see, there is only one stored procedure with many different results, all
of which are dependent on the number of non-null inputs and snuggled within a nice,
clean, single select statement.&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=328f2567-33e3-4873-9c5e-93fd5d1ae616" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,328f2567-33e3-4873-9c5e-93fd5d1ae616.aspx</comments>
      <category>Programming</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=05987e94-8a09-4c38-b2d2-4be015e02ade</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,05987e94-8a09-4c38-b2d2-4be015e02ade.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,05987e94-8a09-4c38-b2d2-4be015e02ade.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=05987e94-8a09-4c38-b2d2-4be015e02ade</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Nice little trick if you want to return
results sorted randomly from a SQL 2000/2005 database:<br /><br /><font color="#0000ff">SELECT</font> * <font color="#0000ff">FROM</font> Customers <font color="#0000ff">ORDER
BY</font><font color="#ff00ff">newid</font>()<br /><br />
So say you want to return 10 random customers from the database, you'd modify the
statement as such:<br /><br /><font color="#0000ff">SELECT TOP </font>10 * <font color="#0000ff">FROM</font> Customers <font color="#0000ff">ORDER
BY</font><font color="#ff00ff">newid</font>()<br /><br />
For those who don't know, <font color="#ff00ff">newid</font>() generates a new <a href="http://www.xerratus.com/ct.ashx?id=05987e94-8a09-4c38-b2d2-4be015e02ade&amp;url=http%3a%2f%2fen.wikipedia.org%2fwiki%2fGlobally_Unique_Identifier">guid</a>,
just as <font color="#2b91af">Guid</font>.NewGuid() does in .NET.  By ordering
a uniquely generated guid, we're guaranteed random results.<p></p><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=05987e94-8a09-4c38-b2d2-4be015e02ade" /></body>
      <title>SQL Random Sorting</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,05987e94-8a09-4c38-b2d2-4be015e02ade.aspx</guid>
      <link>http://www.xerratus.com/2008/01/10/SQLRandomSorting.aspx</link>
      <pubDate>Thu, 10 Jan 2008 18:42:53 GMT</pubDate>
      <description>Nice little trick if you want to return results sorted randomly from a SQL 2000/2005 database:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;SELECT&lt;/font&gt; * &lt;font color="#0000ff"&gt;FROM&lt;/font&gt; Customers &lt;font color="#0000ff"&gt;ORDER
BY&lt;/font&gt; &lt;font color="#ff00ff"&gt;newid&lt;/font&gt;()&lt;br&gt;
&lt;br&gt;
So say you want to return 10 random customers from the database, you'd modify the
statement as such:&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;SELECT TOP &lt;/font&gt;10 * &lt;font color="#0000ff"&gt;FROM&lt;/font&gt; Customers &lt;font color="#0000ff"&gt;ORDER
BY&lt;/font&gt; &lt;font color="#ff00ff"&gt;newid&lt;/font&gt;()&lt;br&gt;
&lt;br&gt;
For those who don't know, &lt;font color="#ff00ff"&gt;newid&lt;/font&gt;() generates a new &lt;a href="http://www.xerratus.com/ct.ashx?id=05987e94-8a09-4c38-b2d2-4be015e02ade&amp;amp;url=http%3a%2f%2fen.wikipedia.org%2fwiki%2fGlobally_Unique_Identifier"&gt;guid&lt;/a&gt;,
just as &lt;font color="#2b91af"&gt;Guid&lt;/font&gt;.NewGuid() does in .NET.&amp;nbsp; By ordering
a uniquely generated guid, we're guaranteed random results.&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=05987e94-8a09-4c38-b2d2-4be015e02ade" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,05987e94-8a09-4c38-b2d2-4be015e02ade.aspx</comments>
      <category>Programming</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=7b45adbb-474b-428a-ad60-479437824200</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,7b45adbb-474b-428a-ad60-479437824200.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,7b45adbb-474b-428a-ad60-479437824200.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=7b45adbb-474b-428a-ad60-479437824200</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Well it was bound to happen.  Everyone
in my office had made the switch back, I was the last holdout.  I finally had
it with Vista!  
<br /><br />
I really wanted to like it, I really did.  It looked sharp... hmm, come to think
of it, that's all I can really say about it.  I looked sharp.  But in the
end, after installing some updates, it became unstable and I failed to figure out
what the cause was.  Even with uninstalling said updates, it still randomly spiked
the cpu to 100% for 5 or so minutes at a time, leaving me helpless to do any work.<br /><br />
So, before I left work yesterday I repartinioned my C:\ drive and reinstalled XP. 
Up until 11pm last night I was trying to get my machine back to par for work. 
I have to admit, after making the switch from XP to Vista then back to XP, I do notice
that XP is considerably faster.  I guess making it look "sharp" had it's disadvantages.<br /><br /><b>Quick note to Microsoft: </b>WTF MAN!  How could you screw up an OS so badly? 
I want Vista, but I want it STABLE.  I don't want to have to cross my fingers
before installing updates as I had to ever since I installed it.  And yes, I
have had to uninstall updates in the past.  
<br /><p></p><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=7b45adbb-474b-428a-ad60-479437824200" /></body>
      <title>Uninstalled Vista and reinstalled XP</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,7b45adbb-474b-428a-ad60-479437824200.aspx</guid>
      <link>http://www.xerratus.com/2007/12/20/UninstalledVistaAndReinstalledXP.aspx</link>
      <pubDate>Thu, 20 Dec 2007 16:44:10 GMT</pubDate>
      <description>Well it was bound to happen.&amp;nbsp; Everyone in my office had made the switch back, I was the last holdout.&amp;nbsp; I finally had it with Vista!&amp;nbsp; &lt;br&gt;
&lt;br&gt;
I really wanted to like it, I really did.&amp;nbsp; It looked sharp... hmm, come to think
of it, that's all I can really say about it.&amp;nbsp; I looked sharp.&amp;nbsp; But in the
end, after installing some updates, it became unstable and I failed to figure out
what the cause was.&amp;nbsp; Even with uninstalling said updates, it still randomly spiked
the cpu to 100% for 5 or so minutes at a time, leaving me helpless to do any work.&lt;br&gt;
&lt;br&gt;
So, before I left work yesterday I repartinioned my C:\ drive and reinstalled XP.&amp;nbsp;
Up until 11pm last night I was trying to get my machine back to par for work.&amp;nbsp;
I have to admit, after making the switch from XP to Vista then back to XP, I do notice
that XP is considerably faster.&amp;nbsp; I guess making it look "sharp" had it's disadvantages.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Quick note to Microsoft: &lt;/b&gt;WTF MAN!&amp;nbsp; How could you screw up an OS so badly?&amp;nbsp;
I want Vista, but I want it STABLE.&amp;nbsp; I don't want to have to cross my fingers
before installing updates as I had to ever since I installed it.&amp;nbsp; And yes, I
have had to uninstall updates in the past.&amp;nbsp; 
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=7b45adbb-474b-428a-ad60-479437824200" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,7b45adbb-474b-428a-ad60-479437824200.aspx</comments>
      <category>Vista</category>
      <category>XP</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=87e66fc9-1e6a-4e2d-ace8-4af26cc92adb</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,87e66fc9-1e6a-4e2d-ace8-4af26cc92adb.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,87e66fc9-1e6a-4e2d-ace8-4af26cc92adb.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=87e66fc9-1e6a-4e2d-ace8-4af26cc92adb</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">Here's another WTF that Vista threw at
me today.  I had to come home early today and decided to work the rest of the
day from home.  Now, because I can't undock my laptop because Vista freezes,
before I leave each day, I put it to "sleep".  So, first thing I needed to do
before I could resume working was to connect to my works VPN.  Now, normally
this is not an issue, but sometime (I'd say every 1 out of 4 times) Vista displays
"This connection requires an active Internet connection" in the "Connect to a Network"
dialog even though, directly below it, it clearly shows that I'm connected via my
wireless connection.  
<br /><br /><img src="http://www.xerratus.com/content/binary/network-connect-list.jpg" border="0" /><br /><br />
To get around this, simple do the following:<br /><br />
Click on the "Set up a connection or network" link on the above dialog box.<br /><br /><img src="http://www.xerratus.com/content/binary/network-select-vpn.jpg" border="0" /><br /><br />
Scroll down the list of connection options and select "Connect to a workplace".<br /><br /><img src="http://www.xerratus.com/content/binary/network-connect-existing.jpg" border="0" /><br /><br />
Choose "Yes, I'll choose an existing connection" on the next screen and Vista will
connect to the VPN.<br /><br />
Not sure why this happens but I've seen it enough times to warrant this post.<br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=87e66fc9-1e6a-4e2d-ace8-4af26cc92adb" /></body>
      <title>Vista VPN Needs Active Connection BUT An Active Connection Already Exists</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,87e66fc9-1e6a-4e2d-ace8-4af26cc92adb.aspx</guid>
      <link>http://www.xerratus.com/2007/12/11/VistaVPNNeedsActiveConnectionBUTAnActiveConnectionAlreadyExists.aspx</link>
      <pubDate>Tue, 11 Dec 2007 21:23:24 GMT</pubDate>
      <description>Here's another WTF that Vista threw at me today.&amp;nbsp; I had to come home early today and decided to work the rest of the day from home.&amp;nbsp; Now, because I can't undock my laptop because Vista freezes, before I leave each day, I put it to "sleep".&amp;nbsp; So, first thing I needed to do before I could resume working was to connect to my works VPN.&amp;nbsp; Now, normally this is not an issue, but sometime (I'd say every 1 out of 4 times) Vista displays "This connection requires an active Internet connection" in the "Connect to a Network" dialog even though, directly below it, it clearly shows that I'm connected via my wireless connection.&amp;nbsp; &lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/network-connect-list.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
To get around this, simple do the following:&lt;br&gt;
&lt;br&gt;
Click on the "Set up a connection or network" link on the above dialog box.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/network-select-vpn.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Scroll down the list of connection options and select "Connect to a workplace".&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/network-connect-existing.jpg" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Choose "Yes, I'll choose an existing connection" on the next screen and Vista will
connect to the VPN.&lt;br&gt;
&lt;br&gt;
Not sure why this happens but I've seen it enough times to warrant this post.&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=87e66fc9-1e6a-4e2d-ace8-4af26cc92adb" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,87e66fc9-1e6a-4e2d-ace8-4af26cc92adb.aspx</comments>
      <category>Vista</category>
    </item>
    <item>
      <trackback:ping>http://www.xerratus.com/Trackback.aspx?guid=6b1f39cf-806e-4aa4-8869-34d4c62b0930</trackback:ping>
      <pingback:server>http://www.xerratus.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.xerratus.com/PermaLink,guid,6b1f39cf-806e-4aa4-8869-34d4c62b0930.aspx</pingback:target>
      <dc:creator>John McGuinness</dc:creator>
      <wfw:comment>http://www.xerratus.com/CommentView,guid,6b1f39cf-806e-4aa4-8869-34d4c62b0930.aspx</wfw:comment>
      <wfw:commentRss>http://www.xerratus.com/SyndicationService.asmx/GetEntryCommentsRss?guid=6b1f39cf-806e-4aa4-8869-34d4c62b0930</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Yesterday, my wife and I went out to our
favorite christmas tree farm and picked out three lovely trees.  Yes, I said
three.  We do this.  
<br /><br /><p></p><img src="http://www.xerratus.com/content/binary/TreeKill.JPG" border="0" /><br /><br />
The farmer was nice enough to let my wife cut down the smallest of them. 
<br /><br /><img src="http://www.xerratus.com/content/binary/TreeKill%20%282%29.JPG" border="0" /><br /><br />
Exhilarating! Her first confirmed kill.<br /><br /><img src="http://www.xerratus.com/content/binary/ThePose.JPG" border="0" /><br /><br />
After all that hard work, here she is in her "pose" under a warm cup of Peet's Coffee.<br /><br /><img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=6b1f39cf-806e-4aa4-8869-34d4c62b0930" /></body>
      <title>Three Christmas Trees</title>
      <guid isPermaLink="false">http://www.xerratus.com/PermaLink,guid,6b1f39cf-806e-4aa4-8869-34d4c62b0930.aspx</guid>
      <link>http://www.xerratus.com/2007/12/02/ThreeChristmasTrees.aspx</link>
      <pubDate>Sun, 02 Dec 2007 19:25:41 GMT</pubDate>
      <description>Yesterday, my wife and I went out to our favorite christmas tree farm and picked out three lovely trees.&amp;nbsp; Yes, I said three.&amp;nbsp; We do this.&amp;nbsp; &lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img src="http://www.xerratus.com/content/binary/TreeKill.JPG" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
The farmer was nice enough to let my wife cut down the smallest of them. 
&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/TreeKill%20%282%29.JPG" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
Exhilarating! Her first confirmed kill.&lt;br&gt;
&lt;br&gt;
&lt;img src="http://www.xerratus.com/content/binary/ThePose.JPG" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
After all that hard work, here she is in her "pose" under a warm cup of Peet's Coffee.&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://www.xerratus.com/aggbug.ashx?id=6b1f39cf-806e-4aa4-8869-34d4c62b0930" /&gt;</description>
      <comments>http://www.xerratus.com/CommentView,guid,6b1f39cf-806e-4aa4-8869-34d4c62b0930.aspx</comments>
      <category>Holiday</category>
      <category>Wifey</category>
    </item>
  </channel>
</rss>