<?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/"
		xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>CraigN.NET &#187; Development</title>
	<atom:link href="http://craign.net/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://craign.net</link>
	<description>Thoughts about life, the universe and everything else.</description>
	<lastBuildDate>Tue, 08 Nov 2011 08:52:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<copyright>2006-2007 </copyright>
	<managingEditor>craign@gmail.com (CraigN.NET)</managingEditor>
	<webMaster>craign@gmail.com (CraigN.NET)</webMaster>
	<image>
		<url>http://craign.net/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>CraigN.NET</title>
		<link>http://craign.net</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Thoughts about life, the universe and everything else.</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &#38; Culture" />
	<itunes:author>CraigN.NET</itunes:author>
	<itunes:owner>
		<itunes:name>CraigN.NET</itunes:name>
		<itunes:email>craign@gmail.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://craign.net/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Making date and time sense from the SQL Server Agent job history table</title>
		<link>http://craign.net/2009/11/26/making-date-and-time-sense-from-the-sql-server-agent-job-history-table/</link>
		<comments>http://craign.net/2009/11/26/making-date-and-time-sense-from-the-sql-server-agent-job-history-table/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 19:17:28 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[sample]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[TSQL]]></category>

		<guid isPermaLink="false">http://craign.net/2009/11/26/making-date-and-time-sense-from-the-sql-server-agent-job-history-table/</guid>
		<description><![CDATA[A bit of Transact-SQL code to help make sense of the sysjobhistory table date and time values.]]></description>
			<content:encoded><![CDATA[<p>Sometimes you’ve got to wonder why database developers do things the way the do. Take for example the <strong>sysjobhistory</strong> table in the SQL Server <strong>msdb</strong> database. Its got two awful columns namely <strong>run_date</strong> and <strong>run_time</strong>. Why are they awful you ask? Well because they are integer representations of the date and time. Just look at the following examples to see the stupidity.</p>
<div align="center">
<table border="1" cellspacing="0" cellpadding="0" width="600">
<tbody>
<tr>
<td valign="top" width="200"><strong>run_date</strong></td>
<td valign="top" width="200"><strong>run_time</strong></td>
<td valign="top" width="200"><strong>Actual</strong></td>
</tr>
<tr>
<td valign="top" width="200">20091123</td>
<td valign="top" width="200">230000</td>
<td valign="top" width="200">2009-11-23 23:00:00</td>
</tr>
<tr>
<td valign="top" width="200">20091123</td>
<td valign="top" width="200">230001</td>
<td valign="top" width="200">2009-11-23 23:00:01</td>
</tr>
<tr>
<td valign="top" width="200">20091123</td>
<td valign="top" width="200">234500</td>
<td valign="top" width="200">2009-11-23 23:45:00</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">0</td>
<td valign="top" width="200">2009-11-24 00:00:00</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">0</td>
<td valign="top" width="200">2009-11-24 00:00:01</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">1000</td>
<td valign="top" width="200">2009-11-24 00:10:00</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">3000</td>
<td valign="top" width="200">2009-11-24 00:30:00</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">10000</td>
<td valign="top" width="200">2009-11-24 01:00:00</td>
</tr>
<tr>
<td valign="top" width="200">20091124</td>
<td valign="top" width="200">10636</td>
<td valign="top" width="200">2009-11-24 01:06:36</td>
</tr>
</tbody>
</table></div>
<p>Now if you’re wanting to do something meaningful with them you’ll want to represent them as a <strong>DATETIME</strong> data type most likely. After searching for a quick and easy way I decided to hack a quick bit of TSQL up and put it up here so hopefully others might benefit.</p>
<div class="csharpcode">
<pre class="alt"><span class="kwrd">SELECT</span>    <span class="kwrd">CONVERT</span>(DATETIME, </pre>
<pre>            STUFF(STUFF(<span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, [run_date]), 7, 0, <span class="str">'-'</span>), 5, 0, <span class="str">'-'</span>) + </pre>
<pre class="alt">            <span class="str">' '</span> + </pre>
<pre>            STUFF(STUFF(<span class="kwrd">RIGHT</span>(<span class="str">'00000'</span> + <span class="kwrd">CONVERT</span>(<span class="kwrd">VARCHAR</span>, [run_time]), 6), 5, 0, <span class="str">':'</span>), 3, 0, <span class="str">':'</span>), 120)</pre>
<pre class="alt"><span class="kwrd">FROM</span>    [msdb]..[sysjobhistory]</pre>
<pre>&#160;</pre>
</div>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>Let me know in the comments if you found it useful or if you have a more elegant way. If you use it a lot, make a user-defined function taking in the two values. I leave that in your capable hands.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2009/11/26/making-date-and-time-sense-from-the-sql-server-agent-job-history-table/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Silverlight 4 beta and my disappointment with the WebBrowser control</title>
		<link>http://craign.net/2009/11/20/silverlight-4-beta-and-my-disappointment-with-the-webbrowser-control/</link>
		<comments>http://craign.net/2009/11/20/silverlight-4-beta-and-my-disappointment-with-the-webbrowser-control/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 22:16:33 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[beta]]></category>
		<category><![CDATA[opinion]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://craign.net/2009/11/20/silverlight-4-beta-and-my-disappointment-with-the-webbrowser-control/</guid>
		<description><![CDATA[Microsoft has released Silverlight 4 beta at PDC this week. I eagerly fired it up and tried out the new WebBrowser control hoping to find a polished HTML rendering control.]]></description>
			<content:encoded><![CDATA[<p><a title="Silverlight 4" href="http://silverlight.net/getstarted/silverlight-4-beta/" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Silverlight 4 logo by Tim Heuer" border="0" alt="Silverlight 4 logo by Tim Heuer" align="right" src="http://craign.net/wp-content/uploads/2009/11/sl4bloglogo.png" width="200" height="263" /></a> So as most of you probably know by now, Silverlight 4 has been announced and a <a href="http://silverlight.net/getstarted/silverlight-4-beta/" target="_blank">beta</a> is already released, you can head off over <a title="Silverlight 4 Beta – A guide to the new features" href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx" target="_blank">here</a> to find out what’s new and to download the bits you need like Visual Studio 2010 Beta 2, etc. One big warning though, if you have the Silverlight 3 SDK installed on your machine, uninstall it before installing Visual Studio 2010 as it might barf the Visual Studio 2010 installation.</p>
<p>So one of the features I’ve been eagerly awaiting in Silverlight 4 is the new <strong>WebBrowser</strong> control. Yeah as strange as it may seem I want to embed some web content in a Silverlight control. Well not a control as such but more a Silverlight application. And I’ve managed to do it since Silverlight 2 by creating <strong>iframe </strong>elements in the underlying HTML DOM and absolutely positioning them over my Silverlight control, all from within the Silverlight application. This has however one major limitation – you can’t put Silverlight content on top of the HTML <strong>iframe</strong> unless its in a seperate <strong>object</strong> element which doesn’t exactly suit my needs.</p>
<p><a href="http://craign.net/wp-content/uploads/2009/11/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Silverlight 4 WebBrowser doesn&#39;t play nice" border="0" alt="Silverlight 4 WebBrowser doesn&#39;t play nice" align="left" src="http://craign.net/wp-content/uploads/2009/11/image_thumb.png" width="244" height="191" /></a>And it turns out that the Silverlight 4 beta <strong>WebBrowser</strong> control suffers the same horrible fate, as you can see in a screenshot of a quick test application on the left. Except it has another awkwardness to it – it has to be run out of the browser as well. Looks like I’ll be sticking to my <strong>iframe</strong> approach for in the browser and consider using the <strong>WebBrowser</strong> control for out of the browser only.</p>
<p>Now don’t get me wrong, I do like the new control, but I would like it to be even better. If anyone on the Silverlight team reads this, please make the WebBrowser control a proper Silverlight control that can have pure Silverlight controls over it.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2009/11/20/silverlight-4-beta-and-my-disappointment-with-the-webbrowser-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight 3 beta is available</title>
		<link>http://craign.net/2009/03/19/silverlight-3-beta-is-available/</link>
		<comments>http://craign.net/2009/03/19/silverlight-3-beta-is-available/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 14:13:18 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://craign.net/2009/03/19/silverlight-3-beta-is-available/</guid>
		<description><![CDATA[Most of you knew it was coming and I’m really excited that its out now so I can talk about it. Silverlight 3 really is very cool and adds amazing performance improvements and additional features that people have been wanting.]]></description>
			<content:encoded><![CDATA[<p>Most of you knew it was coming and I’m really excited that its out now so I can talk about it. Silverlight 3 really is very cool and adds amazing performance improvements and additional features that people have been wanting.</p>
<p>My personal favourites are:</p>
<ul>
<li>Hardware graphics acceleration – Our application just feels way more zippy than before.</li>
<li>Tighter XAP file compression – Everyone benefits from better ZIP compression ratios.</li>
<li>External styles – Now you can reference an external style. Great for skinning applications.</li>
<li>Out of browser/offline mode – Finally a competitor for the Adobe AIR platform.</li>
</ul>
<p>If you are currently developing using Silverlight 2 I recommend that you install the new Silverlight 3 beta bits in a virtual machine. You can get them all from <a href="http://silverlight.net/GetStarted/silverlight3/default.aspx" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2009/03/19/silverlight-3-beta-is-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC 1.0 Ships</title>
		<link>http://craign.net/2009/03/19/aspnet-mvc-10-ships/</link>
		<comments>http://craign.net/2009/03/19/aspnet-mvc-10-ships/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 10:10:00 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://craign.net/2009/03/19/aspnet-mvc-10-ships/</guid>
		<description><![CDATA[After months of community beta testing the first release build of the ASP.NET MVC (Model View Controller) framework has been released.]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Microsoft .NET logo" border="0" alt="Microsoft .NET logo" align="right" src="http://craign.net/wp-content/uploads/2009/03/image.png" width="262" height="88" /> After months of community beta testing the first release build of the ASP.NET MVC (Model View Controller) framework has been released. If you are a web developer and don’t know what I’m talking about, head on over to the <a title="ASP.NET MVC: The Official Microsoft ASP.NET Site" href="http://www.asp.net/mvc/" target="_blank">ASP.NET MVC</a> site where you can find a wealth of tutorials, videos and oodles of samples to get you started.</p>
<p>What excites me about the ASP.NET MVC framework is that web developers will hopefully be moving away from the legacy forms based approach while sticking with the familiarity of the ASP.NET framework. <a href="http://www.hanselman.com/" target="_blank">Scott Hanselman</a> pointed out at the talk he gave <a href="http://sadeveloper.net/" target="_blank">SA Developer .NET</a> in December 2008 how ASP.NET MVC and ASP.NET WebForms merely build on the rich plumbing framework that is ASP.NET. Most people tend to get confused about that.</p>
<p>You can download the ASP.NET MVC installer from <a href="http://go.microsoft.com/fwlink/?LinkId=144444" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2009/03/19/aspnet-mvc-10-ships/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Microsoft Silverlight 2 released</title>
		<link>http://craign.net/2008/10/14/microsoft-silverlight-2-released/</link>
		<comments>http://craign.net/2008/10/14/microsoft-silverlight-2-released/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 23:04:47 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight 2]]></category>

		<guid isPermaLink="false">http://craign.net/2008/10/14/microsoft-silverlight-2-released/</guid>
		<description><![CDATA[Microsoft has announced the availability of Silverlight 2 and its sooner than we all thought.]]></description>
			<content:encoded><![CDATA[<p>After many months of beta testing Microsoft Silverlight 2 it has been officially announced that it will release today, the 14th of October 2008.</p>
<p>A release build was expected to emerge sometime in November so it seems the team is very confident with the RC0 developer-only build that emerged recently. Unluckily for my team we just released our new product on Friday based on Silverlight 2 beta 2 under the Go-Live license thinking we had at least a month before Silverlight 2 released to fix up compatibility issues. Looks like this week is going to be a busy one for us.</p>
<p>Here is a snippet from the official <a href="http://www.microsoft.com/presspass/press/2008/oct08/10-13Silverlight2PR.mspx" target="_blank">press release</a>:</p>
<blockquote><p>Silverlight 2 will be available for download on Tuesday, Oct. 14, at <a href="http://www.microsoft.com/silverlight">http://www.microsoft.com/silverlight</a>. Customers already using a previous version of Silverlight will be automatically upgraded to Silverlight 2.</p>
</blockquote>
<p>What is awesome though is that Microsoft will soon release an extra set of Open Source controls known as the Silverlight Control Pack including a DockPanel, ViewBox, TreeView, Accordion and AutoComplete control.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/10/14/microsoft-silverlight-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A practical use for filtered indexes</title>
		<link>http://craign.net/2008/08/18/a-practical-use-for-filtered-indexes/</link>
		<comments>http://craign.net/2008/08/18/a-practical-use-for-filtered-indexes/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 19:09:02 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[indexing]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://craign.net/2008/08/18/a-practical-use-for-filtered-indexes/</guid>
		<description><![CDATA[Finally there is a solution to having a unique column with NULL values in it. The answer is using SQL Server 2008 filtered indexes but there is a practical limitation as well.]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to create a table in SQL Server with a nullable column that should be unique as well? I have often needed this and resorted to defining a new table that links to the master table. But <a href="http://www.microsoft.com/sqlserver/2008/" target="_blank">SQL Server 2008</a> has the solution to this, see my example below.</p>
<blockquote><p class="MsoNormal" style="mso-layout-grid-align: none"><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">CREATE</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">TABLE</span> [dbo]<span style="color: gray">.</span>[Person]<span style="color: blue"> </span><span style="color: gray">(          <br /></span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[Id]<span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">INTEGER</span> <span style="color: blue">IDENTITY</span><span style="color: gray">(</span>1<span style="color: gray">,</span>1<span style="color: gray">)</span> <span style="color: blue">PRIMARY</span> <span style="color: blue">KEY</span> <span style="color: blue">CLUSTERED</span><span style="color: gray">,          <br /></span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[FirstName]<span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">NVARCHAR</span><span style="color: gray">(</span>50<span style="color: gray">)</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL,          <br /></span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[LastName]<span style="mso-tab-count: 2">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">NVARCHAR</span><span style="color: gray">(</span>50<span style="color: gray">)</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL,          <br /></span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span>[EmailAddress]<span style="mso-tab-count: 1">&#160;&#160;&#160; </span><span style="color: blue">VARCHAR</span><span style="color: gray">(</span>256<span style="color: gray">)</span> <span style="color: gray">NULL          <br /></span></span><span style="font-size: 10pt; color: gray; font-family: &quot;Courier New&quot;; mso-no-proof: yes">); </span></p>
</p>
</p>
<p class="MsoNormal" style="mso-layout-grid-align: none"><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">ALTER</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">TABLE</span> [dbo]<span style="color: gray">.</span>[Person]         <br /></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">ADD</span> <span style="color: blue">CONSTRAINT</span> [AK_Person_0] <span style="color: blue">UNIQUE</span> <span style="color: blue">NONCLUSTERED </span><span style="color: gray">(</span>[LastName]<span style="color: gray">,</span> [FirstName]<span style="color: gray">);</span></span></p>
</blockquote>
<p>Next consider adding a unique constraint or unique index on the <strong>EmailAddress</strong> column to make sure its unique.</p>
<blockquote><p><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">ALTER</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">TABLE</span> [dbo]<span style="color: gray">.</span>[Person]         <br /></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">ADD</span> <span style="color: blue">CONSTRAINT</span> [AK_Person_1] <span style="color: blue">UNIQUE</span> <span style="color: blue">NONCLUSTERED </span><span style="color: gray">(</span>[EmailAddress]<span style="color: gray">);</span></span><span style="font-size: 10pt; color: gray; font-family: &quot;Courier New&quot;; mso-no-proof: yes"></span></p>
</blockquote>
<p>So far so good, we can now add some test data.</p>
<blockquote><p><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">INSERT</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">INTO</span> [dbo]<span style="color: gray">.</span>[Person] <span style="color: blue">VALUES </span><span style="color: gray">(</span><span style="color: red">N&#8217;Bob&#8217;</span><span style="color: gray">,</span> <span style="color: red">N&#8217;Smith&#8217;</span><span style="color: gray">,</span> <span style="color: red">&#8216;bob@smith.com&#8217;</span><span style="color: gray">);          <br /></span></span><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">INSERT</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">INTO</span> [dbo]<span style="color: gray">.</span>[Person] <span style="color: blue">VALUES </span><span style="color: gray">(</span><span style="color: red">N&#8217;Bob&#8217;</span><span style="color: gray">,</span> <span style="color: red">N&#8217;Jones&#8217;</span><span style="color: gray">,</span> <span style="color: red">&#8216;bob@jones.com&#8217;</span><span style="color: gray">);          <br /></span></span><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">INSERT</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">INTO</span> [dbo]<span style="color: gray">.</span>[Person] <span style="color: blue">VALUES </span><span style="color: gray">(</span><span style="color: red">N&#8217;Mary&#8217;</span><span style="color: gray">,</span> <span style="color: red">N&#8217;Smith&#8217;</span><span style="color: gray">,</span> <span style="color: gray">NULL);</span></span></p>
</blockquote>
<p>Next try insert another person with no email address.</p>
<blockquote><p class="MsoNormal"><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">INSERT</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">INTO</span> [dbo]<span style="color: gray">.</span>[Person] <span style="color: blue">VALUES </span><span style="color: gray">(</span><span style="color: red">N&#8217;Frank&#8217;</span><span style="color: gray">,</span> <span style="color: red">N&#8217;Smith&#8217;</span><span style="color: gray">,</span> <span style="color: gray">NULL);</span></span></p>
</blockquote>
</p>
<p>Whoops, looks like our unique constraint is not going to let us have more than one <strong>NULL</strong> in the table. Which is correct. So how can we fix this, well this is where the new SQL Server 2008 <a title="Filtered Index Design Guidelines" href="http://msdn.microsoft.com/en-us/library/ms188783.aspx" target="_blank">filtered indexes</a> come in. We simply create an index with a <strong>WHERE</strong> clause as follows:</p>
<blockquote><p class="MsoNormal" style="mso-layout-grid-align: none"><span style="font-size: 10pt; color: blue; font-family: &quot;Courier New&quot;; mso-no-proof: yes">CREATE</span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"> <span style="color: blue">UNIQUE</span> <span style="color: blue">NONCLUSTERED</span> <span style="color: blue">INDEX</span> [IX_Person_EmailAddress]         <br /><span style="font-size: 10pt; font-family: &#39;Courier New&#39;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span></span><span style="color: blue">ON</span> [dbo]<span style="color: gray">.</span>[Person]<span style="color: blue"> </span><span style="color: gray">(</span>[EmailAddress]<span style="color: gray">)          <br /></span></span><span style="font-size: 10pt; font-family: &quot;Courier New&quot;; mso-no-proof: yes"><span style="mso-tab-count: 1">&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">WHERE</span> [EmailAddress] <span style="color: gray">IS</span> <span style="color: gray">NOT</span> <span style="color: gray">NULL;</span></span></p>
</blockquote>
<p>And then we can insert our new record without having the problem as we did with the unique constraint.</p>
<p>Unfortunately there is a limitation to how this can be used. A unique index cannot be used in a foreign key constraint. I just wish the SQL Server team would add the WHERE clause, and while they are at it the INCLUDE clause as well, to unique constraints.</p>
</p>
</p>
<p>Thanks to <a title="Gail Shaw - SQL Server MVP" href="http://sqlinthewild.co.za/" target="_blank">Gail</a> for the suggestion.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/08/18/a-practical-use-for-filtered-indexes/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>SQL Server Spatial Tools now available on CodePlex</title>
		<link>http://craign.net/2008/08/08/sql-server-spatial-tools-now-available-on-codeplex/</link>
		<comments>http://craign.net/2008/08/08/sql-server-spatial-tools-now-available-on-codeplex/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 19:20:22 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[spatial]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://craign.net/2008/08/08/sql-server-spatial-tools-now-available-on-codeplex/</guid>
		<description><![CDATA[Isaac Kunen has posted details about the new SQL Server Spatial Tools project on CodePlex containing functions that can be used when working with the new SQL Server 2008 spatial data types.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/sqlserver/2008/" target="_blank"><img src="http://craign.net/wp-content/uploads/2008/08/logoheadersql08dg.gif" align="right" /></a><a href="http://blogs.msdn.com/isaac/" target="_blank">Isaac Kunen</a> has posted details about the new <a href="http://www.codeplex.com/sqlspatialtools" target="_blank">SQL Server Spatial Tools</a> project on CodePlex containing functions that can be used when working with the new SQL Server 2008 spatial data types.</p>
<blockquote><p>The core idea is that instead of pushing up more samples showing how to extend our spatial functionality <a href="http://blogs.msdn.com/isaac/archive/2008/05/30/our-upcoming-builder-api.aspx">in text</a>, we can put them in a more usable form.&#160; Beyond just showing off some samples, though, we&#8217;d like to assemble useful code into a toolkit that provides some real functionality over what we bake into the server.</p>
</blockquote>
</p>
<p>For a list of the goodies that the package contains take a look <a href="http://www.codeplex.com/sqlspatialtools/Wiki/View.aspx?title=Current%20Contents&amp;referringTitle=Home" target="_blank">here</a> and go and download the source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/08/08/sql-server-spatial-tools-now-available-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Time to monetize your gaming creativity</title>
		<link>http://craign.net/2008/07/22/time-to-monetize-your-gaming-creativity/</link>
		<comments>http://craign.net/2008/07/22/time-to-monetize-your-gaming-creativity/#comments</comments>
		<pubDate>Tue, 22 Jul 2008 20:36:06 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[news]]></category>
		<category><![CDATA[Xbox 360]]></category>
		<category><![CDATA[Xbox LIVE Community Games]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://craign.net/2008/07/22/time-to-monetize-your-gaming-creativity/</guid>
		<description><![CDATA[You’ve played Xbox 360 games with the millions of gamers on Xbox LIVE. You’ve chatted, shared, and dominated in games of all kinds. But what if those millions could be playing your game?

Better still – what if you were getting paid for it?]]></description>
			<content:encoded><![CDATA[</p>
<p><a href="http://creators.xna.com/" target="_blank"><img title="XNA Creators Club Online" style="border-right: 0px; border-top: 0px; margin: 0px 0px 10px 10px; border-left: 0px; border-bottom: 0px" height="111" alt="XNA Creators Club Online" src="http://craign.net/wp-content/uploads/2008/07/image6.png" width="316" align="right" border="0" /></a> We all <a title="Xbox LIVE getting XNA games and more" href="http://craign.net/2008/02/20/xbox-live-getting-xna-games-and-more/" target="_blank">knew it was coming</a> and finally its confirmed and coming to an Xbox 360 console near you later this year. Using the free <a href="http://creators.xna.com/en-US/downloads" target="_blank">XNA Game Studio 2.0</a> coupled with Visual C# Express Edition from Microsoft you can now not only design and build your own games to run on Windows and the Xbox 360 gaming console, but now you can share them with the community through the Xbox LIVE network of over 12 million members. I’m assuming the new feature will be delivered with the New Xbox Experience later this year called <a href="http://creators.xna.com/en-us/XboxLIVECommunityGames" target="_blank">Xbox LIVE Community Games</a>.</p>
<blockquote><p>As a Premium member in the XNA Creators Club, you’ll be able to submit any complete Xbox 360 game you’ve created in XNA Game Studio to the Creators Club community at <a href="http://creators.xna.com">http://creators.xna.com</a>, for peer review. Other Premium Creators will check to make sure your game is safe to play. If it is, you’ll set a price point – between 200 and 800 Points – that people will pay to download your game.</p>
<p>Once the game is reviewed and the price point set, you’re done. The game is listed on Xbox LIVE Marketplace, and you’ll get a check every quarter, for up to 70% of the game’s total revenue in your own currency. Depending on your game’s success, you may even have your game advertised on Xbox 360 and other Microsoft online properties.</p>
<p>Just imagine &#8211; your game in the hands of millions of Xbox 360 gamers around the world: that’s the power of Community Games.</p>
</blockquote>
<p><img title="Make games, Make money" style="border-right: 0px; border-top: 0px; margin: 0px 10px 10px 0px; border-left: 0px; border-bottom: 0px" height="155" alt="Make games, Make money" src="http://craign.net/wp-content/uploads/2008/07/image7.png" width="240" align="left" border="0" /> But wait, that isn’t even the best part. You can also put a price tag of between 200 and 800 Microsoft Points on your game and you’ll get a quarterly payment from Microsoft as users buy your game. Well you’ll actually get 40% to 70% of the revenue depending on how its marketed but normally it will be a 70% revenue share. Wicked stuff isn’t it? I think so.</p>
<p>The only big drawback right now is that its only available to XNA Creators Club Premium members in the U.S., Canada, U.K., France, Italy and Spain for now. They plan to add more countries to the list later in the year.</p>
<p>Head on over to the <a href="http://creators.xna.com/" target="_blank">XNA Creators Club site</a> and sign up, <a href="http://creators.xna.com/en-US/downloads" target="_blank">download the tools</a> and while you are at it, enter the <a title="Develop a game and win money" href="http://craign.net/2008/06/13/develop-a-game-and-win-money/" target="_blank">XNA Dream-Build-Play Challenge 2008</a> and win. Thanks Microsoft, this is an awesome idea for the aspiring game developer and a great way to grow the game developer community.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/07/22/time-to-monetize-your-gaming-creativity/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Managed type converters and Blend resolved</title>
		<link>http://craign.net/2008/07/20/managed-type-converters-and-blend-resolved/</link>
		<comments>http://craign.net/2008/07/20/managed-type-converters-and-blend-resolved/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 12:56:33 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[Silverlight 2]]></category>

		<guid isPermaLink="false">http://craign.net/2008/07/20/managed-type-converters-and-blend-resolved/</guid>
		<description><![CDATA[According to feedback on my Microsoft Connect bug, the next build of Microsoft Blend 2.5 should support managed type converters again.]]></description>
			<content:encoded><![CDATA[<p>I previously posted about Blend 2.5 June Preview <a title="Blend doesn’t support managed type converters" href="http://craign.net/2008/06/13/blend-doesnt-support-managed-type-converters/" target="_blank">not supporting managed type converters</a> and I’m pleased to report that the team has resolved it according to the <a title="The TypeConverter for &quot;DataGridLength&quot; does not support converting from a string" href="https://connect.microsoft.com/Expression/feedback/ViewFeedback.aspx?FeedbackID=350446" target="_blank">bug report</a> that I filed.</p>
</p>
</p>
<p>Hopefully we’ll see a new build of Blend 2.5 very soon as I’m quite tired of not being able to size <strong>DataGrid</strong> columns properly. In the meantime I’ve resorted to using the <strong>MinWidth</strong> property, but it isn’t quite the same.</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/07/20/managed-type-converters-and-blend-resolved/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Develop a game and win money</title>
		<link>http://craign.net/2008/06/13/develop-a-game-and-win-money/</link>
		<comments>http://craign.net/2008/06/13/develop-a-game-and-win-money/#comments</comments>
		<pubDate>Fri, 13 Jun 2008 08:18:48 +0000</pubDate>
		<dc:creator>Craig Nicholson</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[competition]]></category>
		<category><![CDATA[Xbox 360]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://craign.net/2008/06/13/develop-a-game-and-win-money/</guid>
		<description><![CDATA[Announcing the worldwide Dream-Build-Play 2008 Challenge where you can win $75000 in prizes for games developed for the Xbox 360 platform.]]></description>
			<content:encoded><![CDATA[<p><a title="Dream-Build-Play 2008 Challenge" href="http://www.dreambuildplay.com/" target="_blank"><img title="image" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="78" alt="image" src="http://craign.net/wp-content/uploads/2008/06/image.png" width="900" border="0" /></a> </p>
<p>The <a href="http://www.dreambuildplay.com/" target="_blank">2008 Microsoft XNA Dream-Build-Play Challenge</a> has begun and its looking like its going to be a really cool competition this year. The best part is that is a worldwide competition so that means even us South Africans can win.</p>
<p>There is a total of $75 000 up for grabs but everyone is a winner as everyone that enters gets a free 12-month XNA Creators Club trial membership.</p>
</p>
</p>
</p>
<p>The goal is to develop a groundbreaking game for the Xbox 360 platform using the free development tools Microsoft Visual C# 2005 Express Edition and Microsoft XNA Game Studio 2.0. To get started I recommend reading up more information on creating games over <a href="http://creators.xna.com/en-us/create_detail#tour_zero" target="_blank">here</a>. Good luck to all!</p>
]]></content:encoded>
			<wfw:commentRss>http://craign.net/2008/06/13/develop-a-game-and-win-money/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

