<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-28468793</id><updated>2012-02-01T13:43:25.557+08:00</updated><category term='logging'/><category term='snippet'/><category term='logger'/><category term='control adaptors'/><category term='singleton'/><category term='quote'/><category term='.NET Framework'/><category term='ankh'/><category term='IDE'/><category term='ankhsvn'/><category term='ASP.NET'/><category term='C#'/><category term='head first'/><category term='regex'/><category term='Code'/><category term='certification'/><category term='tags'/><category term='css'/><category term='analysis'/><category term='visual studio 2005'/><category term='html'/><category term='book review'/><category term='microsoft'/><category term='chance'/><category term='log4net'/><category term='design'/><category term='source control'/><category term='famous'/><category term='subversion'/><category term='.NET'/><title type='text'>Mitch Wheat - Treat the cause, not the symptoms!</title><subtitle type='html'>Software development, .Net, SQL Server, TDD, Agile, Community and other Odds and Sods</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default?start-index=101&amp;max-results=100'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>730</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-28468793.post-1951187079547137702</id><published>2012-02-01T13:43:00.001+08:00</published><updated>2012-02-01T13:43:25.769+08:00</updated><title type='text'>Windows 7 Bins</title><content type='html'>&lt;p&gt;I love it when Scott Hanselman updates his &lt;a href="http://www.hanselman.com/blog/ScottHanselmans2011UltimateDeveloperAndPowerUsersToolListForWindows.aspx"&gt;Ultimate Developer and Power Users Tool List for Windows&lt;/a&gt;. I saw &lt;a href="http://www.1upindustries.com/bins/"&gt;Bins&lt;/a&gt; and immediately went and purchased it ($4.99 PayPal). For each program pinned to the taskbar, you can create a group and put four shortcuts in the space of just one regular pinned icon. You can even choose which is the default click program, or hover to see all the programs in the group.&lt;/p&gt; &lt;p&gt;[The very same author created the very useful (and free) &lt;a href="http://www.stardock.com/products/fences/"&gt;Fences&lt;/a&gt;)]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1951187079547137702?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1951187079547137702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1951187079547137702' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1951187079547137702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1951187079547137702'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/02/windows-7-bins.html' title='Windows 7 Bins'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3897623372790799491</id><published>2012-01-30T18:41:00.001+08:00</published><updated>2012-01-30T18:41:27.622+08:00</updated><title type='text'>97 Things Every Programmer Should Know</title><content type='html'>&lt;p&gt;I happened to be on StackOverflow perusing a few questions (not that I spend much time there, ahem!), and I came across this great &lt;a href="http://stackoverflow.com/questions/194812/list-of-freely-available-programming-books"&gt;List of freely available programming books&lt;/a&gt;, which includes &lt;a href="http://programmer.97things.oreilly.com/"&gt;97 Things Every Programmer Should Know&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A few of my favorites are:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Ask_%22What_Would_the_User_Do%3F%22_%28You_Are_not_the_User%29"&gt;Ask "What Would the User Do?" (You Are not the User)&lt;/a&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Code_Reviews"&gt;Code Reviews&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Comment_Only_What_the_Code_Cannot_Say"&gt;Comment Only What the Code Cannot Say&lt;/a&gt;&amp;nbsp; (I have actually seen a ‘programmer’ write i = i + 1&amp;nbsp; // increment i by 1, no one I currently work with, I hasten to add!)&lt;/li&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Improve_Code_by_Removing_It"&gt;Improve Code by Removing It&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Use_the_Right_Algorithm_and_Data_Structure"&gt;Use the Right Algorithm and Data Structure&lt;/a&gt;&amp;nbsp; (if code has quadratic complexity, it will &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; scale: BubbleSort springs to mind!)&lt;/li&gt; &lt;li&gt;&lt;a href="http://programmer.97things.oreilly.com/wiki/index.php/Write_Code_as_If_You_Had_to_Support_It_for_the_Rest_of_Your_Life"&gt;Write Code as If You Had to Support It for the Rest of Your Life&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3897623372790799491?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3897623372790799491/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3897623372790799491' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3897623372790799491'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3897623372790799491'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/01/97-things-every-programmer-should-know.html' title='97 Things Every Programmer Should Know'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1875893913104821093</id><published>2012-01-19T09:07:00.001+08:00</published><updated>2012-01-19T09:07:39.295+08:00</updated><title type='text'>Perth .NET User Group Meeting, Thurs Feb 2nd, 5:30pm: Visual Studio and Team Foundation Server vNext Preview with Anthony Borton</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, Thurs Feb 2nd 5:30pm, where you’ll see what’s coming up in the next version of Visual Studio and Team Foundation Server. Anthony will demonstrate features from the Developer Preview versions of both Visual Studio and Team Foundation Server and whet your appetite for the Beta releases expected in February. Some of the things you’ll see include the new team explorer, code review workflow, exploratory testing, local workspaces and much, much more.  &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; Visual Studio and Team Foundation Server vNext Preview: Anthony Borton&lt;b&gt;&lt;/b&gt;  &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thurs Feb 2nd, 5:30pm - 7:00pm  &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth  &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Anthony Borton is the lead ALM consultant for Enhance ALM Pty Ltd, an Australian consulting and training company specializing in Application Lifecycle Management and Microsoft Visual Studio. He has been working with Visual Studio Team System full-time since 2005 and has worked with a variety of companies ranging up to some of Australia’s largest companies and financial institutions. Anthony is a sought after trainer and has delivered technical training and consulting in the United States and all across the Asia Pacific region. He is a Microsoft MVP (Visual Studio ALM), a Professional Scrum Developer Trainer and a Microsoft Certified Trainer. Anthony also runs the QLD ALM Users Group and the Canberra ALM Users Group.  &lt;p&gt;In addition to the usual JetBrains license raffle prize, Anthony has arranged to provide everyone that attends our February user group meeting with an invitation code for the preview of Microsoft’s Hosted TFS offering.    &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1875893913104821093?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1875893913104821093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1875893913104821093' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1875893913104821093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1875893913104821093'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/01/perth-net-user-group-meeting-thurs-feb.html' title='Perth .NET User Group Meeting, Thurs Feb 2nd, 5:30pm: Visual Studio and Team Foundation Server vNext Preview with Anthony Borton'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3094476248181070729</id><published>2012-01-16T11:04:00.005+08:00</published><updated>2012-01-16T12:02:16.819+08:00</updated><title type='text'>Windows Azure Training Kit December 2011 Refresh</title><content type='html'>&lt;p&gt;The Windows Azure Training Kit includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use Windows Azure.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;amp;id=8396"&gt;December 2011 refresh of the training kit&lt;/a&gt; includes the following updates:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;33 updated/new PowerPoint presentations&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Hands-On lab] Running a parametric sweep application with the Windows Azure HPC Scheduler&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Hands-On lab] Running SOA Services with the Windows Azure HPC Scheduler&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Hands-On lab] Running MPI Applications with the Windows Azure HPC Scheduler&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Demo] Node.js On Windows Azure&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Demo] Service Bus Relay&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Demo] Service Bus Queues&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Demo] Image Rendering Parametric Sweep Application with the Windows Azure HPC Scheduler&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[New Demo] BLAST Parametric Sweep Application with the Windows Azure HPC Scheduler&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[Renamed Lab] Connecting Applications through Windows Azure Service Bus (formerly Introduction to Service Bus Part 1)&lt;br /&gt;&lt;br /&gt;&lt;li&gt;[Renamed Lab] Windows Azure Service Bus Advanced Configurations (formerly Introduction to Service Bus Part 2)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;To coincide with the new Azure web site, Scott Guthrie's talk is worth watching: &lt;a href="http://channel9.msdn.com/Events/windowsazure/learn/Keynote-Getting-Started-with-Windows-Azure"&gt;Keynote: Getting Started with Windows Azure&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3094476248181070729?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3094476248181070729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3094476248181070729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3094476248181070729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3094476248181070729'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/01/windows-azure-training-kit-december.html' title='Windows Azure Training Kit December 2011 Refresh'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8609097605839734283</id><published>2012-01-08T11:36:00.001+08:00</published><updated>2012-01-08T11:36:16.012+08:00</updated><title type='text'>Non-Uniform Distribution from a Uniform Distribution</title><content type='html'>&lt;p&gt;Given a uniformly distributed random variable x (such as the output from a standard Random Number Generator), how do we generate some other non-uniform distribution, q(y)?  &lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Generate x, and take y = f(x). But how do we calculate f() given q() ?  &lt;p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-YWEC0STOSeM/TwkPEpvSG1I/AAAAAAAAAPk/S_quFlO8ZY4/s1600-h/clip_image00143.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The required function is the inverse cumulative distribution function given by:  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-SJNehelkwzw/TwkPFasuFjI/AAAAAAAAAPo/savfn7FIMDU/s1600-h/clip_image00262.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image002[6]" border="0" alt="clip_image002[6]" src="http://lh4.ggpht.com/-RjfKTJAgmf4/TwkPGBpG7cI/AAAAAAAAAP0/873HnIbfhig/clip_image0026_thumb.png?imgmax=800" width="181" height="43"&gt;&lt;/a&gt;  &lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;: Exponential distribution (to simulate the lifetimes of radioactive nuclei)  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-bstDi6Z3qP8/TwkPHP9cEdI/AAAAAAAAAP4/dZ4CKPqjiZg/s1600-h/clip_image00342.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image003[4]" border="0" alt="clip_image003[4]" src="http://lh6.ggpht.com/-U3xg_zeOdMU/TwkPH1iFauI/AAAAAAAAAQE/BpqvOfNPDsg/clip_image0034_thumb.png?imgmax=800" width="175" height="33"&gt;&lt;/a&gt;, (τ≥0,and = 0 otherwise)  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-CBjMYModpKA/TwkPI409mDI/AAAAAAAAAQI/7XcVPk9YvvM/s1600-h/clip_image00462.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image004[6]" border="0" alt="clip_image004[6]" src="http://lh4.ggpht.com/-4NLObMdnvzQ/TwkPJp2ocpI/AAAAAAAAAQQ/1dcrKG9C8A8/clip_image0046_thumb.png?imgmax=800" width="244" height="29"&gt;&lt;/a&gt;  &lt;p&gt;So inverse is  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-rYCSJdwxzEg/TwkPKRFZj0I/AAAAAAAAAQY/q18MckiGVK4/s1600-h/clip_image00152.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="clip_image001[5]" border="0" alt="clip_image001[5]" src="http://lh4.ggpht.com/-qlnK679bK0c/TwkPLXoJ8bI/AAAAAAAAAQk/ORAJshp8QfI/clip_image0015_thumb.png?imgmax=800" width="230" height="22"&gt;&lt;/a&gt;  &lt;p&gt;Ref.&lt;/p&gt; &lt;p&gt;&lt;a title="http://en.wikipedia.org/wiki/Cumulative_distribution_function" href="http://en.wikipedia.org/wiki/Cumulative_distribution_function"&gt;http://en.wikipedia.org/wiki/Cumulative_distribution_function&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="http://en.wikipedia.org/wiki/Inverse_transform_sampling" href="http://en.wikipedia.org/wiki/Inverse_transform_sampling"&gt;http://en.wikipedia.org/wiki/Inverse_transform_sampling&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8609097605839734283?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8609097605839734283/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8609097605839734283' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8609097605839734283'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8609097605839734283'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/01/non-uniform-distribution-from-uniform.html' title='Non-Uniform Distribution from a Uniform Distribution'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/-RjfKTJAgmf4/TwkPGBpG7cI/AAAAAAAAAP0/873HnIbfhig/s72-c/clip_image0026_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6059811593821877480</id><published>2012-01-07T14:46:00.001+08:00</published><updated>2012-01-07T14:46:44.458+08:00</updated><title type='text'>Windows 7: Reclaiming Drive Space</title><content type='html'>&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;Everything that follows is performed at your own risk.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;If, like me and may others, you installed Windows 7 Service Pack 1 over Windows 7 vanilla, you probably have quite a bit of wasted space on your primary drive (around 1GB). This is obviously not desirable if you have a relatively small SSD as your primary OS drive.&lt;/p&gt; &lt;p&gt;Given that it is extremely unlikely that anyone would ever remove Service Pack 1 and go back to vanilla, you can quite easily reclaim this space &lt;font size="3"&gt;(&lt;strong&gt;Note&lt;/strong&gt;: you will no longer be able to uninstall Windows 7 Service Pack 1):&lt;/font&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Open an elevated command prompt (i.e. Run as administrator).&lt;/li&gt; &lt;li&gt;Run this command:&amp;nbsp; &lt;font face="Courier New"&gt;&lt;strong&gt;dism /online /cleanup-image /spsuperceded /hidesp&lt;/strong&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6059811593821877480?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6059811593821877480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6059811593821877480' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6059811593821877480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6059811593821877480'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2012/01/windows-7-reclaiming-drive-space.html' title='Windows 7: Reclaiming Drive Space'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6225170342146139014</id><published>2011-12-19T15:03:00.001+08:00</published><updated>2011-12-19T15:03:55.377+08:00</updated><title type='text'>2009, 2011 Mahler Lectures</title><content type='html'>&lt;p&gt;For anyone interested in mathematics/science, the Mahler lectures for 2009 and 2011 are now available as pdf’s.&lt;/p&gt; &lt;p&gt;They vary in complexity, but most have a wide audience such as Terence Tao’s &lt;a href="http://terrytao.files.wordpress.com/2009/09/cosmic-distance-ladder1.pdf"&gt;“The Cosmic Distance Ladder”&lt;/a&gt;, which I attended in person when held at UWA.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6225170342146139014?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6225170342146139014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6225170342146139014' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6225170342146139014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6225170342146139014'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/12/2009-2011-mahler-lectures.html' title='2009, 2011 Mahler Lectures'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-479821888269670608</id><published>2011-12-02T08:19:00.001+08:00</published><updated>2011-12-02T08:19:34.957+08:00</updated><title type='text'>DevJam 2011</title><content type='html'>&lt;p&gt;A big thank you to all of the presenters at this year’s DevJam event. It is great to see so many local developers willing to give up their time to present a talk. It was a great turnout: 51 people attended last night’s event, and I counted 5 regular attendees who couldn’t make it.  &lt;p&gt;It was a great line-up of topics with a nice mixture of content. Every talk received audience votes, but we have to have some winners in order to give out the prizes! The audience voted favourite talks (in order) were: &lt;ol&gt; &lt;li&gt;Mike Minutillo - Crankpad  &lt;li&gt;Piers Williams - Kinect SDK &lt;li&gt;Jake Ginnivan - Real World MVVM&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Thank you to all the sponsors who help make these events possible: Microsoft for the venue, pizza and refreshments, and major prize funding through UGSS, Pluralsight, Scooter Software, JetBrains, Joe Albahari, RedGate, TekPub. Special thanks to Andrew Coates and Roseanne Stamell for their invaluable support. &lt;p&gt;Thank you to everyone who attended DevJam and regular meetings throughout the year, and thank you to all the talk presenters, who make running a user group possible. &lt;p&gt;[If you are interested in running one of these events at your User Group, I put together some notes here: &lt;a href="http://mitch-wheat.blogspot.com/2009/05/running-devjam-format-community-event.html"&gt;Running a DevJam Community Event&lt;/a&gt;]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-479821888269670608?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/479821888269670608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=479821888269670608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/479821888269670608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/479821888269670608'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/12/devjam-2011.html' title='DevJam 2011'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-9023579476580448624</id><published>2011-11-29T21:11:00.001+08:00</published><updated>2011-11-29T21:11:50.642+08:00</updated><title type='text'>December DevJam – Talk Lineup</title><content type='html'>&lt;p&gt;Subject to any last minute changes, here is the line-up of talks for Thursday’s DevJam event : &lt;ul&gt; &lt;li&gt;Doug Paice - Using Reactive Extensions and Caliburn.Micro to simplify event chaining in WPF&lt;/li&gt; &lt;li&gt;Jake Ginnivan - Real World MVVM&lt;/li&gt; &lt;li&gt;Michael Minutillo – Crankpad&lt;/li&gt; &lt;li&gt;Alistair Waddell - Compare and Synchronize your Database with VS2010&lt;/li&gt; &lt;li&gt;Piers Williams - Kinect SDK&lt;/li&gt; &lt;li&gt;Adrian McGrath - Testing Async&lt;/li&gt; &lt;li&gt;Ben Leane - SP2010 Client Object Model&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;It’s happening at our usual venue: &lt;ul&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Thursday, Dec 1st, 5:30pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you are attending, please sign up at EventBrite (&lt;a href="http://www.eventbrite.com/event/2402588206"&gt;http://www.eventbrite.com/event/2402588206&lt;/a&gt;) so I can get an idea of catering numbers.  &lt;p&gt;If you have any questions, please send me an email. &lt;p&gt;&lt;a href="http://perthdotnet.org/blogs/events/archive/2011/10/22/december-devjam-2011.aspx"&gt;http://perthdotnet.org/blogs/events/archive/2011/10/22/december-devjam-2011.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-9023579476580448624?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/9023579476580448624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=9023579476580448624' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/9023579476580448624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/9023579476580448624'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/11/december-devjam-talk-lineup.html' title='December DevJam – Talk Lineup'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1996354959208883041</id><published>2011-11-15T09:05:00.001+08:00</published><updated>2011-11-15T09:05:44.649+08:00</updated><title type='text'>December DevJam 2011</title><content type='html'>&lt;p&gt;For December's meeting of the Perth .NET User Group (Thurs, 1st Dec), we are running another DevJam style community event, where local developers give a short talks about something .NET software development related. &lt;ul&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Thursday, Dec 1st, 5:30pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;&lt;/b&gt; &lt;p&gt;There are still several talk slots available. For presenter entry details see here: &lt;a href="http://perthdotnet.org/blogs/events/archive/2011/10/22/december-devjam-2011.aspx"&gt;http://perthdotnet.org/blogs/events/archive/2011/10/22/december-devjam-2011.aspx&lt;/a&gt; &lt;p&gt;The prize for the best audience voted talk is an &lt;b&gt;Xbox 360 with Kinect&lt;/b&gt;. There will also be a door prize of an Xbox 360 with Kinect! &lt;p&gt;There will be pizza and refreshments provided. Please sign up at EventBrite (&lt;a href="http://www.eventbrite.com/event/2402588206"&gt;http://www.eventbrite.com/event/2402588206&lt;/a&gt;) so I can get an idea of catering numbers. If you have any questions, please send me an email.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1996354959208883041?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1996354959208883041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1996354959208883041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1996354959208883041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1996354959208883041'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/11/for-decembers-meeting-of-perth.html' title='December DevJam 2011'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2891618572392894320</id><published>2011-10-23T13:55:00.001+08:00</published><updated>2011-10-23T13:55:21.911+08:00</updated><title type='text'>Perth .NET User Group Meeting, Thurs Nov 3rd, 5:30pm: Hosting in Azure - without the blues: Joe Albahari</title><content type='html'>&lt;p&gt;Had enough of your data centre or web hosting company?  &lt;p&gt;Join us at the Perth .NET user group, Thurs Nov 3rd 5:30pm, and find out how to move your MVC or Web Forms apps into the cloud and enjoy high availability, security and scalability - without the responsibility of OS installation, updates or security. This session will be full of practical advice and lessons learned from Joe’s own experience migrating two web sites and a licensing server into Azure, all of which now run inexpensively on a redundant pair of extra small instances. &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Hosting in Azure - without the blues: Joe Albahari &lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Thurs Nov 3rd, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Joe Albahari is a C# MVP and author of ‘C# 4.0 in a Nutshell’ and LINQPad. He has presented at TechEd and JAOO and is a regular speaker at the Perth .NET User Group. &lt;p&gt;More details here: &lt;a href="http://perthdotnet.org/blogs/events/archive/2011/10/16/hosting-in-azure-without-the-blues-joe-albahari.aspx"&gt;http://perthdotnet.org/blogs/events/archive/2011/10/16/hosting-in-azure-without-the-blues-joe-albahari.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2891618572392894320?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2891618572392894320/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2891618572392894320' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2891618572392894320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2891618572392894320'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/perth-net-user-group-meeting-thurs-nov.html' title='Perth .NET User Group Meeting, Thurs Nov 3rd, 5:30pm: Hosting in Azure - without the blues: Joe Albahari'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4120396588635607318</id><published>2011-10-17T08:37:00.001+08:00</published><updated>2011-10-17T08:37:12.287+08:00</updated><title type='text'>Perth .NET User Group Meeting, Weds 19th Oct, 5:30pm: Amazon Web Services (AWS) in Action with Andy Marks</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, Weds Oct 19th 5:30pm, where Andy Marks will introduce the philosophy and principles behind AWS and briefly describe some of the key components around storage and compute capabilities. The session will include a short hands-on activity for participants to build and deploy their own cloud-based application.  &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Amazon Web Services (AWS) in Action with Andy Marks&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Wednesday, Oct 19th, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Andy serves ThoughtWorks principally as the Perth and Melbourne Technical Lead in the design and implementation of enterprise applications. He also has considerable experience in coaching and mentoring development teams adopting Agile practices.  &lt;p&gt;&lt;strong&gt;Optional Requirements:&lt;/strong&gt; Laptop with internet connectivity (for the hands on section of the talk).    &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4120396588635607318?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4120396588635607318/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4120396588635607318' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4120396588635607318'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4120396588635607318'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/perth-net-user-group-meeting-weds-19th.html' title='Perth .NET User Group Meeting, Weds 19th Oct, 5:30pm: Amazon Web Services (AWS) in Action with Andy Marks'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5559648559388660653</id><published>2011-10-10T19:04:00.001+08:00</published><updated>2011-10-10T19:06:55.858+08:00</updated><title type='text'>Free Flights?</title><content type='html'>&lt;p&gt;Japan is offering &lt;a href="http://www.abc.net.au/news/2011-10-10/japan-offering-free-trips-to-foreigners/3459548"&gt;free flights to boost tourism&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Here’s a wild idea: Maybe they should STOP slaughtering whales and pretending it’s science (which no one believes by the way).&lt;/p&gt; &lt;p&gt;Imagine how much goodwill that would generate.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5559648559388660653?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5559648559388660653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5559648559388660653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5559648559388660653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5559648559388660653'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/free-flights.html' title='Free Flights?'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8760716428980831238</id><published>2011-10-03T08:20:00.001+08:00</published><updated>2011-10-03T08:20:23.761+08:00</updated><title type='text'>Perth .NET User Group Meeting, Thurs 6th Oct: C#/Mono with Ben Last</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, Thurs Oct 6th 5:30pm, where Ben Last will discuss a real world application using C# and Mono. nearmap.com make heavy use of C#, but in a very non-Windows environment. Plenty of people have played with mono as a .NET platform, but there are not that many who have used it in a large-scale, high-traffic, n-tier environment. Hear our story, and find out if mono delivers what it promises.  &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; &lt;b&gt;C#/Mono with Ben Last&lt;/b&gt;  &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, Oct 6th, 5:30pm - 7:00pm  &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth  &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Ben is a Software Engineer and Architect with more than twenty years' experience in the design and implementation of large-scale software systems. He joined NearMap in April 2009 and is the Development Manager for HyperWeb, which delivers very high volumes of image data via the nearmap.com website and over the Internet. Before joining NearMap, Ben was R&amp;amp;D Manager at EMCC Software in the UK, leading product development teams for mobile enterprise and consumer applications and consulting on mobile and networked software development.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8760716428980831238?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8760716428980831238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8760716428980831238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8760716428980831238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8760716428980831238'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/perth-net-user-group-meeting-thurs-6th.html' title='Perth .NET User Group Meeting, Thurs 6th Oct: C#/Mono with Ben Last'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-835829877999856267</id><published>2011-10-02T13:42:00.001+08:00</published><updated>2011-10-02T13:42:22.559+08:00</updated><title type='text'>TSQL: An Efficient Dynamic Numbers Table</title><content type='html'>&lt;p&gt;A numbers table is simply a table containing sequential integer values. The size of the required table will vary depending upon its use, but it is not uncommon to find permanent tables containing 1,000,000 rows. A numbers (or tally) table forms the basis of solving problems in a set-based way, and is a powerful technique for finding gaps in sequences, string manipulation (which if done purely with TSQL’s built-in functions can run very slowly), etc. It is also often used in the form of a date table, enabling some very efficient set based join constructs to be used on date range calculations. &lt;/p&gt; &lt;p&gt;While it is usual to create a fixed table in the database, there is the occasional need for a dynamic version. There are several ways not to do this! Such as the recursive CTE or a while loop inserting values one after another. A better option is the CROSS join against system tables method, and better still is Itzik’s often cited, cross joined CTE method:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;font color="#008000"&gt;--===== Itzik's &lt;span class="kwrd"&gt;CROSS&lt;/span&gt; JOINED CTE method&lt;/font&gt; &lt;br /&gt; &lt;span class="kwrd"&gt;WITH&lt;/span&gt; E00(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;UNION&lt;/span&gt; &lt;span class="kwrd"&gt;ALL&lt;/span&gt; &lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1), &lt;br /&gt;      E02(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E00 a, E00 b), &lt;br /&gt;      E04(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E02 a, E02 b), &lt;br /&gt;      E08(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E04 a, E04 b), &lt;br /&gt;      E16(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E08 a, E08 b), &lt;br /&gt;      E32(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; 1 &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E16 a, E16 b), &lt;br /&gt;   cteTally(N) &lt;span class="kwrd"&gt;AS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; ROW_NUMBER() &lt;span class="kwrd"&gt;OVER&lt;/span&gt; (&lt;span class="kwrd"&gt;ORDER&lt;/span&gt; &lt;span class="kwrd"&gt;BY&lt;/span&gt; N) &lt;span class="kwrd"&gt;FROM&lt;/span&gt; E32) &lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; N &lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; cteTally &lt;br /&gt;&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; N &amp;lt;= 1000000; &lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;/font&gt; &lt;/pre&gt;&lt;br /&gt;&lt;p&gt;After a little experimentation, I found that reducing the number of cross joins by increasing the size of the first table results in a more efficient query plan. I wrapped this up in an inline table valued function with the option of a start and end value for the sequence:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;IF&lt;/span&gt; OBJECT_ID (N&lt;span class="str"&gt;'dbo.tvf_DynamicNumbersTable'&lt;/span&gt;) &lt;span class="kwrd"&gt;IS&lt;/span&gt; &lt;span class="kwrd"&gt;NOT&lt;/span&gt; &lt;span class="kwrd"&gt;NULL&lt;/span&gt;&lt;br /&gt;   &lt;span class="kwrd"&gt;DROP&lt;/span&gt; &lt;span class="kwrd"&gt;FUNCTION&lt;/span&gt; dbo.tvf_DynamicNumbersTable&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;CREATE&lt;/span&gt; &lt;span class="kwrd"&gt;function&lt;/span&gt; dbo.tvf_DynamicNumbersTable&lt;br /&gt;(&lt;br /&gt;    @pStartValue &lt;span class="kwrd"&gt;int&lt;/span&gt; = 1,&lt;br /&gt;    @pEndValue   &lt;span class="kwrd"&gt;int&lt;/span&gt; = 1000000&lt;br /&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;returns&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;as&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;return&lt;/span&gt;&lt;br /&gt;(&lt;br /&gt;    &lt;span class="kwrd"&gt;with&lt;/span&gt; rows16(N) &lt;span class="kwrd"&gt;as&lt;/span&gt; &lt;br /&gt;    (&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;span class="kwrd"&gt;union&lt;/span&gt; &lt;span class="kwrd"&gt;all&lt;/span&gt;&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; 1 &lt;br /&gt;    ),&lt;br /&gt;    rows256(N) &lt;span class="kwrd"&gt;as&lt;/span&gt; &lt;br /&gt;    (&lt;br /&gt;        &lt;span class="kwrd"&gt;select &lt;/span&gt;t1.N &lt;span class="kwrd"&gt;from &lt;/span&gt;rows16 t1 &lt;span class="kwrd"&gt;cross&lt;/span&gt; &lt;span class="kwrd"&gt;join&lt;/span&gt; rows16 t2&lt;br /&gt;    ),&lt;br /&gt;    rows65536(N) &lt;span class="kwrd"&gt;as&lt;/span&gt; &lt;br /&gt;    (&lt;br /&gt;        &lt;span class="kwrd"&gt;select &lt;/span&gt;t1.N &lt;span class="kwrd"&gt;from &lt;/span&gt;rows256 t1 &lt;span class="kwrd"&gt;cross&lt;/span&gt; &lt;span class="kwrd"&gt;join&lt;/span&gt; rows256 t2&lt;br /&gt;    ),&lt;br /&gt;    rows2pow32(N) &lt;span class="kwrd"&gt;as&lt;/span&gt; &lt;br /&gt;    (&lt;br /&gt;        &lt;span class="kwrd"&gt;select&lt;/span&gt; t1.N &lt;span class="kwrd"&gt;from&lt;/span&gt; rows65536 t1 &lt;span class="kwrd"&gt;cross&lt;/span&gt; &lt;span class="kwrd"&gt;join&lt;/span&gt; rows65536 t2&lt;br /&gt;    ),&lt;br /&gt;    Numbers(N) &lt;span class="kwrd"&gt;as&lt;/span&gt;&lt;br /&gt;    (&lt;br /&gt;        &lt;span class="kwrd"&gt;select &lt;/span&gt;row_number() &lt;span class="kwrd"&gt;over&lt;/span&gt; (&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; N) &lt;span class="kwrd"&gt;as&lt;/span&gt; N &lt;span class="kwrd"&gt;from &lt;/span&gt;rows2pow32 t1&lt;br /&gt;    )&lt;br /&gt;    &lt;span class="kwrd"&gt;select&lt;/span&gt; N &lt;span class="kwrd"&gt;from &lt;/span&gt;Numbers&lt;br /&gt;    &lt;span class="kwrd"&gt;where&lt;/span&gt; N &lt;span class="kwrd"&gt;between&lt;/span&gt; @pStartValue &lt;span class="kwrd"&gt;AND&lt;/span&gt; @pEndValue&lt;br /&gt;);&lt;/font&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-835829877999856267?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/835829877999856267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=835829877999856267' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/835829877999856267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/835829877999856267'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/tsql-efficient-dynamic-numbers-table.html' title='TSQL: An Efficient Dynamic Numbers Table'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5871140468493646778</id><published>2011-10-01T09:39:00.001+08:00</published><updated>2011-10-01T18:23:56.007+08:00</updated><title type='text'>Windows 7: Fast and Flexible File Copy with RoboCopy</title><content type='html'>&lt;p&gt;Did you know that RoboCopy is included with all editions of Windows 7? I didn’t until very recently, when a colleague (&lt;a href="http://codermike.com/"&gt;Mike Minutillo&lt;/a&gt;) mentioned it.&lt;/p&gt; &lt;p&gt;Robocopy (short for Robust File Copy) can do so much more than the standard Copy and Xcopy commands.&lt;/p&gt; &lt;p&gt;The basic syntax is as follows:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;font size="2" face="Courier New"&gt;robocopy source destination [file [file]...] [options]&lt;/font&gt; &lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;strong&gt;&lt;/strong&gt; &lt;p&gt;The source and destination parameters are specified as &lt;font face="Courier New"&gt;drive:\path&lt;/font&gt; or &lt;font face="Courier New"&gt;\\server\share\path&lt;/font&gt;. The file parameter can contain one or more literal file names, or it can use &lt;strong&gt;?&lt;/strong&gt; and &lt;strong&gt;*&lt;/strong&gt; wildcards. &lt;/p&gt; &lt;p&gt;For instance, this command copies the contents of one folder and all its subfolders from a local drive E to a shared folder:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;&lt;font face="Courier New"&gt;robocopy "E:\test" \\server\public\test\ /MIR /W:30 /R:10 /MT:8 /LOG:\\server\public\logs&lt;/font&gt; &lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The /MIR switch mirrors the two folders, copying all folders (even empty ones) from the source directory and removing folders from the destination if they no longer exist on the source. The /W and /R switches set the wait and retry options; in this case, Robocopy will retry each copy up to 10 times, waiting 30 seconds between attempts. The &lt;strong&gt;/MT[:n]&lt;/strong&gt; switch performs a multi-threaded copy, where n indicates the number of threads to be used (n is 8, by default) and can range from 1 to 128. The &lt;strong&gt;/LOG: &lt;/strong&gt;switch logs output to the specified location.&lt;/p&gt; &lt;p&gt;To see the full list of options, type &lt;strong&gt;robocopy /?&lt;/strong&gt; at a command prompt.  &lt;p&gt;There’s even a &lt;a href="http://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx"&gt;GUI&lt;/a&gt;!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5871140468493646778?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5871140468493646778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5871140468493646778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5871140468493646778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5871140468493646778'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/10/windows-7-fast-and-flexible-file-copy.html' title='Windows 7: Fast and Flexible File Copy with RoboCopy'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7525235981967941844</id><published>2011-09-15T08:03:00.001+08:00</published><updated>2011-09-15T08:03:51.799+08:00</updated><title type='text'>TSQL: Generate Missing Foreign Key Indexes</title><content type='html'>&lt;p&gt;It’s good practice to ensure all foreign key columns are indexed (I’ve often wondered why SQL Server Management Studio doesn’t have a built-in option to perform this). I can’t remember where I saw this code originally (despite trying to search for a reference to it), but it is a useful addition to a TSQL code snippet toolbox:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Create non-clustered indexes for all foreign keys in the current database&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;--&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @&lt;span class="kwrd"&gt;sql&lt;/span&gt; varchar(4000)&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;CREATE&lt;/span&gt; &lt;span class="kwrd"&gt;TABLE&lt;/span&gt; #sqlfkindexes&lt;br /&gt;(&lt;br /&gt;   id &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;not&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt; &lt;span class="kwrd"&gt;identity&lt;/span&gt;(1,1),&lt;br /&gt;   &lt;span class="kwrd"&gt;sql&lt;/span&gt; varchar(4000) &lt;span class="kwrd"&gt;not&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;&lt;br /&gt;)&lt;br /&gt;&lt;br /&gt;INSERT &lt;span class="kwrd"&gt;INTO&lt;/span&gt; #sqlfkindexes&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; &lt;span class="str"&gt;'CREATE NONCLUSTERED INDEX [NC_'&lt;/span&gt; + tablename + &lt;span class="str"&gt;'_'&lt;/span&gt; + columnname +&lt;span class="str"&gt;'] ON ['&lt;/span&gt; + &lt;br /&gt;       schemaname + &lt;span class="str"&gt;'].['&lt;/span&gt; + tablename + &lt;span class="str"&gt;'] (['&lt;/span&gt; + columnname + &lt;span class="str"&gt;']);'&lt;/span&gt; &lt;span class="kwrd"&gt;as&lt;/span&gt; [&lt;span class="kwrd"&gt;sql&lt;/span&gt;]&lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;br /&gt;(    &lt;br /&gt;    &lt;span class="rem"&gt;-- All foreign key columns&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;SELECT&lt;/span&gt;        &lt;br /&gt;       o.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; tablename, &lt;br /&gt;       col.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; columnName, &lt;br /&gt;       sch.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; schemaname&lt;br /&gt;    &lt;span class="kwrd"&gt;FROM&lt;/span&gt;&lt;br /&gt;       sys.foreign_key_columns fkc        &lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.objects o &lt;span class="kwrd"&gt;ON&lt;/span&gt; fkc.parent_object_id = o.object_id        &lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.columns col &lt;span class="kwrd"&gt;ON&lt;/span&gt; col.object_id = o.object_id &lt;span class="kwrd"&gt;and&lt;/span&gt; fkc.parent_column_id = col.column_id    &lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.schemas sch &lt;span class="kwrd"&gt;ON&lt;/span&gt; sch.schema_id = o.schema_id&lt;br /&gt;      &lt;br /&gt;    &lt;span class="kwrd"&gt;EXCEPT&lt;/span&gt;  &lt;br /&gt;    &lt;br /&gt;    &lt;span class="rem"&gt;-- All the already indexed columns&lt;/span&gt;&lt;br /&gt;    &lt;span class="kwrd"&gt;SELECT&lt;/span&gt; &lt;br /&gt;       o.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; tablename,&lt;br /&gt;       col.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; columnName, &lt;br /&gt;       sch.name &lt;span class="kwrd"&gt;AS&lt;/span&gt; schemaname&lt;br /&gt;    &lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;br /&gt;       sys.index_columns ixc       &lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.objects o &lt;span class="kwrd"&gt;ON&lt;/span&gt; ixc.object_Id = o.object_id         &lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.columns col &lt;span class="kwrd"&gt;ON&lt;/span&gt; col.object_id = o.object_id &lt;span class="kwrd"&gt;and&lt;/span&gt; ixc.column_id = col.column_id&lt;br /&gt;       &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.schemas sch &lt;span class="kwrd"&gt;ON&lt;/span&gt; sch.schema_id = o.schema_id&lt;br /&gt;) FK&lt;br /&gt;&lt;span class="kwrd"&gt;ORDER&lt;/span&gt; &lt;span class="kwrd"&gt;BY&lt;/span&gt;  &lt;br /&gt;   schemaname,&lt;br /&gt;   tablename,  &lt;br /&gt;   columnname&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @&lt;span class="kwrd"&gt;count&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; @&lt;span class="kwrd"&gt;count&lt;/span&gt; = &lt;span class="kwrd"&gt;COUNT&lt;/span&gt;(*) &lt;span class="kwrd"&gt;FROM&lt;/span&gt; #sqlfkindexes&lt;br /&gt;&lt;span class="kwrd"&gt;WHILE&lt;/span&gt; @&lt;span class="kwrd"&gt;count&lt;/span&gt; &amp;gt; 0&lt;br /&gt;&lt;span class="kwrd"&gt;BEGIN&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;SELECT&lt;/span&gt; @&lt;span class="kwrd"&gt;sql&lt;/span&gt; = [&lt;span class="kwrd"&gt;sql&lt;/span&gt;] &lt;span class="kwrd"&gt;from&lt;/span&gt; #sqlfkindexes &lt;span class="kwrd"&gt;where&lt;/span&gt; [id] = @&lt;span class="kwrd"&gt;count&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;SET&lt;/span&gt; @&lt;span class="kwrd"&gt;count&lt;/span&gt; = @&lt;span class="kwrd"&gt;count&lt;/span&gt; - 1&lt;br /&gt;      &lt;span class="kwrd"&gt;PRINT&lt;/span&gt; @&lt;span class="kwrd"&gt;sql&lt;/span&gt;&lt;br /&gt;      &lt;span class="rem"&gt;-- Uncomment to execute directly&lt;/span&gt;&lt;br /&gt;      &lt;span class="rem"&gt;-- EXEC sp_executesql @sql&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;drop&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt; #sqlfkindexes&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;As is, this script prints out the missing index definitions but does not run them into the database. Simply copy and paste into another SSMS query window and run. (You could also uncomment the execute line, but I prefer to check them before running in).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7525235981967941844?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7525235981967941844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7525235981967941844' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7525235981967941844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7525235981967941844'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/09/tsql-generate-missing-foreign-key.html' title='TSQL: Generate Missing Foreign Key Indexes'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2937614180942031302</id><published>2011-08-27T13:20:00.001+08:00</published><updated>2011-08-27T13:20:19.685+08:00</updated><title type='text'>LINQPad: Async Functions Interactive Tutorial</title><content type='html'>&lt;p&gt;Joe Albahari has recently released an interactive tutorial on C# asynchronous functions.&amp;nbsp; It's shipped as a LINQPad sample library. Download &lt;a href="http://www.linqpad.net/beta.aspx"&gt;the latest LINQPad beta&lt;/a&gt;, then go to 'Samples' on the bottom left, click 'Download more samples' and choose the async functions tutorial.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2937614180942031302?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2937614180942031302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2937614180942031302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2937614180942031302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2937614180942031302'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/linqpad-async-functions-interactive.html' title='LINQPad: Async Functions Interactive Tutorial'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4564910160540913888</id><published>2011-08-16T08:55:00.001+08:00</published><updated>2011-08-16T08:55:19.423+08:00</updated><title type='text'>Visual Studio Lightswitch</title><content type='html'>&lt;p&gt;The latest issue of MSDN magazine has a short but interesting article “&lt;a href="http://msdn.microsoft.com/en-us/magazine/hh335061.aspx"&gt;Advanced Programming Made Easy With Visual Studio Lightswitch&lt;/a&gt;” from &lt;a href="http://www.bethmassi.com/"&gt;Beth Massi&lt;/a&gt;. You can download the development sample from &lt;a href="http://code.msdn.microsoft.com/Contoso-Construction-9f944948"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4564910160540913888?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4564910160540913888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4564910160540913888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4564910160540913888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4564910160540913888'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/visual-studio-lightswitch.html' title='Visual Studio Lightswitch'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-428709274026322824</id><published>2011-08-07T17:20:00.001+08:00</published><updated>2011-08-08T09:00:38.159+08:00</updated><title type='text'>T-SQL: Generating Random Numbers, Random Sampling and Random ‘Goodness’</title><content type='html'>&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; I will use the word ‘random’ throughout to mean ‘pseudo-random’. If you want truly random numbers then you need to sample a physical source of noise, i.e. you need one of these devices: &lt;a title="http://www.idquantique.com/true-random-number-generator/products-overview.html" href="http://www.idquantique.com/true-random-number-generator/products-overview.html"&gt;&lt;strong&gt;http://www.idquantique.com/true-random-number-generator/products-overview.html&lt;/strong&gt;&lt;/a&gt; !&lt;/p&gt; &lt;p&gt;If you are working with large volumes of data, it’s a common requirement to select a smaller, random sample of that data. There are several techniques to do this using TSQL; we will examine several, and perform a statistical evaluation of the distribution of the samples that each technique produces.&lt;/p&gt; &lt;p&gt;There are two common scenarios. Consider a data warehouse that contains hundreds (or thousands) of millions of rows. Working with the entire dataset to perform statistical analysis or data mining can be very time-consuming.&amp;nbsp; Instead, analysts often select a smaller, random sample of records to build a model or draw conclusions, and then test these predictions against the full population.  &lt;p&gt;Alternatively, analysts could use a BI tool (such as OLAP or data mining) to study the entire dataset and identify patterns that might represent a business opportunity. By testing against small random subsets of data, analysts can verify that their hypotheses hold true.  &lt;p&gt;If you search the internet for “TSQL Random Sampling” most paths lead back to this article &lt;a href="http://msdn.microsoft.com/en-us/library/Aa175776"&gt;“Random Sampling in T-SQL”&lt;/a&gt;, written by Brian Connolly back in 2004. As the code no longer appears to be available in its entirety, I’ve rewritten the code but followed some of the same techniques used in that article.  &lt;p&gt;There are several techniques that can be used to implement random sampling with TSQL:  &lt;ul&gt; &lt;li&gt;Add a column to the table, fill it with values from the Rand() function, and select an ordered subset based on that column.  &lt;li&gt;The same as the first technique, except that the Rand() function is seeded.  &lt;li&gt;The same as the first technique, except that the Rand() function is anchored to a row.  &lt;li&gt;Use the NEWID() GUID function to select an ordered subset.  &lt;li&gt;Use CHECKSUM(NEWID()) as a source of random values.  &lt;li&gt;Use TABLESAMPLE introduced in SQL Server 2008. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Before going any further, we can quickly rule out &lt;a href="http://msdn.microsoft.com/en-us/library/ms189108.aspx"&gt;limiting result sets using TABLESAMPLE&lt;/a&gt;: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;You can use TABLESAMPLE to quickly return a sample from a large table when either of the following conditions is true:  &lt;ul&gt; &lt;li&gt;The sample does not have to be a &lt;strong&gt;truly random sample&lt;/strong&gt; at the level of individual rows.  &lt;li&gt;Rows on individual pages of the table are not correlated with other rows on the same page.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;In other words, despite its name, if you want a truly random sample don’t use the built-in TABLESAMPLE!  &lt;p&gt;Some considerations:&amp;nbsp; Rand() is relatively expensive because it requires the use of INSERTs, cursors, or single-row UPDATEs. Seeded Rand() and NewID() are easier to use, but are they sufficiently random?&amp;nbsp; What we want to determine is the quality of the statistical random samples they produce. There are many statistical tests to determine the randomness of a pseudorandom number generator, which we expect to have a uniform distribution. One of the most commonly used is the &lt;a href="http://en.wikipedia.org/wiki/Pearson%27s_chi-square_test"&gt;Chi-square Test&lt;/a&gt;:  &lt;p&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;h6&gt;Discrete uniform distribution&lt;/h6&gt; &lt;p&gt;In this case, &lt;i&gt;N&lt;/i&gt; observations are divided among &lt;i&gt;n&lt;/i&gt; cells (or buckets). A simple application is to test the hypothesis that, in the general population, values would occur in each cell with equal frequency. The "theoretical frequency" for any cell (under the null hypothesis of a &lt;a href="http://en.wikipedia.org/wiki/Discrete_uniform_distribution"&gt;discrete uniform distribution&lt;/a&gt;) is thus calculated as  &lt;dl&gt; &lt;dd&gt;&lt;img alt="E_i=\frac{N}{n}\, ," src="http://upload.wikimedia.org/math/d/3/1/d312b20be2aecceedc277cb8880595de.png"&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;p&gt; &lt;h6&gt;Calculating the Chi-Square test-statistic&lt;/h6&gt; &lt;p&gt;The value of the test-statistic is  &lt;dl&gt; &lt;dd&gt;&lt;img alt="\Chi^2 = \sum_{i=1}^{n} \frac{(O_i - E_i)^2}{E_i}" src="http://upload.wikimedia.org/math/8/d/6/8d61806af1a4fd4bd75952883eed9bac.png"&gt;&lt;/dd&gt;&lt;/dl&gt; &lt;p&gt;where  &lt;ul&gt; &lt;li&gt;Χ&lt;sup&gt;2&lt;/sup&gt; = Pearson's cumulative test statistic, which asymptotically approaches a &lt;a href="http://en.wikipedia.org/wiki/Chi-square_distribution"&gt;χ&lt;sup&gt;2&lt;/sup&gt; distribution&lt;/a&gt;.  &lt;li&gt;&lt;i&gt;O&lt;/i&gt;&lt;sub&gt;&lt;i&gt;i&lt;/i&gt;&lt;/sub&gt; = the observed frequency;  &lt;li&gt;&lt;i&gt;E&lt;/i&gt;&lt;sub&gt;&lt;i&gt;i&lt;/i&gt;&lt;/sub&gt; = the expected (theoretical) frequency, asserted by the null hypothesis;  &lt;li&gt;&lt;i&gt;n&lt;/i&gt; = the number of buckets that the sample is divided into.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;The Chi-squared test divides the row range into a number of equally spaced "buckets" and ensures that on average the number of items in each bucket falls within the expected count (which for a uniform distribution is simply the number of rows divided by the number of buckets). For example, a random 1 percent sample of a RandomPopulation table with 100,000 rows will return 1000 row ids that are scattered between 1 and 100,000. Divide the row space into 40 "buckets" from 1-2500, 2501-5000 ... 97501-100000. A random 1 percent sample from RandomPopulation should place roughly 25 row ids into each bucket (some buckets will have more and some will have less). The Chi-square test measures this deviation to determine how much non-randomness is present&lt;i&gt;. &lt;/i&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;First Attempt Using Rand()&lt;/h4&gt; &lt;p&gt;So you have a problem where you need to select some random sampled data in TSQL, and therefore need a source of ‘random’ numbers. Your first attempt at generating random numbers might be something along the lines of:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- Won't work: returns same value for all rows!&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   SELECT&lt;/span&gt; &lt;span class="kwrd"&gt;TOP&lt;/span&gt; 1000 &lt;br /&gt;   RAND() &lt;span class="kwrd"&gt;AS&lt;/span&gt; rnd&lt;br /&gt;&lt;span class="kwrd"&gt;   FROM&lt;/span&gt; master.sys.all_columns &lt;span class="kwrd"&gt;AS&lt;/span&gt; ac1&lt;br /&gt;&lt;span class="kwrd"&gt;   CROSS&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; master.sys.all_columns &lt;span class="kwrd"&gt;AS&lt;/span&gt; ac2&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;But you will quickly discover that a major drawback to using Rand() without some form of ‘row anchor’ is that it is only evaluated once per query. So the previous query returns the same random number repeated for each row.&lt;/p&gt;&lt;b&gt;&lt;br /&gt;&lt;h4&gt;The RandomPopulation table&lt;/h4&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;br /&gt;&lt;p&gt;Following the original implementation, we will use a similar table to implement and compare these techniques:&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;   create&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt; dbo.RandomPopulation&lt;br /&gt;   ( &lt;br /&gt;      rowid &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;not&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt; &lt;span class="kwrd"&gt;PRIMARY&lt;/span&gt; &lt;span class="kwrd"&gt;KEY&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;      pure_random &lt;span class="kwrd"&gt;float&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      seeded_random &lt;span class="kwrd"&gt;float&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      seeded_random_anchored &lt;span class="kwrd"&gt;float&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      newid_random &lt;span class="kwrd"&gt;float&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      newid_guid UNIQUEIDENTIFIER &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;&lt;br /&gt;      pure_random_order &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      seeded_random_order &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      seeded_random_anchored_order &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      newid_random_order &lt;span class="kwrd"&gt;int&lt;/span&gt;  &lt;span class="kwrd"&gt;null&lt;/span&gt;,&lt;br /&gt;      newid_guid_order &lt;span class="kwrd"&gt;int&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;&lt;br /&gt;   )&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This table will contain the population to be sampled. The first group of columns hold the actual random values generated, while the second group hold &lt;font face="Courier New"&gt;rowid&lt;/font&gt; values when ordered by their respective random value column. &lt;br /&gt;&lt;p&gt;If there are 100,000 rows in the table, &lt;font face="Courier New"&gt;rowid&lt;/font&gt; will have values between 1 and 100,000 inclusive. The row with the smallest &lt;font face="Courier New"&gt;pure_random&lt;/font&gt; number will have a &lt;font face="Courier New"&gt;pure_random_order&lt;/font&gt; value of 1, and similarly the row with the largest &lt;font face="Courier New"&gt;pure_random&lt;/font&gt; number will have a &lt;font face="Courier New"&gt;pure_random_order&lt;/font&gt; value of 100,000. We use queries like the following to return a sample of RandomPopulation with @samplecount rows into a temporary table:&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;   &lt;span class="kwrd"&gt;select&lt;/span&gt; rowid&lt;br /&gt;   &lt;span class="kwrd"&gt;into&lt;/span&gt; #tpure&lt;br /&gt;   &lt;span class="kwrd"&gt;from&lt;/span&gt; RandomPopulation&lt;br /&gt;   &lt;span class="kwrd"&gt;where&lt;/span&gt; pure_random_order &amp;lt; @rowsample&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="2"&gt;The other&lt;/font&gt; random value columns are processed similarly.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;Method 1: Fill a column using rand() in a while loop&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;Since the only way to assign a different random number to every row in a table is to make a separate assignment for each row, one solution is to&amp;nbsp; loop over the rows, updating the table one row at a time:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 1. Pure random value&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   set&lt;/span&gt; @&lt;span class="kwrd"&gt;row&lt;/span&gt; = 1&lt;br /&gt;&lt;span class="kwrd"&gt;   while&lt;/span&gt; (@&lt;span class="kwrd"&gt;row&lt;/span&gt; &amp;lt;= @&lt;span class="kwrd"&gt;rowcount&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;   begin&lt;/span&gt;&lt;br /&gt;      insert &lt;span class="kwrd"&gt;into&lt;/span&gt; dbo.RandomPopulation (rowid, pure_random)&lt;br /&gt;      &lt;span class="kwrd"&gt;values&lt;/span&gt; (@&lt;span class="kwrd"&gt;row&lt;/span&gt;, rand())&lt;br /&gt;      &lt;span class="kwrd"&gt;set&lt;/span&gt; @&lt;span class="kwrd"&gt;row&lt;/span&gt; = @&lt;span class="kwrd"&gt;row&lt;/span&gt; + 1&lt;br /&gt;   end&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;img title="Important note" alt="Important note" src="http://i.msdn.microsoft.com/Hash/030c41d9079671d09a62d8e2c1db6973.gif"&gt;Once all rows have been assigned a pure_random value, the pure_random_order column can be calculated:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;   update&lt;/span&gt; dbo.RandomPopulation&lt;br /&gt;&lt;span class="kwrd"&gt;   set&lt;/span&gt; pure_random_order = x.row_order&lt;br /&gt;&lt;span class="kwrd"&gt;   from&lt;/span&gt; RandomPopulation &lt;br /&gt;&lt;span class="kwrd"&gt;   inner&lt;/span&gt; &lt;span class="kwrd"&gt;join&lt;/span&gt; (&lt;span class="kwrd"&gt;select&lt;/span&gt; row_number() &lt;span class="kwrd"&gt;over&lt;/span&gt;(&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; pure_random) &lt;span class="kwrd"&gt;as&lt;/span&gt; row_order, rowid &lt;br /&gt;               &lt;span class="kwrd"&gt;from&lt;/span&gt; dbo.RandomPopulation) x &lt;span class="kwrd"&gt;on&lt;/span&gt;  x.rowid = dbo.RandomPopulation.rowid&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This query pattern is likewise repeated for the other random value/order column pairs.&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;Method 2 and 4: rand() seeded with Newid(), and pure Newid()&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;In order for rand() to be evaluated for each row, we need to seed it with a row-dependent value. TSQL’s NewID() function is evaluated once per row, and the uniqueidentifier values (128 bit GUIDs) that it returns can be ordered. Both of these methods are shown below:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 2. Rand seeded with guid  &lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   UPDATE&lt;/span&gt; dbo.RandomPopulation &lt;br /&gt;&lt;span class="kwrd"&gt;   SET&lt;/span&gt; seeded_random = rand(checksum(newid()))&lt;/font&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 4. newid() value&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   UPDATE&lt;/span&gt; dbo.RandomPopulation &lt;br /&gt;&lt;span class="kwrd"&gt;   SET&lt;/span&gt; newid_guid = newid()&lt;/font&gt;&amp;nbsp;&lt;/pre&gt;&lt;br /&gt;&lt;h4&gt;Method 3: rand() seeded with a row anchor&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;As mentioned earlier, if rand() is seeded with a row-dependent value, it's evaluated not once per query, but rather once for each row. In Brian’s original article, he uses the following formula to seed rand() with a row-dependent value:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 3. rand seeded and anchored to row: DO NOT USE!!&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   UPDATE&lt;/span&gt; dbo.RandomPopulation &lt;br /&gt;&lt;span class="kwrd"&gt;   SET&lt;/span&gt; seeded_random_anchored = rand((rowid % 1000000) * (datepart(ms, getdate())+1))&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;This formula does not work at all well. You do not even need to perform a chi-square test on the data ; it is visibly predictable! &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-Ewjm2bu0MPc/Tj5YukAFHYI/AAAAAAAAAOg/M_Xwe-eYAd4/s1600-h/RandArticleSeededAnchored3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RandArticleSeededAnchored" border="0" alt="RandArticleSeededAnchored" src="http://lh5.ggpht.com/-A8l9QZvheVM/Tj5Yv5XjZPI/AAAAAAAAAOk/ShHBGSAdspY/RandArticleSeededAnchored_thumb1.png?imgmax=800" width="314" height="274"&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;Instead, I used the following formula:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 3. rand seeded and anchored to row (2): also, DO NOT USE!!&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   UPDATE&lt;/span&gt; dbo.RandomPopulation&lt;br /&gt;&lt;span class="kwrd"&gt;   SET&lt;/span&gt; seeded_random_anchored = rand((rowid % 97) * (datepart(nanosecond, sysdatetime())/100 + 1))&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The seed chosen for rand() is a function of the rowid and also the current nanoseconds. This is the one I’ve included in the results, BUT both versions perform very poorly, &lt;strong&gt;and should not be used in practice&lt;/strong&gt;. Here’s what Brian had to say:&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;The use of seeded random is problematic. Rand has been designed (and tested) to give a stream of statistically independent, uniformly distributed numbers on successive calls after it's seeded. However, the "seeded random" technique used earlier essentially takes the first random number from a different seed for each row. So while Rand(X), Rand(), Rand() ... Rand() would be expected to yield a valid stream of random numbers, &lt;strong&gt;there's no reason to expect Rand(N1), Rand(N2) ... Rand(NNN) to be random&lt;/strong&gt;. For this reason, and also because the tests that follow demonstrate how bad it can be, I don't recommend you use this technique.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;Although using a time based function to seed rand() might seem convenient, in addition to the above reasons for not doing so, there is also the issue that the ‘randomness’ is affected by the speed of your CPU! &lt;/p&gt;&lt;br /&gt;&lt;h4&gt;Method 5: checksum(newid) as a float value&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;This method transforms the 128bit GUID returned from Newid() into a 32bit integer value using &lt;a href="http://msdn.microsoft.com/en-us/library/ms189788.aspx"&gt;Checksum()&lt;/a&gt; and then into a floating point value between 0 and 1.&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;   -- 5. checksum(newid()) value&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;   UPDATE&lt;/span&gt; dbo.RandomPopulation &lt;br /&gt;&lt;span class="kwrd"&gt;   SET&lt;/span&gt; newid_random = &lt;span class="kwrd"&gt;CAST&lt;/span&gt;(CHECKSUM(NEWID()) &amp;amp; 0x7fffffff &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="kwrd"&gt;float&lt;/span&gt;) / &lt;span class="kwrd"&gt;CAST&lt;/span&gt; (0x7fffffff &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="kwrd"&gt;int&lt;/span&gt;)&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The expression CAST(CHECKSUM(NEWID()) &amp;amp; 0x7fffffff AS float / CAST (0x7fffffff AS int) evaluates to a random float value between 0 and 1.&amp;nbsp; The idea behind testing this is to check whether the restriction of the GUID values to 32 bits still renders them sufficiently random. &lt;br /&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This technique can be used directly to select a random sample of individual rows. In this example from MSDN, the following query uses the NEWID function to return approximately one percent of the rows of the Sales.SalesOrderDetail table: &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;   SELECT&lt;/span&gt; * &lt;span class="kwrd"&gt;FROM&lt;/span&gt; Sales.SalesOrderDetail&lt;br /&gt;&lt;span class="kwrd"&gt;   WHERE&lt;/span&gt; 0.01 &amp;gt;= &lt;span class="kwrd"&gt;CAST&lt;/span&gt;(CHECKSUM(NEWID(), SalesOrderID) &amp;amp; 0x7fffffff &lt;span class="kwrd"&gt;AS&lt;/span&gt; &lt;span class="kwrd"&gt;float&lt;/span&gt;) / &lt;span class="kwrd"&gt;CAST&lt;/span&gt; (0x7fffffff &lt;span class="kwrd"&gt;AS&lt;/span&gt; int)&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;The SalesOrderID column is included in the CHECKSUM expression so that NEWID() evaluates once per row to achieve sampling on a per-row basis. The expression CAST(CHECKSUM(NEWID(), SalesOrderID) &amp;amp; 0x7fffffff AS float / CAST (0x7fffffff AS int) evaluates to a random float value between 0 and 1. &lt;br /&gt;&lt;p&gt;------------------------------- &lt;br /&gt;&lt;p&gt;&lt;strong&gt;Sidebar: Picking a single random row&lt;/strong&gt; &lt;br /&gt;&lt;p&gt;Picking a single random row using an ORDER BY clause like this: &lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;   SELECT&lt;/span&gt; &lt;span class="kwrd"&gt;TOP&lt;/span&gt; 1 * &lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt; &lt;span class="kwrd"&gt;ORDER&lt;/span&gt; &lt;span class="kwrd"&gt;BY&lt;/span&gt; CHECKSUM(NEWID())&lt;/font&gt; &lt;/pre&gt;&lt;br /&gt;&lt;p&gt;performs a table scan (because the random value associated with each row obviously needs to be calculated before the rows can be ordered), which can be slow for large tables. Using an indexed integer column (such as that commonly used for a primary key), and using:&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;   SELECT&lt;/span&gt; &lt;span class="kwrd"&gt;TOP&lt;/span&gt; 1 * &lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt; &lt;br /&gt;&lt;span class="kwrd"&gt;   WHERE&lt;/span&gt; rowid &amp;gt;= RAND(CHECKSUM(NEWID())) * (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; &lt;span class="kwrd"&gt;MAX&lt;/span&gt;(rowid) &lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;span class="kwrd"&gt;table&lt;/span&gt;)&lt;/font&gt; &lt;/pre&gt;&lt;br /&gt;&lt;p&gt;works in constant time, provided the &lt;font color="#000000"&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;rowid&lt;/font&gt;&lt;/code&gt; column is indexed. Note: this assumes that &lt;/font&gt;&lt;code&gt;&lt;font color="#0000ff"&gt;rowid&lt;/font&gt;&lt;/code&gt; is uniformly distributed in the range &lt;code&gt;&lt;font color="#0000ff"&gt;0..MAX(rowid)&lt;/font&gt;&lt;/code&gt;. If your dataset has some other distribution, your results will be skewed (i.e. some rows will be picked more often than others).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;-------------------------------&lt;/p&gt;&lt;br /&gt;&lt;h4&gt;Running the Tests&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;I have followed Brian’s original TSQL implementation to calculate the bucket frequencies and the resulting chi-square statistic. Please refer to the original article or the attached downloadable code for more details. The tests are wrapped in the following stored procedure (available in the download):&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;create&lt;/span&gt; &lt;span class="kwrd"&gt;procedure&lt;/span&gt; dbo.test_random_selection&lt;br /&gt;(&lt;br /&gt;   @runs        &lt;span class="kwrd"&gt;int&lt;/span&gt;,        &lt;span class="rem"&gt;-- Number of times to run the tests&lt;/span&gt;&lt;br /&gt;   @rowcount    &lt;span class="kwrd"&gt;int&lt;/span&gt;,        &lt;span class="rem"&gt;-- Size of the Random population to be sampled&lt;/span&gt;&lt;br /&gt;   @sampleprop  &lt;span class="kwrd"&gt;float&lt;/span&gt;,      &lt;span class="rem"&gt;-- Proportion of the Random population to be sampled&lt;/span&gt;&lt;br /&gt;   @bucketcount &lt;span class="kwrd"&gt;int&lt;/span&gt;         &lt;span class="rem"&gt;-- Number of buckets to be used for chi-square analysis&lt;/span&gt;&lt;br /&gt;)&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;h4&gt;Test Results&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;All tests were run against SQL Server 2008 R2 SP1 Enterprise Edition (x64) (and also without SP1; the results were similar) on an Intel Quad core i7 based PC running Windows 7 x64 Ultimate.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;-------------------&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Test1:&lt;/strong&gt; test_random_selection(50, 100000, 0.01, 40): 50 runs, 100,000 RandomPopulation rows, a 1 percent sample, and 40 buckets.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Each 2,500 (= 100,000 / 40) interval range bucket should contain approximately 25 rowids. There are 39 degrees of freedom (1 less than the number of buckets). We can say that the row sample for each technique is independent and uniformly distributed at the 90% confidence level if the Chi-square statistic for each technique is Chi-Sq[.90, 39]. Consulting a standard Chi-square table gives a value of 50.660 for the Chi-Sq[.90, 39] threshold level of this statistic (and the lower Chi-Sq[.10, 39] = 28.196). As long as the Chi-square value for each technique is lower than 50.66, there is no reason to suspect that the sample is not random (&lt;strong&gt;Note&lt;/strong&gt;: we expect that some samples will exceed the threshold value, because we are working with a confidence level of 90%. A few instances of crossing this value does not necessarily mean that the samples are non-random). &lt;br /&gt;&lt;p&gt;The results from this test are shown here: &lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-EPGjRsO_09k/Tj81H-qhaZI/AAAAAAAAAPI/tBvqEilXIvY/s1600-h/image%25255B1%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-TXOMF--bIW4/Tj5YxziEDcI/AAAAAAAAAPM/6X-_p5TUM0s/image_thumb.png?imgmax=800" width="820" height="284"&gt;&lt;/a&gt; &lt;br /&gt;&lt;table border="1" cellspacing="0" cellpadding="0" width="813"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Rand()&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Rand(Seeded)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Rand(anchored)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Checksum(Newid())&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Newid&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Avg&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;38.12&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;38.90&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;23.26&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;38.38&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;38.67&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Std&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;10.18&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;8.73&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;2.92&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;9.17&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;9.40&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Min&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;19.64&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;23.64&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;18.44&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;21.08&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;18.20&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Max&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;68.68&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;60.64&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;26.88&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;60.68&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;57.60&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="134"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;# &amp;gt;= 50.66&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="107"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;6&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="130"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;5&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;0&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="169"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;4&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="129"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;6&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p&gt;The Rand() seeded with a row anchor technique is showing very predictable behaviour. In fact, it is producing an unusual number of equal values!. The averages, standard deviations, max and min values for the other techniques are very similar to each other in shape and bounds. &lt;br /&gt;&lt;p&gt;Out of interest, I ran the tests again using the rand anchored formula from the original article, and obtained a similar result to Brian: &lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-V6FAkx0a5EE/Tj5YyxfWqcI/AAAAAAAAAPQ/u-2MLowLI18/s1600-h/image7%25255B2%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh4.ggpht.com/-I5gKUNBlEXg/Tj5Yz_P6g8I/AAAAAAAAAPU/uEwOZEK46-I/image7_thumb%25255B1%25255D.png?imgmax=800" width="819" height="264"&gt;&lt;/a&gt; &lt;br /&gt;&lt;p&gt;Neither of the ‘rand() seeded with a row anchor’ methods produce anything like sufficiently random sample, and consequently should not be used in practice. &lt;br /&gt;&lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;strong&gt;Test 2&lt;/strong&gt;: test_random_selection(160, 1000000, 0.01, 100): 160 runs, 1,000,000 RandomPopulation rows, a 1 percent sample, and 100 buckets. &lt;br /&gt;&lt;p&gt;Consulting a standard Chi-square table gives a value of 117.407 for the Chi-Sq[.90, 99] threshold level of this statistic (and the lower Chi-Sq[.10, 99] = 81.449). I have omitted the seeded anchored results in the larger graph to improve the viewable scale (but have included with the same results below, reduced in size) &lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-aZFx6FvGkB8/Tj5Y0mpgVHI/AAAAAAAAAO4/FjcMxgFt3TM/s1600-h/image15%25255B3%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-hApQgoAnBCM/Tj5Y1qo9qrI/AAAAAAAAAO8/my671vCvmoY/image15_thumb%25255B2%25255D.png?imgmax=800" width="544" height="155"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/-QHiTXB202ks/Tj5Y2bc6CrI/AAAAAAAAAPY/cw0C5-TeJZk/s1600-h/image11%25255B1%25255D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/-X3lYW7q0viQ/Tj5Y34zgEZI/AAAAAAAAAPc/fLWwf2aJTHA/image11_thumb.png?imgmax=800" width="827" height="323"&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;table border="1" cellspacing="0" cellpadding="0" width="661"&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="75"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Rand()&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="154"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Rand(Seeded)&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="172"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Checksum(Newid())&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;&lt;strong&gt;Newid&lt;/strong&gt;()&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Avg&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="76"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;99.17&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="154"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;99.06&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="172"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;95.75&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;97.20&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Std&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="77"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;14.27&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="154"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;15.14&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="172"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;13.38&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;14.7&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Min&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="78"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;69.27&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="154"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;69.72&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="171"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;63.92&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;70.41&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;Max&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="79"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;138.11&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="153"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;145.07&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="171"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;131.39&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="141"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;138.57&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;# &amp;gt; 117.407&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="80"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;16&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="153"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;23&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="171"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;7&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="141"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;14&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;tr&gt;&lt;br /&gt;&lt;td width="116"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;strong&gt;&lt;font size="2"&gt;# &amp;lt; 81.449&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="80"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;15&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="153"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;21&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="171"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;27&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;br /&gt;&lt;td width="142"&gt;&lt;br /&gt;&lt;p align="right"&gt;&lt;font size="2"&gt;21&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;p&gt;&lt;b&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp; &lt;h4&gt;Conclusions&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;/b&gt;&lt;br /&gt;&lt;p&gt;The seeded random anchored technique should never be used: the results were inconsistent and generally very poor. &lt;br /&gt;&lt;p&gt;The other 4 random sampling techniques produced very similar, acceptable results. They produced random samples that were sufficiently random as measured by a Chi-Square test. &lt;font face="Courier New"&gt;rand()&lt;/font&gt; has been designed to meet statistical standards so it is no surprise it produces random numbers whose distribution is uniform and satisfy a Chi-Square test. You should use &lt;font face="Courier New"&gt;rand()&lt;/font&gt; wherever possible, but bear in mind the overhead it has when used as a ‘row at a time’ operation. In testing, I found generating &lt;font face="Courier New"&gt;rand()&lt;/font&gt; per row was 60 times slower than the set-based operation of either using &lt;font face="Courier New"&gt;checksum(newid())&lt;/font&gt; or even &lt;font face="Courier New"&gt;rand(checksum(newid())):&lt;/font&gt;&amp;nbsp;&amp;nbsp; &lt;p&gt;Filling a table column for 1 million rows:&lt;/p&gt;&amp;nbsp; Rand() per row&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 124 seconds&lt;br&gt;&amp;nbsp; Set:CHECKSUM(NEWID())&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : 2 seconds&lt;br&gt;&amp;nbsp; Set:rand(checksum(newid())) : 2 seconds &lt;br /&gt;&lt;p&gt;So, if speed is a factor, then consider using of the &lt;font face="Courier New"&gt;newid()&lt;/font&gt;techniques. But heed Brian’s advice: &lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Bear in mind, though, that because NewID() is assigned by the operating system, you should test its behaviour on the target system–perhaps using the code included in the accompanying Download as a starting point.&lt;/em&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;h4&gt;Notes:&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: none of the random number generation methods discussed here are sufficient for cryptographic purposes (which require much larger number generation spaces). SQL Server 2008 introduced the &lt;a href="http://msdn.microsoft.com/en-us/library/cc627408.aspx"&gt;CRYPT_GEN_RANDOM(length [, seed ])&lt;/a&gt; function, which returns a cryptographic random number generated by the Crypto API (CAPI). The output is a hexadecimal number of the specified number of bytes.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Please be aware of the following issue, when using Newid() or any other non-deterministic function in a table expression (derived table, CTE, view, inline TVF):&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="https://connect.microsoft.com/SQLServer/feedback/details/350485/bug-with-newid-and-table-expressions "&gt;Bug with NEWID and Table Expressions&lt;/a&gt; &lt;br /&gt;&lt;li&gt;&lt;a href="http://www.codersrevolution.com/index.cfm/2009/10/27/MS-SQL-Server-Table-Variable-And-Nested-Select-Gotcha-Bug"&gt;MS SQL Server Table Variable And Nested Select Gotcha (Bug?)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;h4&gt;Refs:&lt;/h4&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/Aa175776"&gt;Random Sampling in T-SQL&lt;/a&gt; &lt;br /&gt;&lt;li&gt;&lt;a title="http://en.wikipedia.org/wiki/Pearson%27s_chi-square_test" href="http://en.wikipedia.org/wiki/Pearson%27s_chi-square_test"&gt;Pearson Chi-Square Test &lt;/a&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms189108.aspx"&gt;limiting result sets using TABLESAMPLE&lt;/a&gt; &lt;br /&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Randomness_tests "&gt;Randomness Tests&lt;/a&gt; &lt;br /&gt;&lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Diehard_tests"&gt;Diehard tests&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h4&gt;Download&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.box.net/shared/nrx55q9chkdk5ftg4v83"&gt;RandomNoTest.zip&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-428709274026322824?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/428709274026322824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=428709274026322824' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/428709274026322824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/428709274026322824'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/t-sql-generating-random-numbers-random.html' title='T-SQL: Generating Random Numbers, Random Sampling and Random ‘Goodness’'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/-A8l9QZvheVM/Tj5Yv5XjZPI/AAAAAAAAAOk/ShHBGSAdspY/s72-c/RandArticleSeededAnchored_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2869097642858533336</id><published>2011-08-02T08:07:00.001+08:00</published><updated>2011-08-02T08:07:45.844+08:00</updated><title type='text'>SQL Server: Is it OK to use a uniqueidentifier (GUID) as a Primary Key?</title><content type='html'>&lt;p&gt;I was recently discussing this topic with a colleague and less than a day later a similar was question was asked on StackOverflow. Then a few days later I was asked a related question by another colleague.  &lt;p&gt;Let’s start with the answer to the question “Is it OK to use a uniqueidentifier (GUID) as a Primary Key?”: Yes, a &lt;a href="http://msdn.microsoft.com/en-us/library/ms187942.aspx"&gt;uniqueidentifier&lt;/a&gt; (GUID) column can be fine as a Primary Key, &lt;strong&gt;&lt;em&gt;BUT&lt;/em&gt;&lt;/strong&gt; it is not a particularly good choice for the clustered index. In many cases, you will be better off creating the clustered index on a column (or columns) that are likely be used in range searches, and create a non-clustered index on the GUID column.  &lt;p&gt;OK, that’s the answer out of the way! Now for the reasons.&lt;/p&gt; &lt;p&gt;A common reason for using a GUID column as a primary key (over an &lt;font face="Courier New"&gt;int&lt;/font&gt; or &lt;font face="Courier New"&gt;bigint&lt;/font&gt;) is the ability to create and assign these in the middle application tier without making a round trip to the database, while still avoiding key clashes between distributed clients.&lt;/p&gt; &lt;p&gt;A primary key is a column (or set of columns) that uniquely identifies each row in a table (or entity). When a column (or a set of columns) is defined as a primary key, SQL Server checks that ALL of the columns that make up the PRIMARY KEY meet the requirement of a PRIMARY KEY constraint which is that they must not contain any NULLs. If the table contains data, a check is made to ensure that this existing data meets the uniqueness constraint. If there are any duplicate rows, the addition of the constraint will fail, as will the creation of the primary key.To enforce this for new rows, SQL Server builds a UNIQUE index.&lt;em&gt; If you do not specify the index type when adding the constraint, SQL Server creates a UNIQUE &lt;strong&gt;CLUSTERED&lt;/strong&gt; index.&lt;/em&gt; Which is almost certainly why people sometimes confuse the clustered index with the primary key.&lt;/p&gt; &lt;p&gt;It’s important, so it’s worth repeating: &lt;em&gt;If you don't specify the index type when designating a Primary Key, SQL Server creates a &lt;strong&gt;UNIQUE CLUSTERED&lt;/strong&gt; index by default.&lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What’s the significance of the clustering key?&lt;/strong&gt;&lt;/p&gt; &lt;ol&gt; &lt;li&gt;It defines the lookup value used by all the non-clustered indexes (and therefore should be unique, as narrow as possible and unchanging).  &lt;li&gt;It defines the table's order, so fragmentation (and index maintenance) needs to be taken into account.  &lt;li&gt;It can be used to satisfy a query, either as a table scan or a range query (where the clustering key supports that range)&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Notice point (1): Each index row in the non-clustered index contains the non-clustered key value and a row locator. This locator points to the data row in the clustered index or heap having the key value (&lt;a href="http://msdn.microsoft.com/en-us/library/ms177484.aspx"&gt;Nonclustered Index Structures&lt;/a&gt;). So a wide clustering key adds overhead to &lt;em&gt;&lt;strong&gt;every&lt;/strong&gt;&lt;/em&gt; non-clustered index. This overhead can be significant.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What are good choices for the clustering key?&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;An identity column (int or bigint)  &lt;li&gt;A composite key based on date and identity (in that order)  &lt;li&gt;An ‘ordered’ (or pseudo sequential) GUID (such as SQL Server’s NEWSQUENTIALID(), or a modified, ordered GUID sometimes called a ‘COMB’)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;A uniqueidentifier (GUID) column requires 16 bytes of storage (4 times wider than an int identity column), so the space used per row is higher (and less rows fit on a database page), and bandwidth consumed by data transfer is higher. &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;table border="1" cellspacing="0" cellpadding="2" width="400"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="192"&gt;Column Type&lt;/td&gt; &lt;td valign="top" width="99"&gt;Size (bytes)&lt;/td&gt; &lt;td valign="top" width="108"&gt;Range&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="192"&gt;&lt;font size="2" face="Courier New"&gt;int&lt;/font&gt; &lt;/td&gt; &lt;td valign="top" width="99"&gt;4&lt;/td&gt; &lt;td valign="top" width="108"&gt;2&lt;sup&gt;31&lt;/sup&gt; - 1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="192"&gt;&lt;font size="2" face="Courier New"&gt;bigint&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="99"&gt;8&lt;/td&gt; &lt;td valign="top" width="108"&gt;2&lt;sup&gt;63&lt;/sup&gt; - 1&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="192"&gt;&lt;font size="2" face="Courier New"&gt;uniqueidentifier&lt;/font&gt; (GUID)&lt;/td&gt; &lt;td valign="top" width="99"&gt;16&lt;/td&gt; &lt;td valign="top" width="108"&gt;2&lt;sup&gt;128&lt;/sup&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;If all you need is a key range larger than that supported by an &lt;font face="Courier New"&gt;int&lt;/font&gt; (4 bytes, 2&lt;sup&gt;31&lt;/sup&gt; – 1 rows) then consider using a &lt;span class="kwrd"&gt;&lt;font face="Courier New"&gt;bigint&lt;/font&gt; &lt;/span&gt;(8 bytes), which supports 2&lt;sup&gt;63&lt;/sup&gt; - 1 rows (which should be sufficient for most applications) and saves 8 bytes per row compared to using a GUID.&lt;/font&gt; &lt;/p&gt; &lt;p&gt;Are there any performance considerations? Yes. In addition to the increased storage issues, a clustered index based upon a non-ordered GUID will experience fragmentation due to page splits during inserts. If you absolutely have to have a (non-ordered) GUID as a primary key with a clustered index, make sure you have a regular index rebuild as part of your database maintenance plans, and maybe even consider leaving extra space per page by decreasing the &lt;a href="http://msdn.microsoft.com/en-us/library/ms177459.aspx"&gt;Fill Factor&lt;/a&gt; for the clustered index.When an index is created or rebuilt, the fill-factor value determines the percentage of space on each leaf-level page to be filled with data, reserving the remainder on each page as free space for future growth, and reducing the number of page splits. [Note: The fill-factor setting applies only when the index is created, or rebuilt.]&lt;/p&gt; &lt;p&gt;Ref: &lt;a href="http://sqlskills.com/BLOGS/KIMBERLY/post/GUIDs-as-PRIMARY-KEYs-andor-the-clustering-key.aspx#ixzz1TC96o37H"&gt;GUIDs as PRIMARY KEYs and/or the clustering key&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2869097642858533336?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2869097642858533336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2869097642858533336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2869097642858533336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2869097642858533336'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/sql-server-is-it-ok-to-use.html' title='SQL Server: Is it OK to use a uniqueidentifier (GUID) as a Primary Key?'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7296787682537043969</id><published>2011-08-01T23:20:00.001+08:00</published><updated>2011-08-01T23:20:54.764+08:00</updated><title type='text'>Perth .NET User Group Meeting: Thurs 4th Aug, 5:30pm: Introduction to NServiceBus with Colin Scott</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, August 4th 5:30pm, where Colin Scott will give an introduction to NServiceBus covering key features and concepts such as asynchronous messaging, Publish/Subscribe, message handling and versioning and just what the heck is a service anyway. NServiceBus is an open source service bus built on .NET. It supports the construction of systems that are robust, loosely coupled and aligned to your business. &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; &lt;b&gt;Introduction to NServiceBus with Colin Scott&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, August 4th, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://www.abstractcode.com/"&gt;Colin Scott&lt;/a&gt; is a developer who's been working with .NET long enough to start telling the kids of today that they don't know how good they have it! Having worked for consulting companies since 1999 he's recently decided to see how the other half live by joining the development team at Quickflix as a Senior .NET Developer/Architect. When not making the world a better place for developers everywhere he can be found on Twitter at @AbstractCode. &lt;p&gt;More details here: &lt;a href="http://perthdotnet.org/blogs/events/archive/2011/07/17/introduction-to-nservicebus-with-colin-scott.aspx"&gt;http://perthdotnet.org/blogs/events/archive/2011/07/17/introduction-to-nservicebus-with-colin-scott.aspx&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7296787682537043969?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7296787682537043969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7296787682537043969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7296787682537043969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7296787682537043969'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/perth-net-user-group-meeting-thurs-4th.html' title='Perth .NET User Group Meeting: Thurs 4th Aug, 5:30pm: Introduction to NServiceBus with Colin Scott'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4918409444186216412</id><published>2011-08-01T08:15:00.003+08:00</published><updated>2011-08-01T23:18:33.424+08:00</updated><title type='text'>SQL Server - Book Recommendations</title><content type='html'>&lt;p&gt;If you’re an experienced developer/DBA coming from a background in another RDBMS or just want to improve your SQL Server knowledge, here are some SQL Server book recommendations:&lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/Microsoft%C2%AE-SQL-Server%C2%AE-2008-Internals/dp/0735626243"&gt;Microsoft SQL Server 2008 Internals&lt;/a&gt;: goes deep but does not neglect the fundamentals. &lt;em&gt;It is a must read&lt;/em&gt;.&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/Professional-Server-2008-Internals-Troubleshooting/dp/0470484284"&gt;Professional SQL Server 2008 Internals and Troubleshooting&lt;/a&gt;: similar to first book, but with a slightly more performance based focus. &lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/Server-Performance-Tuning-Distilled-Experts/dp/1430219025"&gt;SQL Server 2008 Query Performance Tuning Distilled&lt;/a&gt;: great techniques for identifying and fixing poorly performing queries, from the metal to the application.&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/SQL-Server-MVP-Deep-Dives/dp/1935182048"&gt;SQL Server MVP Deep Dives&lt;/a&gt;: written by some of the world's leading SQL Server experts and practitioners. [There's a short review &lt;a href="http://mitch-wheat.blogspot.com/2010/02/sql-server-mvp-deep-dives-book-review.html"&gt;here&lt;/a&gt;. Volume 2 is due out somewhere around November 2011, I believe]&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt; &lt;p&gt;If you have more of a development focus: &lt;br&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/Server-Relational-Database-Implementation-Experts/dp/143020866X"&gt;Pro SQL Server 2008 Relational Database Design and Implementation&lt;/a&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.amazon.com/Expert-SQL-Server-2005-Development/dp/159059729X"&gt;Expert SQL Server 2005 Development&lt;/a&gt; (SQL Server 2005 but still relevant for SQL Server 2008)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br&gt; &lt;p&gt;There are also some very good, free electronic books from &lt;a href="http://www.red-gate.com/our-company/about/book-store/"&gt;Redgate&lt;/a&gt;:  &lt;ul&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.red-gate.com/our-company/about/book-store/inside-sql-server-query-optimizer"&gt;Inside the SQL Server Query Optimizer&lt;/a&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.red-gate.com/our-company/about/book-store/dynamic-management-views"&gt;Performance Tuning with SQL Server Dynamic Management Views&lt;/a&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.red-gate.com/our-company/about/book-store/sql-server-maintenance-plans"&gt;Brad's Sure Guide to SQL Server Maintenance Plans&lt;/a&gt;&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;a href="http://www.red-gate.com/our-company/about/book-store/sql-server-execution-plans"&gt;SQL Server Execution Plans&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;to list a few.&lt;/p&gt; &lt;p&gt;Ref: &lt;a href="http://stackoverflow.com/questions/6714417/long-time-oracle-developer-dba-learning-sql-server-book-recommendations"&gt;Long time Oracle developer/DBA learning SQL Server - book recommendations?&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4918409444186216412?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4918409444186216412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4918409444186216412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4918409444186216412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4918409444186216412'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/08/sql-server-book-recommendations.html' title='SQL Server - Book Recommendations'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6213541565904333848</id><published>2011-07-31T10:27:00.001+08:00</published><updated>2011-07-31T10:27:43.534+08:00</updated><title type='text'>New Version of VSCommands 2010</title><content type='html'>&lt;p&gt;A new version of &lt;a href="http://visualstudiogallery.msdn.microsoft.com/d491911d-97f3-4cf6-87b0-6a2882120acf"&gt;VSCommands 2010&lt;/a&gt; was released earlier this month. New features include file structure, output windows highlighting (makes errors easier to spot), and friendly solution name (handy where you might be working in multiple branches of the same project).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6213541565904333848?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6213541565904333848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6213541565904333848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6213541565904333848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6213541565904333848'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/new-version-of-vscommands-2010.html' title='New Version of VSCommands 2010'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8829924653790298310</id><published>2011-07-30T10:18:00.001+08:00</published><updated>2011-07-30T10:18:28.944+08:00</updated><title type='text'>SharePoint 2010 Database Maintenance Whitepaper</title><content type='html'>&lt;p&gt;Paul Randal, who teaches the SQL Server portion of the SharePoint MCM, has released an updated version of the database maintenance whitepaper for SharePoint 2007 (which was somewhat out of date). You can download it from &lt;a href="http://technet.microsoft.com/en-us/library/cc262731.aspx"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8829924653790298310?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8829924653790298310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8829924653790298310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8829924653790298310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8829924653790298310'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/sharepoint-2010-database-maintenance.html' title='SharePoint 2010 Database Maintenance Whitepaper'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4270159318672482228</id><published>2011-07-22T09:32:00.001+08:00</published><updated>2011-07-22T09:32:59.311+08:00</updated><title type='text'>SQL Server Maintenance Solution</title><content type='html'>&lt;p&gt;Ola Hallengren has recently released a new version of his maintenance solution scripts. He has added the ability to log to a table, which is useful if you want to analyse how your indexes are rebuilt and reorganized over time. All you need to do is to set @LogToTable = 'Y'. &lt;/p&gt; &lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;EXECUTE&lt;/span&gt; dbo.IndexOptimize @Databases = &lt;span class="str"&gt;'USER_DATABASES'&lt;/span&gt;, &lt;br /&gt;&lt;br /&gt;@FragmentationHigh = &lt;span class="str"&gt;'INDEX_REBUILD_ONLINE,INDEX_REBUILD_OFFLINE'&lt;/span&gt;, &lt;br /&gt;&lt;br /&gt;@FragmentationMedium = &lt;span class="str"&gt;'INDEX_REORGANIZE'&lt;/span&gt;, &lt;br /&gt;&lt;br /&gt;@FragmentationLow = &lt;span class="kwrd"&gt;NULL&lt;/span&gt;, &lt;br /&gt;&lt;br /&gt;@LogToTable = &lt;span class="str"&gt;'Y'&lt;/span&gt;&lt;/font&gt; &lt;br /&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;It can also be used with DatabaseBackup and DatabaseIntegrityCheck. &lt;br /&gt;&lt;p&gt;&lt;a href="http://ola.hallengren.com/Versions.html"&gt;http://ola.hallengren.com/Versions.html&lt;/a&gt; &lt;br /&gt;&lt;p&gt;&lt;a href="http://ola.hallengren.com/scripts/MaintenanceSolution.sql"&gt;http://ola.hallengren.com/scripts/MaintenanceSolution.sql&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4270159318672482228?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4270159318672482228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4270159318672482228' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4270159318672482228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4270159318672482228'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/sql-server-maintenance-solution.html' title='SQL Server Maintenance Solution'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6074338270081896333</id><published>2011-07-21T10:45:00.001+08:00</published><updated>2011-07-21T10:45:11.413+08:00</updated><title type='text'>New 550MB/s SSDs</title><content type='html'>&lt;p&gt;If you’re thinking of buying a new shiny 550MB/s SSD, there are two things you should keep in mind:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Does your motherboard support SATA 3.0?&lt;/li&gt; &lt;li&gt;SATA revision 3.0 (also known as SATA 6) is &lt;strong&gt;NOT&lt;/strong&gt; SATA 3&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;(Some motherboards specs even refer to Sata-600 and Sata-300 to try and limit the confusion)&lt;/p&gt; &lt;h5&gt;SATA revision 2.0 (SATA 3 Gbit/s)&lt;/h5&gt; &lt;p&gt;With a native transfer rate of 3.0 Gbit/s, and taking &lt;a href="http://en.wikipedia.org/wiki/8b/10b_encoding"&gt;8b/10b encoding&lt;/a&gt; into account, the maximum uncoded transfer rate is 2.4 Gbit/s, providing a peak throughput of about 300 MB/s. &lt;p&gt;&amp;nbsp; &lt;h5&gt;SATA revision 3.0 (SATA 6 Gbit/s)&lt;/h5&gt; &lt;p&gt;Provides a peak throughput of about 600 MB/s (Megabytes per second) including the protocol overhead (10b/8b coding with 8 bits to one byte). &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Serial_ATA"&gt;Ref&lt;/a&gt;. &lt;p&gt;My realisation came about today through a conversation I had with Hadley Willan (aka Hadders). He’s a gold mine of tech info; I wish he would blog these gems more often… &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6074338270081896333?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6074338270081896333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6074338270081896333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6074338270081896333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6074338270081896333'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/new-550mbs-ssds.html' title='New 550MB/s SSDs'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2713184095927491711</id><published>2011-07-19T09:10:00.001+08:00</published><updated>2011-07-19T09:10:06.423+08:00</updated><title type='text'>Visual Studio LightSwitch 2011</title><content type='html'>&lt;p&gt;&lt;br&gt;&lt;a href="http://www.microsoft.com/visualstudio/en-us/lightswitch"&gt;Visual Studio LightSwitch 2011&lt;/a&gt; is launching July 26th. Sounds just like another Visual Studio add-in being released? It’s definitely more than that. It’s going to have a big impact on how some businesses build applications.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;[NOTE&lt;/strong&gt;: &lt;em&gt;If you are planning to install LightSwitch Beta 2, and Visual Studio 2010 Express, Professional, Premium or Ultimate is installed, you must first install Visual Studio 2010 SP1&lt;/em&gt;]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2713184095927491711?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2713184095927491711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2713184095927491711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2713184095927491711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2713184095927491711'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/visual-studio-lightswitch-2011.html' title='Visual Studio LightSwitch 2011'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5605137492042322871</id><published>2011-07-15T08:53:00.001+08:00</published><updated>2011-07-15T08:53:06.235+08:00</updated><title type='text'>Visual Studio 2010 Debugging Tips</title><content type='html'>&lt;p&gt;Not new, but several excellent &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/08/18/debugging-tips-with-visual-studio-2010.aspx"&gt;Visual Studio 2010 debugging tips&lt;/a&gt; from Scott Guthrie, some you probably know and perhaps the odd one you might not be aware of (or have forgotten about).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5605137492042322871?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5605137492042322871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5605137492042322871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5605137492042322871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5605137492042322871'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/visual-studio-2010-debugging-tips.html' title='Visual Studio 2010 Debugging Tips'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7225085783931547197</id><published>2011-07-14T11:32:00.002+08:00</published><updated>2011-07-14T11:33:26.109+08:00</updated><title type='text'>Fixing Slow SQL Server Management Objects (SMO) Performance</title><content type='html'>&lt;p&gt;Just recently I’ve been converting a small utility that uses SQL-DMO to use SQL-SMO instead (&lt;a href="http://msdn.microsoft.com/en-us/library/ms143729.aspx"&gt;SQL-DMO is deprecated&lt;/a&gt; in SQL Server 2008 R2; if you really need to use it, install the &lt;a href="http://www.microsoft.com/download/en/details.aspx?id=16177"&gt;Backward Compatibility Components from the SQL Server 2008 Feature Pack&lt;/a&gt; from the Microsoft Download Centre). Remembering all those posts saying how slow SMO was compared to DMO, a colleague mentioned &lt;a href="http://davidhayden.com/blog/dave/archive/2006/03/29/2894.aspx"&gt;this&lt;/a&gt;: &lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;SMO has the concept of &lt;strong&gt;Delayed Instantiation of Object Properties&lt;/strong&gt;. The concept consists of not returning every property of a database object when the object is requested. Some properties, like the StoredProcedure's &lt;strong&gt;IsSystemObject&lt;/strong&gt; property, are not returned by default when you request a Stored Procedure or a collection of Stored Procedures from the Database. It is only when you explicitly access the &lt;strong&gt;IsSystemObject&lt;/strong&gt; property that SMO goes back to the database to get its value. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;[…]&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;If you find your SMO code is running slowly, use SQL Profiler to check whether you are accessing properties that are not returned by default and creating extra roundtrips to the database. Force SMO to load those properties by default by using the &lt;a href="http://msdn.microsoft.com/en-us/library/ms210363.aspx"&gt;Server.SetDefaultInitFields&lt;/a&gt; method:&lt;/p&gt;&lt;/blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;            Server server = &lt;span class="kwrd"&gt;new&lt;/span&gt; Server();&lt;br /&gt;&lt;br /&gt;            &lt;span class="rem"&gt;// Load all properties for columns&lt;/span&gt;&lt;br /&gt;            server.SetDefaultInitFields(&lt;span class="kwrd"&gt;typeof&lt;/span&gt; (Column), &lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;br /&gt;&lt;br /&gt;            &lt;span class="rem"&gt;// ...or load all properties for all objects&lt;/span&gt;&lt;br /&gt;            server.SetDefaultInitFields(&lt;span class="kwrd"&gt;true&lt;/span&gt;);&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;To build an SMO application, you need to reference the SMO assemblies. Click ‘Add Reference’ and navigate to the folder&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;C:\Program Files\Microsoft SQL Server\100\SDK\Assemblies&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Add references to:&lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Microsoft.SqlServer.ConnectionInfo.dll&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Microsoft.SqlServer.Smo.dll&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Microsoft.SqlServer.Management.Sdk.Sfc.dll&lt;br /&gt;&lt;br /&gt;&lt;li&gt;Microsoft.SqlServer.SqlEnum.dll&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;(These are the minimum files that are required to build an SMO application)&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Ref.: &lt;a href="http://msdn.microsoft.com/en-us/library/ms162129%28v=SQL.105%29.aspx"&gt;How to: Create a Visual C# SMO Project in Visual Studio .NET&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7225085783931547197?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7225085783931547197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7225085783931547197' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7225085783931547197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7225085783931547197'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/fixing-slow-sql-server-management.html' title='Fixing Slow SQL Server Management Objects (SMO) Performance'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2241639862788721933</id><published>2011-07-14T09:19:00.001+08:00</published><updated>2011-07-14T09:19:26.392+08:00</updated><title type='text'>SQL Server Code Name "Denali" CTP3 Released</title><content type='html'>&lt;p&gt;SQL Server Code Name "Denali" CTP3 has been released. You can download from TechNet &lt;a href="http://technet.microsoft.com/en-au/evalcenter/hh225126.aspx"&gt;here&lt;/a&gt; (I believe it requires a current subscription).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt;:&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="0" width="374"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width="372"&gt; &lt;table border="0" cellspacing="0" cellpadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="15"&gt;&amp;nbsp;&lt;/td&gt; &lt;td valign="top" width="15"&gt; &lt;p&gt;•&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;a href="http://click.email.microsoftemail.com/?qs=227c07c2ce95af2e19f0a9963724bfd9f1afe2caac1e69ac9dad8c62916483a1a0ffccff9d9b35fd"&gt;Whitepaper: SQL Server-What's New&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="15"&gt;&amp;nbsp;&lt;/td&gt; &lt;td valign="top" width="15"&gt; &lt;p&gt;•&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;a href="http://click.email.microsoftemail.com/?qs=227c07c2ce95af2e4225a4c1d354dcd27b3d222bd3b98f46634098601ddd9ceb565d88ddfe029747"&gt;Video: SQL Server and the Data Explosion&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="15"&gt;&amp;nbsp;&lt;/td&gt; &lt;td valign="top" width="15"&gt; &lt;p&gt;•&lt;/p&gt;&lt;/td&gt; &lt;td valign="top"&gt; &lt;p&gt;&lt;a href="http://click.email.microsoftemail.com/?qs=227c07c2ce95af2e9afbb9f111398cf160fb3d05bf3635a0cdaff158a52696877ae1c8a1a6f76504"&gt;Datasheet: High Availability&lt;br&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2241639862788721933?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2241639862788721933/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2241639862788721933' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2241639862788721933'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2241639862788721933'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/sql-server-code-name-ctp3-released.html' title='SQL Server Code Name &amp;quot;Denali&amp;quot; CTP3 Released'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7960273748644870964</id><published>2011-07-13T09:28:00.001+08:00</published><updated>2011-07-13T09:30:44.356+08:00</updated><title type='text'>SQL Server 2008 R2 Service Pack 1 Released</title><content type='html'>The title says it all!: &lt;a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=26727"&gt;SQL Server 2008 R2 Service Pack 1 &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7960273748644870964?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7960273748644870964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7960273748644870964' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7960273748644870964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7960273748644870964'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/sql-server-2008-r2-service-pack-1.html' title='SQL Server 2008 R2 Service Pack 1 Released'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7464625878992148297</id><published>2011-07-11T15:31:00.001+08:00</published><updated>2011-07-11T15:31:37.789+08:00</updated><title type='text'>SQL Server 2008: The ultimate guide to the datetime datatypes</title><content type='html'>&lt;p&gt;I mentioned Tibor Karaszi’s guide a while back and he’s updated it for the datetime datatypes added in SQL Server 2008. A great reference: &lt;a href="http://www.karaszi.com/SQLServer/info_datetime.asp"&gt;The ultimate guide to the datetime datatypes&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7464625878992148297?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7464625878992148297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7464625878992148297' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7464625878992148297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7464625878992148297'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/sql-server-2008-ultimate-guide-to.html' title='SQL Server 2008: The ultimate guide to the datetime datatypes'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-616599073117491445</id><published>2011-07-03T09:40:00.001+08:00</published><updated>2011-07-03T09:40:48.101+08:00</updated><title type='text'>Windows Azure Platform FAQs</title><content type='html'>&lt;p&gt;Just for my reference: &lt;a href="http://www.microsoft.com/windowsazure/faq/"&gt;Windows Azure Platform FAQs&lt;/a&gt; contains a nice overview and description of many of the aspects of Microsoft’s cloud offering, including SQL Azure, and a list of &lt;a href="http://msdn.microsoft.com/en-us/library/ff394115.aspx"&gt;feature differences&lt;/a&gt; between SQL Server versions and SQL Azure.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-616599073117491445?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/616599073117491445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=616599073117491445' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/616599073117491445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/616599073117491445'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/07/windows-azure-platform-faqs.html' title='Windows Azure Platform FAQs'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7075389957068141071</id><published>2011-06-24T11:24:00.001+08:00</published><updated>2011-06-24T11:24:35.610+08:00</updated><title type='text'>Improving SQL Server Management Studio’s Tabs</title><content type='html'>&lt;p&gt;I saw this post by Brent Ozar, &lt;a href="http://www.brentozar.com/archive/2011/06/fixing-sql-server-management-studios-tab-text/"&gt;Fixing SQL Server Management Studio’s Tab Text&lt;/a&gt;, and immediately made the changes whilst face palming myself and going “D’oh!” at the same time.&amp;nbsp; &lt;/p&gt; &lt;p&gt;What are the improvements? First, the status bar is moved to the top of the tabbed window space, where your eyes are normally focused. Second it removes the server name, database name and login (which are all in the status bar anyway) from each tab title so that you can actually navigate around the tabs!&lt;/p&gt; &lt;p&gt;It’s been a constant source of frustration over many years of using SSMS, and I feel chastised for not investigating the options before. Nice one Brent!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7075389957068141071?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7075389957068141071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7075389957068141071' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7075389957068141071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7075389957068141071'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/06/improving-sql-server-management-studios.html' title='Improving SQL Server Management Studio’s Tabs'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-390912681359230189</id><published>2011-06-22T10:29:00.001+08:00</published><updated>2011-06-22T10:29:29.242+08:00</updated><title type='text'>MVC Mini Profiler</title><content type='html'>&lt;p&gt;If you are working with ASP.NET MVC 3 you might be interested in this project: the &lt;a href="http://code.google.com/p/mvc-mini-profiler/"&gt;mvc-mini-profiler&lt;/a&gt;. It includes standard profiler timing output but also comprehensive database profiling capabilities.&lt;/p&gt; &lt;p&gt;MVC Mini Profiler was designed by the team at &lt;a href="http://stackoverflow.com"&gt;Stack Overflow&lt;/a&gt;, and is actively being used there to monitor the &lt;a href="http://stackexchange.com"&gt;Stack Exchange&lt;/a&gt; family of sites.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-390912681359230189?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/390912681359230189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=390912681359230189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/390912681359230189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/390912681359230189'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/06/mvc-mini-profiler.html' title='MVC Mini Profiler'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6002462584555537618</id><published>2011-06-21T15:32:00.001+08:00</published><updated>2011-06-21T15:32:47.273+08:00</updated><title type='text'>Visual Studio 2010 Web Standards Update</title><content type='html'>&lt;p&gt;Visual Studio 2010 Web Standards Update is a free extension available for anyone who is using Visual Studio 2010 SP1 and it provides HTML5 &amp;amp; CSS3 support based on current W3C specifications. &lt;br /&gt;&lt;p&gt;It supports: &lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;HTML5&lt;/strong&gt; – Video, Audio, Input Type, Drag &amp;amp; Drop, WAI-ARIA, Microdata, Schema.org &lt;br /&gt;&lt;li&gt;&lt;strong&gt;Browser API&lt;/strong&gt; – GeoLocation &amp;amp; Local Storage &lt;br /&gt;&lt;li&gt;&lt;strong&gt;CSS3&lt;/strong&gt; – 2D Transforms, 3D Transforms, Animations, Background &amp;amp; Borders, Basic Box Model, Basic UI, Behaviour, Colour, Flexible Box Layout, Fonts, Paged Media, Hyperlink Presentation, Line, Lists, Marquee, Media Queries, Multi Column, Namespaces, Presentation Levels, Ruby, Selectors, Speech, Syntax, Template Layout, Text &amp;amp; Transitions. It also supports vendor specific prefixes like –ms, -webkit &amp;amp; -moz.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This extension is created by a bunch of folks within Microsoft in their spare time. This is NOT an official Microsoft product &lt;br /&gt;&lt;p&gt;Scott Hanselman blogged about it &lt;a href="http://www.hanselman.com/blog/AnnouncingTheWebStandardsUpdateHTML5SupportForTheVisualStudio2010Editor.aspx"&gt;here&lt;/a&gt;. &lt;br /&gt;&lt;p&gt;You can download here: &lt;a href="http://visualstudiogallery.msdn.microsoft.com/a15c3ce9-f58f-42b7-8668-53f6cdc2cd83"&gt;Web Standards Update for Microsoft Visual Studio 2010 SP1&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6002462584555537618?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6002462584555537618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6002462584555537618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6002462584555537618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6002462584555537618'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/06/visual-studio-2010-web-standards-update.html' title='Visual Studio 2010 Web Standards Update'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-69557182934175785</id><published>2011-06-19T11:41:00.001+08:00</published><updated>2011-06-19T11:41:44.472+08:00</updated><title type='text'>Who’s Your Product?</title><content type='html'>&lt;p&gt;Love this quote, which sums up the model of companies like facebook, google etc.: &lt;blockquote&gt; &lt;p&gt;“If you are not paying for it, you're &lt;em&gt;not&lt;/em&gt; the customer; you're the product being sold.” &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Originally(?) appeared &lt;a href="http://www.metafilter.com/95152/Userdriven-discontent#3256046 "&gt;here&lt;/a&gt; and quoted many times since.    &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-69557182934175785?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/69557182934175785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=69557182934175785' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/69557182934175785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/69557182934175785'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/06/whos-your-product.html' title='Who’s Your Product?'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1176837752682900361</id><published>2011-05-30T21:41:00.001+08:00</published><updated>2011-05-30T21:41:57.190+08:00</updated><title type='text'>Perth .NET User Group, Thurs June 2nd: Good Things Come to Those Who ‘await’ with Joe Albahari</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, June 2nd 5:30pm, where Joe Albahari will showcase the magic of C# 5's await and async keywords. You'll see how easy asynchronous programming has become with Microsoft's latest CTP, and how much you can achieve without being a guru in multithreading or monadic calculus. &lt;p&gt;We'll start with very simple examples to introduce asynchronous programming in general: what exactly is it, how does it differ from multithreading, and why do we need it? Then we'll examine the historical support for asynchronous programming in the .NET Framework and what people are doing right now. You'll see why BackgroundWorker and the event-based pattern are clumsy and often inadequate - and how the APM strikes fear, pain (and ultimately asynchrophobia) into the hearts of the even most hard-core programmers. We'll then demonstrate how the async CTP eliminates the problem almost entirely - allowing you to program as you always have. &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; &lt;b&gt;Introduction to C# 5 async with Joe Albahari&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, June 2nd, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;There will be plenty of practical examples - from making a rich client app responsive to writing high-concurrency apps and games. We'll also cover limitations and discuss when you would use this versus Reactive Extensions. The presentation will assume minimum background knowledge and yet will go fairly deep. We'll also look at what the compiler actually does in translating asynchronous calls, and potential extensibility points. This is a great chance to get to grips with an otherwise difficult-to-research topic. &lt;p&gt;&lt;b&gt;&lt;/b&gt; &lt;p&gt;Joe Albahari is a C# MVP and author of C# 4.0 in a Nutshell and LINQPad. He has presented at TechEd and JAOO, and is a regular speaker in the Perth .NET UG. He has an extensive free online resource on .NET multithreading and parallel programming at &lt;a href="http://www.albahari.com/threading/"&gt;www.albahari.com/threading/&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1176837752682900361?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1176837752682900361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1176837752682900361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1176837752682900361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1176837752682900361'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/perth-net-user-group-thurs-june-2nd.html' title='Perth .NET User Group, Thurs June 2nd: Good Things Come to Those Who ‘await’ with Joe Albahari'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7810417611726331564</id><published>2011-05-30T08:09:00.002+08:00</published><updated>2011-06-16T09:26:16.077+08:00</updated><title type='text'>Mount .iso files in Windows</title><content type='html'>&lt;p&gt;I remember Greg Low once talking about the “Resolved: by Design” or “Resolved: as Won't Fix” replies on Connect when the issue being raised or asked for was clearly a good idea (obviously there are time constraints and sometimes things just aren’t possible); his point was that it doesn’t take too many such responses for even someone evangelical in their conscientious raising of issues to be less than enthusiastic about continuing to do so.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Why do I mention that? Well, ever wanted to mount an .iso file natively in windows? Not such a surprising thing to want to do, right? Especially as Microsoft actually provide many downloads in this format (such as the Windows 7 OS, which is what I was installing). Check out this Connect article &lt;a href="http://connect.microsoft.com/WindowsServerFeedback/feedback/details/351231/mount-iso-files"&gt;“Mount .iso files”&lt;/a&gt;. It had 919 up-votes at last count!… Something for Windows 8?&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I resorted to using one of the many third party installs which do the job: &lt;a href="http://www.slysoft.com/en/virtual-clonedrive.html"&gt;Virtual CloneDrive&lt;/a&gt;. But it really does feel like this should be part of Windows. Getting community/user feedback on your products is a great way to improve them, but only if you’re listening.&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;“Thank you for your comment/suggestion.&lt;br /&gt;We will continue to monitor your submission and when it reaches the vote threshold from the community we will forward it to the appropriate feature team. We will also respond here to let you know it has been escalated.”&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;p&gt;I wonder what that vote threshold is!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7810417611726331564?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7810417611726331564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7810417611726331564' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7810417611726331564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7810417611726331564'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/mount-iso-files-in-windows.html' title='Mount .iso files in Windows'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8685244857670743160</id><published>2011-05-29T10:47:00.001+08:00</published><updated>2011-05-29T10:47:10.490+08:00</updated><title type='text'>Free ASP.NET MVC2 Book</title><content type='html'>&lt;p&gt;Apparently a very good book on ASP.NET MVC 2 is "MVC 2 In Action" from Manning, and while the authors are putting the finishing touches to the MVC 3 version of the book, the entire MVC 2 version is available completely free in Word document form at: &lt;a href="https://github.com/jeffreypalermo/mvc2inaction"&gt;https://github.com/jeffreypalermo/mvc2inaction&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Every version of MVC relies on the previous version (except with a few breaking changes), so there is still value in reading this free resource. &lt;/p&gt; &lt;p&gt;Jeffrey Palermo’s original post is &lt;a href="http://jeffreypalermo.com/blog/read-all-of-asp-net-mvc-2-in-action-now-while-you-wait-for-the-printed-book/"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8685244857670743160?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8685244857670743160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8685244857670743160' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8685244857670743160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8685244857670743160'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/free-aspnet-mvc2-book.html' title='Free ASP.NET MVC2 Book'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7862712212253310701</id><published>2011-05-27T09:10:00.001+08:00</published><updated>2011-05-27T09:10:23.731+08:00</updated><title type='text'>ASP.NET Web Forms and ASP.NET MVC Video Training</title><content type='html'>&lt;p&gt;Microsoft has made the "Pluralsight &lt;em&gt;On-Demand!&lt;/em&gt;" 10 part &lt;a href=" http://asp.net/mvc"&gt;ASP.NET MVC 3 video training course&lt;/a&gt; available &lt;strong&gt;free of charge&lt;/strong&gt;. (“Essential Videos” left-hand pane).&lt;/p&gt; &lt;p&gt;Similarly, there is a 9 part &lt;a href="http://asp.net/web-forms"&gt;ASP.NET Web Forms 4 video training course&lt;/a&gt; also available for free.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7862712212253310701?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7862712212253310701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7862712212253310701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7862712212253310701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7862712212253310701'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/aspnet-web-forms-and-aspnet-mvc-video.html' title='ASP.NET Web Forms and ASP.NET MVC Video Training'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5282247335579655819</id><published>2011-05-26T08:55:00.001+08:00</published><updated>2011-05-26T08:55:28.991+08:00</updated><title type='text'>TSQL: Finding Maximum, Minimum and Average Data Row Lengths</title><content type='html'>&lt;p&gt;This is probably a classic example of if you find you are doing something complicated, there’s almost certainly a better way. It’s also an example of if you think something is genuinely useful and can’t understand why it’s not been implemented already, it probably has but you just haven’t found it yet!&lt;/p&gt; &lt;p&gt;I wanted to get a table’s approximate minimum, maximum and average row size, so after a few attempts I came up with this TSQL snippet:&lt;/p&gt; &lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt; &lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;declare&lt;/span&gt; @schemaname &lt;span class="kwrd"&gt;varchar&lt;/span&gt;(200) = &lt;span class="str"&gt;'Person'&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;declare&lt;/span&gt; @tablename  &lt;span class="kwrd"&gt;varchar&lt;/span&gt;(200) = &lt;span class="str"&gt;'Person'&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;declare&lt;/span&gt; @columnList nvarchar(&lt;span class="kwrd"&gt;max&lt;/span&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;declare&lt;/span&gt; @&lt;span class="kwrd"&gt;sql&lt;/span&gt;        nvarchar(&lt;span class="kwrd"&gt;max&lt;/span&gt;) &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;set&lt;/span&gt;  @columnList = &lt;br /&gt;stuff( &lt;br /&gt;    (    &lt;span class="kwrd"&gt;SELECT&lt;/span&gt;&lt;br /&gt;           &lt;span class="str"&gt;' + ISNULL(DATALENGTH('&lt;/span&gt; + c.name + &lt;span class="str"&gt;'),0)'&lt;/span&gt;&lt;br /&gt;     &lt;span class="kwrd"&gt;FROM&lt;/span&gt; &lt;br /&gt;        sys.tables &lt;span class="kwrd"&gt;AS&lt;/span&gt; t&lt;br /&gt;        &lt;span class="kwrd"&gt;INNER&lt;/span&gt; &lt;span class="kwrd"&gt;JOIN&lt;/span&gt; sys.columns c &lt;span class="kwrd"&gt;ON&lt;/span&gt; t.OBJECT_ID = c.OBJECT_ID &lt;br /&gt;   &lt;span class="kwrd"&gt;where&lt;/span&gt; SCHEMA_NAME(schema_id) = @schemaname &lt;span class="kwrd"&gt;and&lt;/span&gt; t.name = @tablename&lt;br /&gt;    &lt;span class="kwrd"&gt;for&lt;/span&gt; xml &lt;span class="kwrd"&gt;path&lt;/span&gt;(&lt;span class="str"&gt;''&lt;/span&gt;) &lt;br /&gt;    ) &lt;br /&gt;, 1, 3, &lt;span class="str"&gt;''&lt;/span&gt;) &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SET&lt;/span&gt; @&lt;span class="kwrd"&gt;sql&lt;/span&gt; = &lt;span class="str"&gt;'SELECT '&lt;/span&gt;&lt;span class="str"&gt;''&lt;/span&gt; + @schemaname + &lt;span class="str"&gt;'.'&lt;/span&gt; + @tablename + &lt;span class="str"&gt;''&lt;/span&gt;&lt;span class="str"&gt;' as TableName,'&lt;/span&gt; + &lt;br /&gt;           &lt;span class="str"&gt;' MIN('&lt;/span&gt; + @columnList + &lt;span class="str"&gt;') AS MinRowLength, '&lt;/span&gt; + &lt;br /&gt;           &lt;span class="str"&gt;' MAX('&lt;/span&gt; + @columnList + &lt;span class="str"&gt;') AS MaxRowLength, '&lt;/span&gt; + &lt;br /&gt;           &lt;span class="str"&gt;' AVG('&lt;/span&gt; + @columnList + &lt;span class="str"&gt;') AS AverageRowLength '&lt;/span&gt; + &lt;br /&gt;           &lt;span class="str"&gt;' FROM ['&lt;/span&gt; + @schemaname + &lt;span class="str"&gt;'].['&lt;/span&gt; + @tablename + &lt;span class="str"&gt;']'&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;EXEC&lt;/span&gt; sp_executesql @&lt;span class="kwrd"&gt;sql&lt;/span&gt;&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font size="1"&gt;[Note: It’s not 100% accurate due to some row overheads, but it is close enough for many purposes.]&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;At which point, the thought “Surely there exists a built-in method to do this?” crossed my mind, and of course there is!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;If you have sufficient permissions you can quickly produce a min, max and average row size for each table in a database (along with fragmentation information) using&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;   DBCC&lt;/span&gt; SHOWCONTIG &lt;span class="kwrd"&gt;WITH&lt;/span&gt; TABLERESULTS&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5282247335579655819?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5282247335579655819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5282247335579655819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5282247335579655819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5282247335579655819'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/tsql-finding-maximum-minimum-and.html' title='TSQL: Finding Maximum, Minimum and Average Data Row Lengths'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6497884007292425850</id><published>2011-05-25T16:52:00.001+08:00</published><updated>2011-05-25T16:52:17.796+08:00</updated><title type='text'>Online IDE for 40+ languages</title><content type='html'>&lt;p&gt;It’s not often I don’t have access to the Visual Studio IDE, but I saw Jon Skeet mention this recently on SO: &lt;a title="http://ideone.com/" href="http://ideone.com/"&gt;http://ideone.com/&lt;/a&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;What is ideone?&lt;/strong&gt;&lt;br&gt;Ideone is something more than a pastebin; it's an online compiler and debugging tool which allows&lt;br&gt;to compile and run code online in more than 40 programming languages. &lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6497884007292425850?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6497884007292425850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6497884007292425850' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6497884007292425850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6497884007292425850'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/online-ide-for-40-languages.html' title='Online IDE for 40+ languages'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2083713106409136610</id><published>2011-05-25T10:59:00.001+08:00</published><updated>2011-05-25T10:59:59.224+08:00</updated><title type='text'>The Time has Come, the Walrus said…</title><content type='html'>&lt;p&gt;A &lt;a href="http://www.microsoft.com/australia/visualstudio/vss-workshop"&gt;big push&lt;/a&gt; to move to TFS and away from Visual SourceSafe (strongly resisting urge to berate VSS!)&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_Lz1FgAF6wD0/Tdxwqos-1SI/AAAAAAAAAOY/tteVMtet8Qs/s1600-h/VSSroadshow_header_vss4.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VSSroadshow_header_vss" border="0" alt="VSSroadshow_header_vss" src="http://lh4.ggpht.com/_Lz1FgAF6wD0/TdxwroKprqI/AAAAAAAAAOc/frPiO19PDrI/VSSroadshow_header_vss_thumb2.jpg?imgmax=800" width="611" height="149"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;But what’s this? No event in Perth? Guess that means stick to VSS!! :) (OK, there is a Live Meeting…)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2083713106409136610?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2083713106409136610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2083713106409136610' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2083713106409136610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2083713106409136610'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/time-has-come-walrus-said.html' title='The Time has Come, the Walrus said…'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_Lz1FgAF6wD0/TdxwroKprqI/AAAAAAAAAOc/frPiO19PDrI/s72-c/VSSroadshow_header_vss_thumb2.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-633453226394604969</id><published>2011-05-24T09:05:00.001+08:00</published><updated>2011-05-24T09:05:35.408+08:00</updated><title type='text'>Getting Started with Visual Studio LightSwitch</title><content type='html'>&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/bethmassi/"&gt;Beth Massi&lt;/a&gt;, one of the Program Managers for LightSwitch, has posted a landing page with links for &lt;a href="http://blogs.msdn.com/b/bethmassi/archive/2011/05/12/getting-started-with-visual-studio-lightswitch.aspx"&gt;Getting started with Visual Studio LightSwitch&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The links include downloading LightSwitch and the training kit, the forums, and the official &lt;a href="http://msdn.microsoft.com/en-us/lightswitch"&gt;LightSwitch Developer Center. &lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-633453226394604969?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/633453226394604969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=633453226394604969' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/633453226394604969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/633453226394604969'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/getting-started-with-visual-studio.html' title='Getting Started with Visual Studio LightSwitch'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8143383697352631302</id><published>2011-05-22T11:23:00.002+08:00</published><updated>2011-05-23T22:22:40.026+08:00</updated><title type='text'>Large Object Heap and Arrays of Double</title><content type='html'>&lt;p&gt;If you were asked where objects greater than or equal to 85,000 bytes are allocated in .NET, you would no doubt say on the Large Object Heap (LOH). What would you say if you were asked where an array of 1000 doubles would be allocated? Currently, as of .NET 4.0, it will be allocated on the Large Object Heap!&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://omegacoder.com/?p=127"&gt;William Wegerson&lt;/a&gt; (aka OmegaMan), a C# MVP, posted this item to Connect: &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=266330&amp;amp;wa=wsignin1.0"&gt;Large Object Heap (LOH) does not behave as expected for Double array placement&lt;/a&gt; that describes and reproduces the behaviour:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="kwrd"&gt;byte&lt;/span&gt;[] arrayLessthan85K = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[84987]; &lt;span class="rem"&gt;// Note: 12 byte object overhead 84987 + 12 = 84999&lt;/span&gt;&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"byteArrayLessthan85K: {0}"&lt;/span&gt;, GC.GetGeneration(arrayLessthan85K)); &lt;span class="rem"&gt;// Returns 0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;byte&lt;/span&gt;[] array85K = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;byte&lt;/span&gt;[85000];&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"byteArray85K: {0}"&lt;/span&gt;, GC.GetGeneration(array85K)); &lt;span class="rem"&gt;// Returns 2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;double&lt;/span&gt;[] array999Double = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt;[999];&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"array999Double: {0}"&lt;/span&gt;, GC.GetGeneration(array999Double));   &lt;span class="rem"&gt;// Returns 0&lt;/span&gt;&lt;br /&gt;           &lt;br /&gt;&lt;span class="kwrd"&gt;double&lt;/span&gt;[] array1000double = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span class="kwrd"&gt;double&lt;/span&gt;[1000];&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"array1000double: {0}"&lt;/span&gt;, GC.GetGeneration(array1000double)); &lt;span style="color:#008000;"&gt;// Returns 2&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;By looking at the garbage collection generation on object creation (&lt;a href="http://msdn.microsoft.com/en-us/library/ts8yd2d0.aspx"&gt;GC.GetGeneration&lt;/a&gt;), we can identify if objects reside the LOH or not. If immediately created in generation 2 then that suggests we are in the LOH.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The reason why double arrays with 1000 or more items are allocated on the LOH is performance, due to the fact that the LOH is aligned on 8 byte boundaries. This allows faster access to large arrays and the trade-off point was determined to be 1 thousand doubles. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;According to Claudio Caldato, CLR Performance and GC Program Manager, “there’s no benefit to applying this heuristic on 64-bit architectures because doubles are already aligned on an 8-byte boundary”. Subsequent changes have been made to this heuristic that should appear in a future release of the .NET Framework.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;As a side note, the expected behaviour is seen if you use Array.CreateInstance() :&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;&lt;span class="rem"&gt;// As noticed by @Romout in the comments to that post, the same behaviour is not seen when using Array.CreateInstance()&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;double&lt;/span&gt;[] array1000doubleCreateInstance = (&lt;span class="kwrd"&gt;double&lt;/span&gt;[])Array.CreateInstance(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;double&lt;/span&gt;), 1000); &lt;span class="rem"&gt;// Returns 0&lt;/span&gt;&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"With array-create: "&lt;/span&gt; + GC.GetGeneration(array1000doubleCreateInstance));&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;// Indeed, the expected tipping point into the LOH occurs when using Array.CreateInstance&lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;// (85000 / 8) = 10625, need 12 bytes for object overhead, nearest is 16 (2*8) bytes so effectively 10623 doubles&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;double&lt;/span&gt;[] array1000doubleCreateInstance2 = (&lt;span class="kwrd"&gt;double&lt;/span&gt;[])Array.CreateInstance(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;double&lt;/span&gt;), 10623); &lt;span class="rem"&gt;// Returns 0&lt;/span&gt;&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"With array-create: "&lt;/span&gt; + GC.GetGeneration(array1000doubleCreateInstance2));&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;double&lt;/span&gt;[] array1000doubleCreateInstance3 = (&lt;span class="kwrd"&gt;double&lt;/span&gt;[])Array.CreateInstance(&lt;span class="kwrd"&gt;typeof&lt;/span&gt;(&lt;span class="kwrd"&gt;double&lt;/span&gt;), 10624); &lt;span class="rem"&gt;// Returns 2&lt;/span&gt;&lt;br /&gt;Console.WriteLine(&lt;span class="str"&gt;"With array-create: "&lt;/span&gt; + GC.GetGeneration(array1000doubleCreateInstance3));&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8143383697352631302?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8143383697352631302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8143383697352631302' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8143383697352631302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8143383697352631302'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/large-object-heap-and-arrays-of-double.html' title='Large Object Heap and Arrays of Double'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7667134548145963215</id><published>2011-05-20T13:01:00.001+08:00</published><updated>2011-05-20T13:01:35.825+08:00</updated><title type='text'>Newline in Summary XML</title><content type='html'>&lt;p&gt;You probably know this already, but just in case you don’t! If you want line breaks in your popup tooltip descriptions in Visual Studio, you add the &amp;lt;para&amp;gt; element to your XML summary comments e.g.:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;/// Main comment &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;/// &amp;lt;para&amp;gt;Line 1&amp;lt;/para&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;/// &amp;lt;para&amp;gt;Line 2&amp;lt;/para&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;bool&lt;/span&gt; SomeProperty { get; set; }&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;and it appears like this:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Lz1FgAF6wD0/TdX1q8-H6DI/AAAAAAAAAOQ/2-OpOtvlELw/s1600-h/VSToolTip7.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="VSToolTip" border="0" alt="VSToolTip" src="http://lh5.ggpht.com/_Lz1FgAF6wD0/TdX1rsXNdYI/AAAAAAAAAOU/zCIHd7xYxTk/VSToolTip_thumb5.png?imgmax=800" width="191" height="87"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7667134548145963215?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7667134548145963215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7667134548145963215' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7667134548145963215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7667134548145963215'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/newline-in-summary-xml.html' title='Newline in Summary XML'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_Lz1FgAF6wD0/TdX1rsXNdYI/AAAAAAAAAOU/zCIHd7xYxTk/s72-c/VSToolTip_thumb5.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-890239536473973854</id><published>2011-05-14T12:07:00.001+08:00</published><updated>2011-05-14T12:07:39.286+08:00</updated><title type='text'>SQL Server Compact Toolbox</title><content type='html'>&lt;p&gt;If you are using SQL Server Compact Edition (CE), and have not seen this already, the &lt;a href="http://sqlcetoolbox.codeplex.com/"&gt;SQL Server Compact Toolbox&lt;/a&gt; is a Visual Studio 2010 Pro or higher add-in (for SQL Server CE 3.5/4.0) and standalone app (for 4.0), that adds scripting, import, export, migrate, rename, run script, manage replication and more to your SQL Server Compact Data Connections in VS Server Explorer.&lt;/p&gt; &lt;p&gt;Written by Erik Ejlskov Jensen who’s aptly named blog, &lt;a href="http://erikej.blogspot.com/ "&gt;Everything SQL Server Compact&lt;/a&gt;, contains a wealth of tips, tricks and techniques relating to SQL Server Compact.&lt;/p&gt; &lt;p&gt;The toolbox adds several features to Server Explorer:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Scripting:&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;/strong&gt; &lt;ul&gt; &lt;li&gt;Script tables, including data, both DDL and DML  &lt;li&gt;Script entire schema, optionally with data, from SQL Server Compact and SQL Server 2005/2008 databases  &lt;li&gt;Import to SQL Server Compact from a SQL Server 2005/2008 database or a CSV file  &lt;li&gt;Migrate from SQL Server Compact to SQL Server and SQL Azure  &lt;li&gt;Migrate from SQL Server to SQL Server Compact  &lt;li&gt;Create database diff scripts, compare with a SQL Server Compact or even a SQL Server database&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Query editing:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Basic, free form query execution  &lt;li&gt;Editor with syntax colouring  &lt;li&gt;Parse SQL scripts  &lt;li&gt;Display graphical estimated and actual execution plan  &lt;li&gt;Check query duration&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Other features:&lt;/strong&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Rename tables  &lt;li&gt;Generate detailed DGML files for visualizing table columns and relationships (requires VS 2010 Premium or higher to view)  &lt;li&gt;Generate an Entity Data Model (EDMX) in the current project for both 3.5 and 4.0 in any applicable project (WPF, WinForms, Class Library)  &lt;li&gt;Remove invalid connection definitions from the Toolbox (and Server Explorer)  &lt;li&gt;Create and manage SQL Server Merge Replication subscriptions  &lt;li&gt;Data types node with documentation tooltips lists the 18 available data types  &lt;li&gt;File version check (for version 2-4)  &lt;li&gt;Upgrade version 3.x files to version 4 via the "Add version 4 connection" dialog  &lt;li&gt;About dialog with detailed SQL Server Compact version information&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Another of his posts, &lt;a href="http://erikej.blogspot.com/2009/04/sql-compact-3rd-party-tools.html"&gt;SQL Compact 3rd party tools&lt;/a&gt;, lists several 3rd party tools for CE, both commercial and non-commercial.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-890239536473973854?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/890239536473973854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=890239536473973854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/890239536473973854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/890239536473973854'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/sql-server-compact-toolbox.html' title='SQL Server Compact Toolbox'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3926135893555487801</id><published>2011-05-12T12:55:00.000+08:00</published><updated>2011-05-14T04:46:57.915+08:00</updated><title type='text'>SQL Server 2008: Query Hash Statistics</title><content type='html'>&lt;p&gt;&lt;a href="http://blogs.msdn.com/b/bartd/"&gt;Bart Duncan&lt;/a&gt; has released a very useful addition to the DataCollector capture/reporting abilities of SQL Server 2008. &lt;a href="http://archive.msdn.microsoft.com/QueryHashStatistics"&gt;Query Hash Statistics&lt;/a&gt; can do low-overhead query cost monitoring, utilising the &lt;a href="http://blogs.msdn.com/b/bartd/archive/2008/09/03/query-fingerprints-and-plan-fingerprints_3a00_-the-best-new-sql-2008-feature-you_2700_ve-never-heard-of.aspx"&gt;query fingerprint&lt;/a&gt; and query plan fingerprint (aka query hash/query plan hash) features that were added in SQL Server 2008. Query fingerprints enable you to get the cumulative cost of all executions of a query &lt;i&gt;even if the query is non-parameterized&lt;/i&gt; and has different inline literal values for each execution. Previously, the only way to get this type of query performance data was to capture a Profiler trace and run the trace through a post-processing tool.&lt;/p&gt; &lt;p&gt;Once installed, and sufficient data has been collected, you can access the collected information via 2 custom reports.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_Lz1FgAF6wD0/TctoVoaiTLI/AAAAAAAAAOI/_95TWN70-LQ/s1600-h/queryHash1%5B5%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="queryHash1" border="0" alt="queryHash1" src="http://lh6.ggpht.com/_Lz1FgAF6wD0/TctoW0t_IvI/AAAAAAAAAOM/Pa12--1wgfY/queryHash1_thumb%5B3%5D.png?imgmax=800" width="570" height="356"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3926135893555487801?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3926135893555487801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3926135893555487801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3926135893555487801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3926135893555487801'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/sql-server-2008-query-hash-statistics.html' title='SQL Server 2008: Query Hash Statistics'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_Lz1FgAF6wD0/TctoW0t_IvI/AAAAAAAAAOM/Pa12--1wgfY/s72-c/queryHash1_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3552554986390287503</id><published>2011-05-08T09:06:00.001+08:00</published><updated>2011-05-08T09:06:03.324+08:00</updated><title type='text'>Perth .NET User Group Meeting: 6pm Thurs, 12th May: Introduction to the .NET Reactive Extensions (Rx) with Lee Campbell and James Miles</title><content type='html'>&lt;p&gt;Join us at the Perth .NET user group, Thurs May 12&lt;sup&gt;th &lt;/sup&gt;(6pm) where Lee Campbell and James Miles join up to present an Introduction to Rx, aka the .NET Reactive Extensions. Rx is a product from Erik Meijer's team at Microsoft that allows you to compose asynchronous and event based programs using observable collections and a Linq style syntax. &lt;p&gt;The presenters will guide you through the background and basics of Rx, and introduce you to the terminology that is peculiar to Rx. James and Lee will compare code written with and without Rx and show case code to demonstrate the power of Rx in the areas of resource management, fluent and familiar Linq syntax, composable nature, testability of asynchronous and concurrent queries, and the and the ability to tame side effects. &lt;p&gt;&lt;b&gt;&lt;/b&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; Introduction to the .NET Reactive Extensions (Rx) with Lee Campbell and James Miles&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, May 12th, &lt;b&gt;6:00pm&lt;/b&gt; - 7:30pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I’m under strict instructions to ask everyone to &lt;b&gt;come armed with questions about Rx!&lt;/b&gt; &lt;p&gt;&lt;b&gt;&lt;font size="3"&gt;Please Note:&lt;/font&gt; &lt;/b&gt;this talk will start at 6pm (not our usual time of 5:30pm due to the venue’s availability) &lt;p&gt;Full details here: &lt;a title="http://perthdotnet.org/blogs/events/archive/2011/05/07/introduction-to-the-net-reactive-extensions-rx-with-lee-campbell-and-james-miles.aspx" href="http://perthdotnet.org/blogs/events/archive/2011/05/07/introduction-to-the-net-reactive-extensions-rx-with-lee-campbell-and-james-miles.aspx"&gt;http://perthdotnet.org/blogs/events/archive/2011/05/07/introduction-to-the-net-reactive-extensions-rx-with-lee-campbell-and-james-miles.aspx&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3552554986390287503?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3552554986390287503/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3552554986390287503' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3552554986390287503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3552554986390287503'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/perth-net-user-group-meeting-6pm-thurs.html' title='Perth .NET User Group Meeting: 6pm Thurs, 12th May: Introduction to the .NET Reactive Extensions (Rx) with Lee Campbell and James Miles'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4139563132821480853</id><published>2011-05-04T21:55:00.001+08:00</published><updated>2011-05-04T21:55:44.448+08:00</updated><title type='text'>Reminder: Perth .NET User Group: ASP.NET MVC framework with Michael Minutillo</title><content type='html'>&lt;p&gt;Scott Hanselman is fond of saying that programming components are like Lego pieces and right now "the lego pieces coming out of Microsoft are the right size". One important piece of the web stack is the ASP.NET MVC framework. Since its initial release in March 2009 there has been a new version of the framework released every year and it has quickly become the platform of choice for .NET developers creating web sites. January 2011 saw the version 3.0 release which introduces a number of changes and new features. Additionally, at the MIX11 conference earlier this month Microsoft released the "MVC3 tools refresh" which make developing MVC3 applications in Visual Studio 2010 a highly productive experience.  &lt;p&gt;Join us at the Perth .NET user group, Thurs May 5&lt;sup&gt;th&lt;/sup&gt;, where we will look at the new Razor View Engine, Unobtrusive Javascript, Integrated Scaffolding, better support for IoC integration. We will also touch on SQL CE 4, NuGet and Entity Framework 4.1 (Magic Unicorns Editions). Come and see the Lego pieces and be inspired by what you can build.  &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; &lt;b&gt;ASP.NET MVC framework with Michael Minutillo&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, May 5th, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Mike Minutillo is .NET software engineer with a B.Sc. in computer science. In 2000, Mike started writing .NET software to fund his university studies and has been an active member of the .NET community ever since. Mike is a regular attendee at the Perth .NET Community of Practice where he has given presentations on new features of C#, ASP.NET MVC and Test-Driven Philosophy. In 2009 he started the Perth ALT.NET user group which meets monthly to discuss software engineering tools and practices in the .NET development space. Mike is co-author of Professional Visual Studio 2010. He maintains a technical blog at &lt;a href="http://wolfbyte-net.blogspot.com/"&gt;http://wolfbyte-net.blogspot.com/&lt;/a&gt; and can be contacted at http://twitter.com/wolfbyte/.  &lt;p&gt;There will be a door prize of a choice of license from &lt;a href="http://perthdotnet.org/controlpanel/blogs/www.jetbrains.com"&gt;JetBrains&lt;/a&gt; (one of ReSharper , TeamCity Build Agent, dotTrace Profiler, dotCover , RubyMine, IntelliJ IDEA, PyCharm).  &lt;p&gt;&lt;a href="http://blogs.msdn.com/acoat"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4139563132821480853?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4139563132821480853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4139563132821480853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4139563132821480853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4139563132821480853'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/05/reminder-perth-net-user-group-aspnet.html' title='Reminder: Perth .NET User Group: ASP.NET MVC framework with Michael Minutillo'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3336324910529382306</id><published>2011-04-26T17:48:00.001+08:00</published><updated>2011-04-26T17:48:45.299+08:00</updated><title type='text'>When to avoid CQRS</title><content type='html'>&lt;p&gt;Interesting &lt;a href="http://www.udidahan.com/2011/04/22/when-to-avoid-cqrs/"&gt;post&lt;/a&gt; from Udi Dahan (who was previously an exponent of CQRS):&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;“It looks like that CQRS has finally “made it” as a full blown “best practice”.&lt;/p&gt; &lt;p&gt;Please accept my apologies for my part in the overly-complex software being created because of it.&lt;/p&gt; &lt;p&gt;I’ve tried to do what I could to provide a balanced view on the topic with posts like &lt;a href="http://www.udidahan.com/2009/12/09/clarified-cqrs/"&gt;Clarified CQRS&lt;/a&gt; and &lt;a href="http://www.udidahan.com/2010/08/31/race-conditions-dont-exist/"&gt;Race Conditions Don’t Exist&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;It looks like that wasn’t enough, so I’ll go right out and say it:&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Most people using CQRS (and &lt;a href="http://codebetter.com/gregyoung/2010/02/20/why-use-event-sourcing/"&gt;Event Sourcing&lt;/a&gt; too) shouldn’t have done so.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Should we really go back to N-Tier?&lt;/strong&gt; When not using CQRS (which is the majority of the time), you don’t need N-Tier either…&lt;/p&gt; &lt;p&gt;. . .&lt;/p&gt;&lt;/blockquote&gt; &lt;h5&gt;&lt;/h5&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;In Summary&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;So, when should you avoid CQRS?&lt;/p&gt; &lt;p&gt;The answer is most of the time.”&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3336324910529382306?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3336324910529382306/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3336324910529382306' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3336324910529382306'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3336324910529382306'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/when-to-avoid-cqrs.html' title='When to avoid CQRS'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4705829461698066360</id><published>2011-04-09T17:40:00.001+08:00</published><updated>2011-04-09T17:40:16.118+08:00</updated><title type='text'>SQL Server: How to Share Data Between Stored Procedures</title><content type='html'>&lt;p&gt;&lt;a href="http://www.sommarskog.se/index.html"&gt;Erland Sommarskog&lt;/a&gt; has an excellent SQL Server article “&lt;a href="http://www.sommarskog.se/share_data.html"&gt;How to Share Data Between Stored Procedures&lt;/a&gt;” tackling these two questions:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;i&gt;How can I use the result set from one stored procedure in another&lt;/i&gt;, also expressed as&lt;i&gt; How can I use the result set from a stored procedure in a &lt;small&gt;SELECT&lt;/small&gt; statement? &lt;/i&gt; &lt;li&gt;&lt;i&gt;How can I pass a table as a parameter from one stored procedure to another? &lt;/i&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;He discusses several methods, and points out their advantages and disadvantages. [Adding here so I remember where to find it in future!]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4705829461698066360?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4705829461698066360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4705829461698066360' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4705829461698066360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4705829461698066360'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/sql-server-how-to-share-data-between.html' title='SQL Server: How to Share Data Between Stored Procedures'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-757508684348725708</id><published>2011-04-06T22:17:00.001+08:00</published><updated>2011-04-06T22:17:09.367+08:00</updated><title type='text'>SQL Server: Summary of Join Properties</title><content type='html'>&lt;p&gt;An oldie but a goldie: a nice &lt;a href=" http://blogs.msdn.com/b/craigfr/archive/2006/08/16/702828.aspx"&gt;Summary of Join Properties&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-757508684348725708?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/757508684348725708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=757508684348725708' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/757508684348725708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/757508684348725708'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/sql-server-summary-of-join-properties.html' title='SQL Server: Summary of Join Properties'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3368664504760835724</id><published>2011-04-06T18:27:00.001+08:00</published><updated>2011-04-06T18:27:26.899+08:00</updated><title type='text'>SSMS Table Column List Tip</title><content type='html'>&lt;p&gt;On occasion, you will be at someone’s desk, looking over their shoulder when you suddenly notice something and exclaim “Hold on! How did you do that?” quickly followed by “I can’t believe I didn’t know about that!”.&lt;/p&gt; &lt;p&gt;I had just such an experience a few days ago. At the risk of being the last person to know this: in SQL Server Management Studio Object Explorer: open a Database, open the Tables folder, and open a Table. Left click on the Column list folder, and drag and drop to an open query window: you get a comma separated list of column names.&lt;/p&gt; &lt;p&gt;In the past, I had always right-clicked on the table, selected Script-&amp;gt;Create To-&amp;gt;New query window and then edited out the list of columns.&amp;nbsp; D’oh!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3368664504760835724?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3368664504760835724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3368664504760835724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3368664504760835724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3368664504760835724'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/ssms-table-column-list-tip.html' title='SSMS Table Column List Tip'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5086365478309173772</id><published>2011-04-04T13:37:00.001+08:00</published><updated>2011-04-04T13:37:50.721+08:00</updated><title type='text'>Reminder: Perth .NET User Group Meeting: Thurs 7th April, 5:30pm: LightSwitch- with Andrew Coates</title><content type='html'>&lt;p&gt;Join us at the Perth .NET User Group Thurs, April 7th where Andrew Coates will demonstrate &lt;a href="http://msdn.com/lightswitch"&gt;LightSwitch&lt;/a&gt;, a new product in the Visual Studio family aimed at developers who want to easily create business applications for the desktop or the cloud. LightSwitch simplifies the development process by letting you concentrate on the business logic, while LightSwitch handles the common tasks for you. In this demo-heavy session, you will see, end-to-end, how to build and deploy a data-centric business application using LightSwitch. We’ll also go beyond the basics of creating simple screens over data and demonstrate how to create screens with more advanced capabilities  &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LightSwitch with Andrew Coates  &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thursday, April 7th, 5:30pm - 7:00pm  &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Enex 100 Seminar Room, Level 3, 100 St Georges Terrace, Perth  &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;Andrew Coates&lt;/b&gt; is a Developer Evangelist for Microsoft in Australia. Before joining Microsoft, Andrew was an independent consultant specialising in database applications using Microsoft technologies including SQL Server, Visual FoxPro and Microsoft Office. Andrew's wide range of experience includes telecommunications, SMB inventory, dispatch and accounting systems, using both web and rich client front ends. He has developed and delivered class room training and has mentored a number of developers in Visual FoxPro and SQL Server technologies. Andrew has spoken at international conferences on Geographical Information Systems, health statistics and database maintenance and is a regular presenter at TechEd both locally and internationally. An MCPD, MCTS and MCSD, Andrew also holds a Masters degree in Civil Engineering. Andrew blogs at &lt;a href="http://blogs.msdn.com/acoat"&gt;http://blogs.msdn.com/acoat&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5086365478309173772?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5086365478309173772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5086365478309173772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5086365478309173772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5086365478309173772'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/reminder-perth-net-user-group-meeting.html' title='Reminder: Perth .NET User Group Meeting: Thurs 7th April, 5:30pm: LightSwitch- with Andrew Coates'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6492618527891257701</id><published>2011-04-04T09:36:00.001+08:00</published><updated>2011-04-04T09:36:27.580+08:00</updated><title type='text'>Get Started with SQL Azure</title><content type='html'>&lt;p&gt;Want to get started with SQL Azure but not keen on setting up an account using your credit card details?&lt;/p&gt; &lt;p&gt;Well you can, by signing up for a &lt;a href="http://windowsazurepass.com/"&gt;30 day SQL Azure pass&lt;/a&gt; for free with no credit card required (you get two 1GB Web Edition databases for one month). You can find the promo code at the &lt;a href="http://www.microsoft.com/en-us/sqlazure/Community/getstarted.aspx"&gt;Get Started with SQL Azure&lt;/a&gt; page.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6492618527891257701?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6492618527891257701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6492618527891257701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6492618527891257701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6492618527891257701'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/04/get-started-with-sql-azure.html' title='Get Started with SQL Azure'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3678530114631481763</id><published>2011-03-28T08:41:00.001+08:00</published><updated>2011-03-28T08:41:31.412+08:00</updated><title type='text'>Useful Codeplex Libraries</title><content type='html'>&lt;p&gt;I recently came across two useful codeplex libraries. The first enables you to create advanced Excel 2007/2010 spreadsheets without Office installed, &lt;a href="http://epplus.codeplex.com/"&gt;EppPlus&lt;/a&gt;:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;EPPlus is a .Net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx). &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The second is a .NET wrapper of the ImageMagick image manipulation API, &lt;a href="http://imagemagick.codeplex.com/"&gt;ImageMagick.NET&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3678530114631481763?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3678530114631481763/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3678530114631481763' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3678530114631481763'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3678530114631481763'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/useful-codeplex-libraries.html' title='Useful Codeplex Libraries'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4552886763829057793</id><published>2011-03-27T08:57:00.001+08:00</published><updated>2011-03-27T08:57:02.242+08:00</updated><title type='text'>Quotes: When there is no…</title><content type='html'>&lt;p&gt;&lt;em&gt;When there is no&lt;/em&gt; wind ... ROW!&amp;nbsp; - Latin Proverb&lt;/p&gt; &lt;p&gt;&lt;em&gt;When there is no&lt;/em&gt; peril in the fight there is no glory in the triumph. - Pierre Corneille &lt;b&gt;&lt;/b&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;When there is no&lt;/em&gt; enemy within, the enemies outside cannot hurt you. - African Proverb (often attributed to Winston Churchill)&lt;/p&gt; &lt;p&gt;Real love is a pilgrimage. It happens &lt;em&gt;when there is no&lt;/em&gt; strategy, but it is very rare because most people are strategists. – Anita Brookner&lt;/p&gt; &lt;p&gt;Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away - Antoine de Saint Exupéry&lt;/p&gt; &lt;p&gt;Laws and principles are not for the times &lt;em&gt;when there is no&lt;/em&gt; temptation: they are for such moments as this, when body and soul rise in mutiny against their rigour; stringent are they; inviolate they shall be. - Jane Eyre in &lt;em&gt;Charlotte Bronte&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;&lt;em&gt;When there is no&lt;/em&gt; vision the people perish. - Franklin Delano Roosevelt&lt;img border="0" alt="" src="https://www.assoc-amazon.com/e/ir?t=ablereach-20&amp;amp;l=ur2&amp;amp;o=1" width="1" height="1"&gt; (from his first inaugural address)&lt;img border="0" alt="" src="https://www.assoc-amazon.com/e/ir?t=ablereach-20&amp;amp;l=ur2&amp;amp;o=1" width="1" height="1"&gt;&lt;/p&gt; &lt;p&gt;It is hard to apply oneself to study &lt;em&gt;when there is no&lt;/em&gt; money to pay for food and lodging. - Zora Neale Hurston&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4552886763829057793?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4552886763829057793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4552886763829057793' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4552886763829057793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4552886763829057793'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/quotes-when-there-is-no.html' title='Quotes: When there is no…'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1800223694384104089</id><published>2011-03-26T15:02:00.001+08:00</published><updated>2011-03-26T15:02:50.626+08:00</updated><title type='text'>Microsoft Virtual Academy</title><content type='html'>&lt;p&gt;Microsoft (and just about everyone else) has a cloud focus these days, so it's no surprise that Microsoft Learning has also ventured there. Last week saw the official debut of the &lt;a href="http://www.microsoftvirtualacademy.com/"&gt;Microsoft Virtual Academy&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;The Microsoft Virtual Academy is targeted at the cloud, with self-paced courses for learning more about private and public clouds, to more specific coverage of Windows Azure and SQL Azure.&lt;/p&gt; &lt;p&gt;MVA requires membership, but it's free. Check out the &lt;a href="http://www.microsoftvirtualacademy.com/FAQs.aspx"&gt;FAQ here&lt;/a&gt; to find out more and &lt;a href="http://www.microsoftvirtualacademy.com/GetStarted.aspx"&gt;get started&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1800223694384104089?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1800223694384104089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1800223694384104089' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1800223694384104089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1800223694384104089'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/microsoft-virtual-academy.html' title='Microsoft Virtual Academy'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1200968147341500546</id><published>2011-03-09T12:24:00.002+08:00</published><updated>2011-03-09T12:33:04.439+08:00</updated><title type='text'>Visual Studio 2010 Service Pack 1 Released</title><content type='html'>Visual Studio 2010 SP1 RTM has been released for MSDN subscribers!  Get it &lt;a href="https://msdn.microsoft.com/en-us/subscriptions/securedownloads/default.aspx"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It will be made generally available over the next day or so.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1200968147341500546?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1200968147341500546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1200968147341500546' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1200968147341500546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1200968147341500546'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/visual-studio-2010-service-pack-1.html' title='Visual Studio 2010 Service Pack 1 Released'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5830283301879673258</id><published>2011-03-07T10:03:00.002+08:00</published><updated>2011-03-07T10:04:40.959+08:00</updated><title type='text'>Binary Search: A Cautionary Tale!</title><content type='html'>&lt;p&gt;Practically every developer knows what binary search is: a simple (indeed fundamental) searching algorithm which is an example of a natural divide-and-conquer strategy. Basically: starting with an already sorted array, compare the middle element of the array with the value we want to find. If the values are the same we are done, else if the array element is larger, repeat in the remaining lower half of the array, else if the array element is smaller, repeat in the remaining upper half of the array.&lt;/p&gt;&lt;p&gt;Unsurprisingly, binary search is an often used interview question (although perhaps less so, due to increasing complexity and the proliferation of programming frameworks; I must admit I’ve never personally been asked about it in an interview). It is a basic technique that you can reasonably expect every reasonable candidate to know and can be implemented in just a few lines of code. &lt;/p&gt;&lt;p&gt;Despite binary search’s simplicity, it is easy to implement it incorrectly!&lt;/p&gt;&lt;p&gt;Jon Bentley, in his book &lt;a href="http://www.cs.bell-labs.com/cm/cs/pearls/"&gt;Programming Pearls&lt;/a&gt; (a programming classic), wrote that in a course he ran for professional programmers, he asked the participants to code binary search and found that 90% failed to implement it correctly. If you asked 100 programmers to write an implementation of binary search a large number of them would be incorrect and many of those those that apparently worked would actually contain subtle flaws. Indeed, many published implementations of binary search are wrong:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;“a study reported that it is correctly implemented in only &lt;em&gt;five out of twenty&lt;/em&gt; textbooks.” &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Indeed, Jon Bentley’s own implementation of binary search, published in the ‘Writing Correct Programs’ chapter of Programming Pearls, contained a subtle bug that remained undetected for over twenty years. Here is an iterative C# implementation, adapted from Bentley’s pseudocode, that contains the bug (can you spot it?):&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;div style="BACKGROUND: white;font-family:courier new;font-size:9pt;color:black;"   &gt;&lt;p style="MARGIN: 0px"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color:blue;"&gt;int&lt;/span&gt; BinarySearch(&lt;span style="color:blue;"&gt;int&lt;/span&gt;[] sortedArray, &lt;span style="color:blue;"&gt;int&lt;/span&gt; valueToFind)&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;{&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    &lt;span style="color:blue;"&gt;int&lt;/span&gt; lower = 0;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    &lt;span style="color:blue;"&gt;int&lt;/span&gt; upper = sortedArray.Length - 1;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    &lt;span style="color:blue;"&gt;int&lt;/span&gt; m;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    &lt;span style="color:blue;"&gt;while&lt;/span&gt; (lower &amp;lt;= upper)&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    {&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        m = (lower + upper) / 2;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        &lt;span style="color:blue;"&gt;if&lt;/span&gt; (sortedArray[m] &amp;lt; valueToFind)&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;            lower = m + 1;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        &lt;span style="color:blue;"&gt;else&lt;/span&gt; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (sortedArray[m] == valueToFind)&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;            &lt;span style="color:blue;"&gt;return&lt;/span&gt; m;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        &lt;span style="color:blue;"&gt;else&lt;/span&gt;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        {&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;            upper = m - 1;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;        }&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    }&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt; &lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;    &lt;span style="color:blue;"&gt;return&lt;/span&gt; -1;&lt;/p&gt;&lt;p style="MARGIN: 0px"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;.&lt;/p&gt;&lt;p&gt;. &lt;/p&gt;&lt;p&gt;…Scroll down…&lt;/p&gt;&lt;p&gt;.&lt;/p&gt;&lt;p&gt;.&lt;/p&gt;&lt;p&gt;The bug is in the mid-point assignment &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;m = (lower + upper)/2 &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;p&gt;which performed as a direct sum could lead to an integer overflow. It should be replaced by the identically equivalent safe expression&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;m = lower + (upper – lower)/2&lt;/span&gt;&lt;/pre&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;p&gt;This bug was highlighted in Chapter 1 of &lt;a href="http://www.algorithmsforinterviews.com/"&gt;Algorithms for Interviews&lt;/a&gt;, IMO, a slightly misnamed book which could perhaps be better described as ‘Algorithms to make programmers think’, where the emphasis is on describing problems and getting the reader to attempt to solve them.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;[&lt;strong&gt;Side Note&lt;/strong&gt;: A quick check with Reflector shows that this is implemented correctly without the possible overflow flaw in .NET 4, in fact the developers have gone put of their way to make sure someone doesn’t introduce this bug by encapsulating the mid-point division in its own Method GetMedian()]&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5830283301879673258?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5830283301879673258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5830283301879673258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5830283301879673258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5830283301879673258'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/binary-search-cautionary-tale.html' title='Binary Search: A Cautionary Tale!'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-195475765866457245</id><published>2011-03-03T07:49:00.001+08:00</published><updated>2011-03-03T07:49:17.483+08:00</updated><title type='text'>SQL Server: Optimizing tempdb Performance : Moving tempDB to a New Location</title><content type='html'>&lt;p&gt;The size of &lt;strong&gt;tempdb&lt;/strong&gt; can affect the performance of a system. For example, if the &lt;strong&gt;tempdb&lt;/strong&gt; size is too small, the system processing could be too occupied with autogrowing the database to support your workload requirement every time that you start SQL Server. You can avoid this overhead by pre-sizing &lt;strong&gt;tempdb&lt;/strong&gt;. For more information, see &lt;a href="http://msdn.microsoft.com/en-us/library/ms175527.aspx"&gt;Optimizing tempdb Performance&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms345368.aspx"&gt;Capacity Planning for tempdb&lt;/a&gt;.  &lt;p&gt;Optimizing tempdb Performance  &lt;ul&gt; &lt;li&gt; &lt;p&gt;Preallocate space for all tempdb files by setting the file size to a value large enough to accommodate the typical workload for the environment. This prevents tempdb from expanding too frequently, which can adversely affect performance. The tempdb database should be also set to autogrow,&lt;em&gt; just in case&lt;/em&gt; of unplanned growth. But ideally, any tempDB expansions should be rare.&lt;/p&gt; &lt;li&gt; &lt;p&gt;Put tempdb on a fast I/O subsystem.&amp;nbsp; Use RAID 10 if there are sufficient directly attached disks available. Consider using directly attached Solid State Disks (SSD), such as a FusionIO drive.&lt;/p&gt; &lt;li&gt; &lt;p&gt;Create multiple data files to maximize disk bandwidth. Using multiple data files can reduce tempdb contention and yields significantly better scalability. However, do not create &lt;em&gt;too many&lt;/em&gt; files because this can reduce performance and increase management overhead. As a general guideline, &lt;strong&gt;create as many data files as 1/2 – 1/4 times the number of CPU cores&lt;/strong&gt;. [Note that a quad-core CPU is considered to be four CPUs.]&lt;/p&gt; &lt;li&gt; &lt;p&gt;Make each data file exactly the same size; this allows for optimal proportional-fill performance. Consider tuning on Trace Flag -T1116&lt;/p&gt; &lt;li&gt; &lt;p&gt;Put the tempdb database on disks (physical spindles) separate from those used by user databases.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you're seeing PAGELATCH (not PAGEIOLATCH) waits on tempdb, then you can mitigate these using trace flag 1118 and creating multiple tempdb data files. Paul Randal wrote a blog post debunking some myths around this trace flag and why it's still potentially required in SQL 2005 and 2008 - &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Misconceptions-around-TF-1118.aspx"&gt;Misconceptions around TF 1118&lt;/a&gt;.  &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;-- 1.Determine the logical file names of the tempdb database and current location on disk. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; name, physical_name &lt;span class="kwrd"&gt;AS&lt;/span&gt; CurrentLocation&lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; sys.master_files&lt;br /&gt;&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; database_id = DB_ID(N&lt;span class="str"&gt;'tempdb'&lt;/span&gt;);&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- 2.Change the location of each file using ALTER DATABASE.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;USE&lt;/span&gt; master;&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;ALTER&lt;/span&gt; &lt;span class="kwrd"&gt;DATABASE&lt;/span&gt; tempdb &lt;br /&gt;&lt;span class="kwrd"&gt;MODIFY&lt;/span&gt; &lt;span class="kwrd"&gt;FILE&lt;/span&gt; (NAME = tempdev, FILENAME = &lt;span class="str"&gt;'D:\Data\tempdb.mdf'&lt;/span&gt;, &lt;span class="kwrd"&gt;SIZE&lt;/span&gt; = 512MB, FILEGROWTH = 128MB);&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;ALTER&lt;/span&gt; &lt;span class="kwrd"&gt;DATABASE&lt;/span&gt; tempdb &lt;br /&gt;&lt;span class="kwrd"&gt;MODIFY&lt;/span&gt; &lt;span class="kwrd"&gt;FILE&lt;/span&gt; (NAME = templog, FILENAME = &lt;span class="str"&gt;'D:\Logs\templog.ldf'&lt;/span&gt;, &lt;span class="kwrd"&gt;SIZE&lt;/span&gt; = 64MB, FILEGROWTH = 64MB);&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- 3.Stop and restart the instance of SQL Server. &lt;/span&gt;&lt;br /&gt;net stop "&lt;span class="kwrd"&gt;SQL&lt;/span&gt; Server" &lt;br /&gt;&lt;span class="kwrd"&gt;-- or&lt;/span&gt; &lt;br /&gt;net stop "&lt;span class="kwrd"&gt;SQL&lt;/span&gt; Server (namedinstance)"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- 4.Verify the file change.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; name, physical_name &lt;span class="kwrd"&gt;AS&lt;/span&gt; CurrentLocation, state_desc&lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; sys.master_files&lt;br /&gt;&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; database_id = DB_ID(N&lt;span class="str"&gt;'tempdb'&lt;/span&gt;);&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-195475765866457245?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/195475765866457245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=195475765866457245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/195475765866457245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/195475765866457245'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/sql-server-optimizing-tempdb.html' title='SQL Server: Optimizing tempdb Performance : Moving tempDB to a New Location'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8735795704080699671</id><published>2011-03-02T17:52:00.001+08:00</published><updated>2011-03-02T17:52:31.846+08:00</updated><title type='text'>How to Write Without Writing</title><content type='html'>&lt;p&gt;I’ve long admired (perhaps even envied) Jeff Atwood’s ability to craft interesting, informative and thought provoking articles on his ‘Coding Horror’ blog. His recent post &lt;a href="http://www.codinghorror.com/blog/2011/02/how-to-write-without-writing.html"&gt;How to Write Without Writing&lt;/a&gt; is a great example why.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Over the last 6 years, I've come to believe deeply in the idea that that becoming a great programmer has very little to do with &lt;i&gt;programming&lt;/i&gt;. Yes, it takes a modicum of technical skill and dogged persistence, absolutely. But even more than that, it takes &lt;a href="http://www.joelonsoftware.com/articles/CollegeAdvice.html"&gt;serious communication skills&lt;/a&gt;: &lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;The difference between a tolerable programmer and a great programmer is not how many programming languages they know, and it's not whether they prefer Python or Java. &lt;b&gt;It's whether they can communicate their ideas.&lt;/b&gt; By persuading other people, they get leverage. By writing clear comments and technical specs, they let other programmers understand their code, which means other programmers &lt;em&gt;can use and work with their code instead of rewriting it&lt;/em&gt;. Absent this, their code is worthless. [Joel Spolsky]&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The ability to inform, entertain and present connected ideas is a wonderful skill.&lt;/p&gt; &lt;p&gt;Personally, I’ve always found writing difficult (though perhaps less so in the last 5 years).The main reason I started blogging was to improve my writing (and also to record things I find useful and tend to misplace!). If you set yourself a goal of writing a short blog post once a week, you are forcing yourself to write something. The more often you write, the more likely your writing skills will improve.&lt;/p&gt; &lt;p&gt;Some time ago I answered a question on StackOverflow: &lt;a href="http://stackoverflow.com/questions/170259/should-programmers-be-able-to-write-clearly/170261#170261"&gt;Should programmers be able to write clearly?&lt;/a&gt; I firmly believe the answer to that question is “Yes”. If you can’t communicate and express yourself clearly, how can you write correct code?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8735795704080699671?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8735795704080699671/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8735795704080699671' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8735795704080699671'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8735795704080699671'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/03/how-to-write-without-writing.html' title='How to Write Without Writing'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5724844182303549202</id><published>2011-02-27T13:03:00.004+08:00</published><updated>2011-02-28T13:49:16.148+08:00</updated><title type='text'>Powershell: Get SQL Server Default File Paths using SMO</title><content type='html'>&lt;p&gt;I recently needed to find the location of SQL Server’s default data file path in order to create multiple database data files as part of an automated production install. After looking at and discarding a few options that included reading the registry directly, &lt;a href="http://msdn.microsoft.com/en-us/library/ms162169.aspx"&gt;SQL Server Management Objects&lt;/a&gt; (SMO) seemed a logical choice. Talking to one of my colleagues, &lt;a href="http://piers7.blogspot.com/"&gt;Piers&lt;/a&gt;, whose Powershell wizardary has to be experienced to fully appreciate, we (well he!) fired up a Powershell GUI and we took a look at the methods available. &lt;/p&gt;&lt;p&gt;As an aside, if you are not aware of this ‘trick’ it’s worth explicitly mentioning:&lt;/p&gt;&lt;p&gt;In Powershell, first load the relevant assembly into memory (which in this instance is&lt;span style="color:#006080;"&gt; &lt;span style="font-family:Courier New;"&gt;Microsoft.SqlServer.Smo&lt;/span&gt;&lt;/span&gt;):&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;  &amp;gt; [reflection.assembly]::LoadWithPartialName(&lt;span class="str"&gt;"Microsoft.SqlServer.Smo"&lt;/span&gt;) &amp;gt; $&lt;span class="kwrd"&gt;null&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Then, create an instance of the type you are interested in (the &lt;span style="font-family:cons;"&gt;Server&lt;/span&gt;&lt;span style="font-family:consMS;"&gt; &lt;/span&gt;type): &lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;  &amp;gt; $smoServer = &lt;span class="kwrd"&gt;new&lt;/span&gt;-&lt;span class="kwrd"&gt;object&lt;/span&gt; Microsoft.SqlServer.Management.Smo.Server “servername”&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;and pipe the object instance default method output through &lt;span style="font-family:cons;"&gt;Get-Member&lt;/span&gt; to list all the Events, Methods and Properties exposed:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-size:85%;"&gt;  &amp;gt; $smoServer  gm &lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;So having done that we found a property named &lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.server.defaultfile.aspx"&gt;DefaultFile&lt;/a&gt; which looked promising, but it just returned an empty string. After a bit of digging around, it transpires that it only returns a path if the current location is different to where the master DB is located, so here it is in Powershell:&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;function&lt;/span&gt; Get-SQLServerDefaultDataFilePath&lt;br /&gt;(&lt;br /&gt;  [&lt;span class="kwrd"&gt;string&lt;/span&gt;]$sqlServer = $(&lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="str"&gt;'sqlServer is required'&lt;/span&gt;)&lt;br /&gt;)&lt;br /&gt;{&lt;br /&gt;   [reflection.assembly]::LoadWithPartialName(&lt;span class="str"&gt;"Microsoft.SqlServer.Smo"&lt;/span&gt;) &amp;gt; $&lt;span class="kwrd"&gt;null&lt;/span&gt;&lt;br /&gt;   $smoServer = &lt;span class="kwrd"&gt;new&lt;/span&gt;-&lt;span class="kwrd"&gt;object&lt;/span&gt; Microsoft.SqlServer.Management.Smo.Server $sqlServer&lt;br /&gt;&lt;br /&gt;   $str = $smoServer.DefaultFile&lt;br /&gt;&lt;br /&gt;   # &lt;span class="kwrd"&gt;if&lt;/span&gt; DefaultFile property &lt;span class="kwrd"&gt;is&lt;/span&gt; empty, it means &lt;span class="kwrd"&gt;default&lt;/span&gt; path has not been changed&lt;br /&gt;   &lt;span class="kwrd"&gt;if&lt;/span&gt; ($str)&lt;br /&gt;      {$str}&lt;br /&gt;   &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;br /&gt;      {$smoServer.MasterDBPath}&lt;br /&gt;}&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;span style="color:#000000;"&gt;Update: Piers pointed out that Books Online contains a useful section on &lt;/span&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms162175.aspx"&gt;&lt;span style="color:#000000;"&gt;programming task&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#000000;"&gt;s using SQL Server Management Objects (SMO)&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-family:cons;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt&lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5724844182303549202?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5724844182303549202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5724844182303549202' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5724844182303549202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5724844182303549202'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/powershell-get-sql-server-default-file.html' title='Powershell: Get SQL Server Default File Paths using SMO'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-808572164099828569</id><published>2011-02-25T08:59:00.001+08:00</published><updated>2011-02-25T08:59:42.286+08:00</updated><title type='text'>Visual Studio Database Guide</title><content type='html'>&lt;p&gt;CodePlex is hosting an excellent whitepaper created by the &lt;a href="http://msdn.microsoft.com/en-us/vstudio/ee358786.aspx"&gt;Visual Studio ALM Rangers&lt;/a&gt;, containing guidance on working with Visual Studio 2010 Database projects:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Practical guidance for Visual Studio 2010 Database projects, which is focused on 5 areas: &lt;ul&gt; &lt;li&gt;Solution and Project Management  &lt;li&gt;Source Code Control and Configuration Management  &lt;li&gt;Integrating External Changes with the Project System  &lt;li&gt;Build and Deployment Automation with Visual Studio Database Projects  &lt;li&gt;Database Testing and Deployment Verification&lt;/li&gt;&lt;/ul&gt;This release includes common guidance, usage scenarios, hands on labs, and lessons learned from real world engagements and the community discussions.&lt;/blockquote&gt; &lt;p&gt;You can download the &lt;a href="http://vsdatabaseguide.codeplex.com/"&gt;Visual Studio Database Guide&lt;/a&gt; here.&lt;a href="http://vsdatabaseguide.codeplex.com/"&gt;&lt;/p&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-808572164099828569?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/808572164099828569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=808572164099828569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/808572164099828569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/808572164099828569'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/visual-studio-database-guide.html' title='Visual Studio Database Guide'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5467426482689457520</id><published>2011-02-24T08:33:00.002+08:00</published><updated>2011-02-24T08:45:28.863+08:00</updated><title type='text'>SQL Sentry Plan Explorer</title><content type='html'>&lt;p&gt;It may not be the greatest named application out there but SQL Sentry Plan Explorer is a free, lightweight, standalone tool that improves dealing with SQL Server query plans so much, you’ll wonder why it hasn’t been incorporated into SSMS (and let’s face it, viewing plans in SSMS really sucks!).&lt;/p&gt;&lt;p&gt;There are several ways to open a plan: In SSMS, right-click a graphical plan and select “Show Execution Plan XML”, then copy and paste the plan XML into Plan Explorer. Or, save an execution plan from SSMS to a .sqlplan file, then open the file from Plan Explorer. &lt;/p&gt;&lt;p&gt;Download &lt;a href="http://sqlsentry.net/plan-explorer/sql-server-query-view.asp"&gt;SQL Sentry Plan Explorer&lt;/a&gt; here.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5467426482689457520?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5467426482689457520/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5467426482689457520' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5467426482689457520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5467426482689457520'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/sql-sentry-plan-explorer.html' title='SQL Sentry Plan Explorer'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-432969565495541336</id><published>2011-02-24T08:23:00.001+08:00</published><updated>2011-02-24T08:23:27.847+08:00</updated><title type='text'>Service Pack 1 (SP1) for Windows 7 and Windows Server 2008 R2</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;Service Pack 1 for Windows Server 2008 R2 and Windows 7 has been released. Get it &lt;a href="http://technet.microsoft.com/en-us/windows/gg635126?ITPID=technet"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-432969565495541336?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/432969565495541336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=432969565495541336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/432969565495541336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/432969565495541336'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/service-pack-1-sp1-for-windows-7-and.html' title='Service Pack 1 (SP1) for Windows 7 and Windows Server 2008 R2'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2846275486444525425</id><published>2011-02-17T17:13:00.001+08:00</published><updated>2011-02-17T17:13:44.180+08:00</updated><title type='text'>TSQL: Round to Nearest 15 Minute Interval</title><content type='html'>&lt;p&gt;A colleague asked me if I had any TSQL to hand that would round down to a 15 minute interval and also round to nearest 15 minute interval. A quick search found several formulas but several had rounding errors. Here are both without any rounding errors.&lt;/p&gt; &lt;div style="font-family: courier new; background: white; color: black; font-size: 9pt"&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;declare &lt;/span&gt;@adate &lt;span style="color: blue"&gt;datetime &lt;/span&gt;= &lt;span style="color: #a31515"&gt;'2010/02/15 23:59:00'&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- The epoch, or start of SQL Server time: '1900-01-01 00:00:00.000'&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- select cast(0 as DateTime) as Epoch&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- Both these formulas will only work until '5983-01-24 02:07:00.000' !!&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- select dateadd(n, 2147483647, cast(0 as DateTime))&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- Round down to nearest 15 minute interval (avoiding any rounding issues)&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;select dateadd&lt;/span&gt;(n,(&lt;span style="color: blue"&gt;DATEDIFF&lt;/span&gt;(n, &lt;span style="color: blue"&gt;cast&lt;/span&gt;(0 &lt;span style="color: blue"&gt;as DateTime&lt;/span&gt;), @adate)/ 15) * 15, &lt;span style="color: blue"&gt;cast&lt;/span&gt;(0 &lt;span style="color: blue"&gt;as DateTime&lt;/span&gt;))&lt;/p&gt; &lt;p style="margin: 0px"&gt;&amp;nbsp;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;-- Round to nearest 15 minute interval (avoiding any rounding issues)&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;select dateadd&lt;/span&gt;(n,((&lt;span style="color: blue"&gt;DATEDIFF&lt;/span&gt;(n, &lt;span style="color: blue"&gt;cast&lt;/span&gt;(0 &lt;span style="color: blue"&gt;as DateTime&lt;/span&gt;), @adate) + 7)/ 15) * 15, &lt;span style="color: blue"&gt;cast&lt;/span&gt;(0 &lt;span style="color: blue"&gt;as DateTime&lt;/span&gt;))&lt;/p&gt;&lt;/div&gt; &lt;p&gt;As noted, they have the limitation of working only until 5983 AD, but I figure I won’t be around!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2846275486444525425?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2846275486444525425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2846275486444525425' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2846275486444525425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2846275486444525425'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/tsql-round-to-nearest-15-minute.html' title='TSQL: Round to Nearest 15 Minute Interval'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5126449886546172214</id><published>2011-02-12T10:44:00.001+08:00</published><updated>2011-02-12T10:44:48.066+08:00</updated><title type='text'>How to Configure SQL Server 2005 to allow Remote Connections</title><content type='html'>&lt;p&gt;Just so I remember where this article is (also applies to SQL Server 2008 Express): &lt;/p&gt; &lt;h3&gt;&lt;a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;914277"&gt;How to configure SQL Server 2005 to allow remote connections&lt;/a&gt;&lt;/h3&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5126449886546172214?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5126449886546172214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5126449886546172214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5126449886546172214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5126449886546172214'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/how-to-configure-sql-server-2005-to.html' title='How to Configure SQL Server 2005 to allow Remote Connections'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8399254003459470101</id><published>2011-02-11T08:08:00.002+08:00</published><updated>2011-02-11T08:10:08.437+08:00</updated><title type='text'>Mark Russinovich: “Zero Day”</title><content type='html'>&lt;p&gt;&lt;br /&gt;Microsoft Technical Fellow and all-round Windows Internals expert, &lt;a href="http://blogs.technet.com/b/markrussinovich/"&gt;Mark Russinovich&lt;/a&gt;, has an upcoming book release.  And this time it’s not a new edition of ‘Windows Internals’! &lt;/p&gt;&lt;p&gt;His fiction debut, &lt;a href="http://www.zerodaythebook.com/"&gt;Zero Day&lt;/a&gt;&lt;em&gt;&lt;/em&gt;&lt;em&gt;,&lt;/em&gt; is set in a world completely reliant on technology (sounds familiar), and surrounds the events of cyber infrastructure attacks released on a largely unprepared world.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8399254003459470101?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8399254003459470101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8399254003459470101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8399254003459470101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8399254003459470101'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/mark-russinovich-zero-day.html' title='Mark Russinovich: “Zero Day”'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-9122906619337054265</id><published>2011-02-06T10:17:00.001+08:00</published><updated>2011-02-06T10:17:46.871+08:00</updated><title type='text'>How to give great presentations</title><content type='html'>&lt;p&gt;Assuming your user group is actually holding meetings :), User Group Support Services (UGSS) have released a series of videos on &lt;a href="https://www.technicalcommunity.com/InfoCenter/Pages/Speaker-Training.aspx"&gt;“How to give great presentations”&lt;/a&gt; aimed at first time speakers and anyone wanting to improve their skills (I know I need to):&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;This video series guides you through what you need to know to give your first presentation or to improve your existing presentation skills. You’ll learn how to choose the right subject for you, how to break subjects up so that your explanations and demonstrations are clear and understandable, how to construct your slide deck so that it covers essential subjects without sending your audience to sleep, why being nervous is completely normal and what you can do to make it manageable, tips and tricks for giving great demonstrations, how to prepare your laptop so that it does not fight you while you are presenting and finally how to deliver the presentation that you have worked so hard creating.&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-9122906619337054265?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/9122906619337054265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=9122906619337054265' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/9122906619337054265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/9122906619337054265'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/02/how-to-give-great-presentations.html' title='How to give great presentations'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8615226638393047718</id><published>2011-01-31T12:26:00.001+08:00</published><updated>2011-01-31T12:26:48.415+08:00</updated><title type='text'>Microsoft SQL Server Compact 4.0 Released</title><content type='html'>&lt;p&gt;I must have missed this going RTM 2 weeks ago. You can download &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033CFB76-5382-44FB-BC7E-B3C8174832E2"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8615226638393047718?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8615226638393047718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8615226638393047718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8615226638393047718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8615226638393047718'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/01/microsoft-sql-server-compact-40.html' title='Microsoft SQL Server Compact 4.0 Released'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8782864677768002814</id><published>2011-01-26T13:00:00.001+08:00</published><updated>2011-01-26T13:00:41.323+08:00</updated><title type='text'>SQL Server 2008 ‘…/sec’ Performance Counters</title><content type='html'>&lt;p&gt;SQL Server contains many Dynamic Management Views (DMV) for diagnosing server activity and health, including one for examining performance counters, sys.dm_os_performance_counters. Some of the counters in "sys.dm_os_performance_counters" with names ending with ‘/sec’ (such as like "Page lookups/sec", or "Page writes/sec") are known as "per second" counters. When you first come across this DMV you might not realise that the values for these counters are cumulative and require two measurements over an interval and then calculating the difference in those values based on the time between the two measurements.&lt;/p&gt; &lt;p&gt;Here is a simple TSQL snippet to perform this calculation for all per second counters in sys.dm_os_performance_counters:&lt;br&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;-- Get first sample&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; *,  getdate() &lt;span class="kwrd"&gt;as&lt;/span&gt; sampletime, &lt;br /&gt;ROW_NUMBER() &lt;span class="kwrd"&gt;OVER&lt;/span&gt; (&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; [object_name], instance_name, [counter_name]) &lt;span class="kwrd"&gt;as&lt;/span&gt; rowid&lt;br /&gt;&lt;span class="kwrd"&gt;INTO&lt;/span&gt; #tempCounters1&lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; sys.dm_os_performance_counters&lt;br /&gt;&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; counter_name &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%/sec%'&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; [object_name], instance_name, [counter_name]; &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Wait for 10 seconds&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;WAITFOR&lt;/span&gt; DELAY &lt;span class="str"&gt;'00:00:10'&lt;/span&gt;; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; *,  getdate() &lt;span class="kwrd"&gt;as&lt;/span&gt; sampletime, &lt;br /&gt;ROW_NUMBER() &lt;span class="kwrd"&gt;OVER&lt;/span&gt; (&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; [object_name], instance_name, [counter_name]) &lt;span class="kwrd"&gt;as&lt;/span&gt; rowid&lt;br /&gt;&lt;span class="kwrd"&gt;INTO&lt;/span&gt; #tempCounters2&lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; sys.dm_os_performance_counters&lt;br /&gt;&lt;span class="kwrd"&gt;WHERE&lt;/span&gt; counter_name &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="str"&gt;'%/sec%'&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;order&lt;/span&gt; &lt;span class="kwrd"&gt;by&lt;/span&gt; [object_name], instance_name, [counter_name]; &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Calculate per second values&lt;/span&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; t1.[object_name], t1.instance_name, t1.[counter_name],&lt;br /&gt;(t2.cntr_value - t1.cntr_value) / datediff(ss,t1.sampletime,t2.sampletime) &lt;br /&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; #tempCounters1 t1 &lt;span class="kwrd"&gt;join&lt;/span&gt; #tempCounters2 t2 &lt;span class="kwrd"&gt;ON&lt;/span&gt; t1.rowid = t2.rowid; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;DROP&lt;/span&gt; &lt;span class="kwrd"&gt;TABLE&lt;/span&gt; #tempCounters1&lt;br /&gt;&lt;span class="kwrd"&gt;DROP&lt;/span&gt; &lt;span class="kwrd"&gt;TABLE&lt;/span&gt; #tempCounters2&lt;br /&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;/font&gt; &lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2" face="Trebuchet MS"&gt;Here is a Table valued function version which accepts an interval parameter, and is easy to filter:&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;IF&lt;/span&gt; OBJECT_ID(N&lt;span class="rem"&gt;'dbo.PerSecondPerformanceCounters', N'TF') IS NOT NULL&lt;/span&gt;&lt;br /&gt;    DROP &lt;span class="kwrd"&gt;FUNCTION&lt;/span&gt; dbo.PerSecondPerformanceCounters;&lt;br /&gt;GO &lt;br /&gt;&lt;br /&gt;CREATE &lt;span class="kwrd"&gt;FUNCTION&lt;/span&gt; PerSecondPerformanceCounters(@intervalseconds int)&lt;br /&gt;RETURNS @retCounterInformation TABLE&lt;br /&gt;(&lt;br /&gt;    [object_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [counter_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [instance_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [cntr_value] bigint &lt;span class="kwrd"&gt;not&lt;/span&gt; null&lt;br /&gt;)&lt;br /&gt;&lt;span class="kwrd"&gt;AS&lt;/span&gt;&lt;br /&gt;BEGIN &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @tempTable1 TABLE&lt;br /&gt;(&lt;br /&gt;    [object_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [counter_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [instance_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [cntr_value] bigint &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [sampletime] datetime &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [rowid] int &lt;span class="kwrd"&gt;not&lt;/span&gt; null&lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @tempTable2 TABLE&lt;br /&gt;(&lt;br /&gt;    [object_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [counter_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [instance_name] nchar(128) &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [cntr_value] bigint &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [sampletime] datetime &lt;span class="kwrd"&gt;not&lt;/span&gt; null,&lt;br /&gt;    [rowid] int &lt;span class="kwrd"&gt;not&lt;/span&gt; null&lt;br /&gt;) &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Take first sample&lt;/span&gt; &lt;/font&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;INSERT INTO @tempTable1&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; [object_name], &lt;br /&gt;       [counter_name], &lt;br /&gt;       [instance_name],&lt;br /&gt;       [cntr_value],&lt;br /&gt;       getdate() &lt;span class="kwrd"&gt;as&lt;/span&gt; sampletime, &lt;br /&gt;       ROW_NUMBER() OVER (order by [object_name], [counter_name], [instance_name]) &lt;span class="kwrd"&gt;as&lt;/span&gt; rowid&lt;br /&gt;FROM sys.dm_os_performance_counters&lt;br /&gt;WHERE counter_name &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="rem"&gt;'%/sec%'&lt;/span&gt;&lt;br /&gt;ORDER BY [object_name], [counter_name], [instance_name]; &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Wait for specified time&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;&lt;/span&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;span class="kwrd"&gt;declare&lt;/span&gt; @start datetime = getdate()&lt;br /&gt;&lt;span class="kwrd"&gt;while&lt;/span&gt; (1=1)&lt;br /&gt;BEGIN&lt;br /&gt;  &lt;span class="kwrd"&gt;if&lt;/span&gt; datediff(ss, @start, getdate()) &amp;gt;= @intervalseconds&lt;br /&gt;     BREAK;&lt;br /&gt;&lt;span class="kwrd"&gt;END&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Take second sample&lt;/span&gt;&lt;br /&gt;INSERT INTO @tempTable2&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; [object_name], &lt;br /&gt;       [counter_name], &lt;br /&gt;       [instance_name],&lt;br /&gt;       [cntr_value],&lt;br /&gt;       getdate() &lt;span class="kwrd"&gt;as&lt;/span&gt; sampletime, &lt;br /&gt;       ROW_NUMBER() OVER (order by [object_name], [counter_name], [instance_name]) &lt;span class="kwrd"&gt;as&lt;/span&gt; rowid&lt;br /&gt;FROM sys.dm_os_performance_counters&lt;br /&gt;WHERE counter_name &lt;span class="kwrd"&gt;LIKE&lt;/span&gt; &lt;span class="rem"&gt;'%/sec%'&lt;/span&gt;&lt;br /&gt;ORDER BY [object_name], [counter_name], [instance_name]; &lt;br /&gt;&lt;br /&gt;---- calculate per second values (ignore fractional values)&lt;br /&gt;INSERT @retCounterInformation&lt;br /&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; &lt;br /&gt;t1.[object_name], &lt;br /&gt;t1.instance_name, &lt;br /&gt;t1.[counter_name], &lt;br /&gt;(t2.cntr_value - t1.cntr_value) / datediff(ss,t1.sampletime,t2.sampletime) &lt;span class="kwrd"&gt;AS&lt;/span&gt; cntr_value&lt;br /&gt;FROM @tempTable1 t1 &lt;br /&gt;join @tempTable2 t2 &lt;span class="kwrd"&gt;ON&lt;/span&gt; t1.rowid = t2.rowid; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;RETURN&lt;/span&gt;; &lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;END&lt;/span&gt;&lt;br /&gt;GO&lt;/font&gt; &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;Here is how you would call it: &lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;nbsp;&lt;pre class="csharpcode"&gt;&lt;font size="2"&gt;&lt;span class="rem"&gt;-- Return only per second counters with non-zero values &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;select&lt;/span&gt; * &lt;span class="kwrd"&gt;from&lt;/span&gt; PerSecondPerformanceCounters(10)&lt;br /&gt;&lt;span class="kwrd"&gt;where&lt;/span&gt; cntr_value &amp;gt; 0 &lt;br /&gt;&lt;br /&gt;&lt;span class="rem"&gt;-- Return non-zero counter values for specified objects only&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;select&lt;/span&gt; * &lt;span class="kwrd"&gt;from&lt;/span&gt; PerSecondPerformanceCounters(10)&lt;br /&gt;&lt;span class="kwrd"&gt;where&lt;/span&gt; cntr_value &amp;gt; 0 &lt;span class="kwrd"&gt;AND&lt;/span&gt;&lt;br /&gt;    (object_name = &lt;span class="str"&gt;'SQLServer:Buffer Manager'&lt;/span&gt; &lt;span class="kwrd"&gt;OR&lt;/span&gt; object_name = &lt;span class="str"&gt;'SQLServer:Access Methods'&lt;/span&gt;)&lt;br /&gt;&lt;/font&gt;&lt;/pre&gt;&lt;br /&gt;&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, "Courier New", courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8782864677768002814?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8782864677768002814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8782864677768002814' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8782864677768002814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8782864677768002814'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/01/sql-server-2008-sec-performance.html' title='SQL Server 2008 ‘…/sec’ Performance Counters'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2428686953750642855</id><published>2011-01-19T12:51:00.001+08:00</published><updated>2011-01-19T12:51:24.595+08:00</updated><title type='text'>Useful SSMS Shortcuts</title><content type='html'>&lt;p align="left"&gt;Here are a few useful SSMS shortcuts:&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="669"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl-&lt;strong&gt;N&lt;/strong&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Open a new tabbed query window (with same credentials as current tab)&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl–&lt;strong&gt;K&lt;/strong&gt; + Ctrl–&lt;strong&gt;C / &lt;/strong&gt;Ctrl–&lt;strong&gt;K &lt;/strong&gt;+ Ctrl–&lt;strong&gt;U&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Comment / Uncomment selected text&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl-Shift-&lt;strong&gt;U&lt;/strong&gt; / Ctrl-Shift-&lt;strong&gt;L &lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Change selected text to upper / lowercase (wish it just affected keywords!)&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl-&lt;strong&gt;L&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Include estimated execution plan&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl-K&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Include actual execution plan&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl+&lt;strong&gt;R&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Toggle Results pane&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;F4&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Show Properties window&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="205"&gt;&lt;font size="2"&gt;Ctrl+Shift+&lt;strong&gt;M&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="462"&gt;&lt;font size="2"&gt;Specify values for template parameters&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p align="left"&gt;&lt;strong&gt;Usual Suspects &lt;/strong&gt;&lt;/p&gt; &lt;p align="left"&gt;Ctrl-&lt;strong&gt;F&lt;/strong&gt;, Ctrl-&lt;strong&gt;H&lt;/strong&gt; : Find/Replace&lt;/p&gt; &lt;p align="left"&gt;F5 or Ctrl-&lt;strong&gt;E&lt;/strong&gt;&amp;nbsp;&amp;nbsp; : Execute query &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2428686953750642855?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2428686953750642855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2428686953750642855' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2428686953750642855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2428686953750642855'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2011/01/useful-ssms-shortcuts.html' title='Useful SSMS Shortcuts'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5144663475657026476</id><published>2010-12-28T09:13:00.001+08:00</published><updated>2010-12-28T09:13:24.648+08:00</updated><title type='text'>SQL Server Transaction Log size does not match the size of the data being loaded</title><content type='html'>&lt;p&gt;I came across this cautionary tale from the &lt;a href="http://blogs.msdn.com/b/sqlcat/archive/2010/10/29/transaction-log-size-does-not-match-the-size-of-the-data-being-loaded.aspx"&gt;SQL Server Development Customer Advisory Team&lt;/a&gt;, while looking for information on virtual log files (VLF):&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The ISV created an empty database, setup a backup device, set the database recovery model to FULL, and then started loading data. They also intended to backup the transaction log occasionally to keep the log a manageable size. However, at the end of the load process although the database contained 92 GB of data, the log was only 1.2 GB. One would have expected that the transaction log in the case of FULL recovery would have been approximately the same size as the data.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt; After confirming the database was in FULL recovery mode, they tried BULK LOGGED and got the same result!&lt;/p&gt; &lt;p&gt;The reason? The database had never had an initial FULL backup!&lt;/p&gt; &lt;p&gt;From Books Online &lt;a href="http://msdn.microsoft.com/en-us/library/ms190440.aspx"&gt;‘Working with Transaction Log Backups’&lt;/a&gt;: &lt;blockquote&gt; &lt;p&gt;&lt;b&gt;‘&lt;/b&gt;&lt;b&gt;Before you can create the first log backup, &lt;em&gt;you must create a full backup, such as a database backup&lt;/em&gt; or the first in a set of file backups. […]&lt;/b&gt;&lt;b&gt;‘&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;blockquote&gt; &lt;p&gt;Because there was no initial FULL database backup, the database ‘effectively’ remained in SIMPLE recovery mode; SQL Server was truncating the transaction log automatically.&lt;b&gt;&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So, for FULL and BULK-LOGGED recovery models, create a full database backup right after creating a database. (This initial Transaction Log backup will be ‘empty’ because the database contains no data)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5144663475657026476?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5144663475657026476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5144663475657026476' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5144663475657026476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5144663475657026476'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/sql-server-transaction-log-size-does.html' title='SQL Server Transaction Log size does not match the size of the data being loaded'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4060233080589415668</id><published>2010-12-27T08:50:00.001+08:00</published><updated>2010-12-27T08:50:23.857+08:00</updated><title type='text'>SQL Server Migration Assistant supports MySQL and Access to SQL Azure</title><content type='html'>&lt;p&gt;Old news, but the SQL Server Migration Assistant now supports migrating from MySQL and Access to SQL Azure. The latest SQL Server Migration Assistant is available for free download here:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=69739c8c-ac82-41de-b9e6-8fa5ae2594d9"&gt;SSMA for MySQL v1.0&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5abe098d-c7e1-46c6-994a-09a2856eef0b"&gt;SSMA for Access v4.2&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9dfb1773-5594-44a9-869f-a891629f80a5"&gt;SSMA for Oracle v4.2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f39d6150-e611-46e1-84c5-0808010711c8"&gt;SSMA for Sybase v4.2&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4060233080589415668?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4060233080589415668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4060233080589415668' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4060233080589415668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4060233080589415668'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/sql-server-migration-assistant-supports.html' title='SQL Server Migration Assistant supports MySQL and Access to SQL Azure'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4007123922448858270</id><published>2010-12-26T17:43:00.001+08:00</published><updated>2010-12-26T17:43:48.354+08:00</updated><title type='text'>Comparing the .NET Timer Classes</title><content type='html'>&lt;p&gt;Quick comparison table taken from an excellent MSDN article: &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc164015.aspx"&gt;Comparing the Timer Classes in the .NET Framework Class Library&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;table border="1" cellspacing="0" cellpadding="4" width="694"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="235"&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="165"&gt;&lt;font size="2"&gt;&lt;strong&gt;System.Windows.Forms&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="126"&gt;&lt;font size="2"&gt;&lt;strong&gt;System.Timers&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="166"&gt;&lt;font size="2"&gt;&lt;strong&gt;System.Threading&lt;/strong&gt;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="229"&gt;&lt;font size="2"&gt;Timer event runs on what thread?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="171"&gt;&lt;font size="2"&gt;UI thread&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="128"&gt;&lt;font size="2"&gt;UI or worker thread&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="165"&gt;&lt;font size="2"&gt;Worker thread&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="226"&gt;&lt;font size="2"&gt;Instances are thread safe?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="175"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="164"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="224"&gt;&lt;font size="2"&gt;Familiar/intuitive object model?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="178"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="164"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="223"&gt;&lt;font size="2"&gt;Requires Windows Forms? &lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="180"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="163"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="222"&gt;&lt;font size="2"&gt;Metronome-quality beat? &lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="181"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;Yes*&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="163"&gt;&lt;font size="2"&gt;Yes*&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="222"&gt;&lt;font size="2"&gt;Timer event supports state object?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="182"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="163"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="221"&gt;&lt;font size="2"&gt;Initial timer event can be scheduled?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="183"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="129"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="163"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="221"&gt;&lt;font size="2"&gt;Class supports inheritance?&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="185"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="130"&gt;&lt;font size="2"&gt;Yes&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="165"&gt;&lt;font size="2"&gt;No&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4007123922448858270?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4007123922448858270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4007123922448858270' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4007123922448858270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4007123922448858270'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/comparing-net-timer-classes.html' title='Comparing the .NET Timer Classes'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7173079028113568922</id><published>2010-12-11T09:13:00.001+08:00</published><updated>2010-12-11T09:13:27.428+08:00</updated><title type='text'>Changes to Microsoft Certified Master: Microsoft SQL Server 2008</title><content type='html'>&lt;p&gt;When I first heard about the SQL Server Microsoft Certified Master (MCM) certification, it immediately struck me as something worth doing. Then I found out how much it cost! Microsoft have recently &lt;a href="https://www.microsoft.com/learning/en/us/certification/master-sql-path.aspx"&gt;announced&lt;/a&gt; changes to the original program. In order to pursue the SQL Server Microsoft Certified Master certification you still need the pre-requisites MCITP: Database Developer 2008 (&lt;a href="https://www.microsoft.com/learning/en/us/exam.aspx?ID=70-450&amp;amp;locale=en-us"&gt;Exam 70-450&lt;/a&gt;) and MCITP: Database Administrator 2008 (&lt;a href="https://www.microsoft.com/learning/en/us/exam.aspx?ID=70-451&amp;amp;locale=en-us"&gt;Exam 70-451&lt;/a&gt;). If you work with SQL Server, these 2 exams are relatively easy (unlike the rest of the MCM).&amp;nbsp; &lt;p&gt;&lt;strong&gt;The Original Program:&lt;/strong&gt;  &lt;ul&gt; &lt;li&gt;Cost: $18,500 for 3 continuous weeks of onsite training, based in Seattle  &lt;li&gt;Three written multiple-choice exams during the training  &lt;li&gt;One final six-hour lab&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;This has some obvious drawbacks: US$18,500 is a considerable sum of money to find in one go (even with the strong Aussie dollar), and that’s in addition to taking 3 continuous weeks away from work. Plus the course only happened in Redmond, so add travelling costs as well.&amp;nbsp; &lt;p&gt;&lt;strong&gt;The New Program:&lt;/strong&gt;  &lt;ul&gt; &lt;li&gt;Certification and training are separate  &lt;li&gt;A written multiple-choice knowledge exam (88-970): cost US$500, taken at Prometric testing centres  &lt;li&gt;A 6-hour lab exam (88-971): cost US$2,000, taken at &lt;a href="http://www.prometric.com/microsoft/mcm"&gt;selected secure Prometric testing centres&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Microsoft will no longer provide training for the SQL MCM. Instead, training will provided by approved third-party vendors. I’ve just visited the Prometric site but cannot find any test centres for the MCM exams in Australia! &lt;/p&gt; &lt;p&gt;If the MCM is something you are interested in, Microsoft (in partnership with &lt;a href="http://www.SQLskills.com/"&gt;SQLskills&lt;/a&gt;) has made 40 hours of &lt;strong&gt;free&lt;/strong&gt; introductory training available for the MCM program, which you can download &lt;a href="http://technet.microsoft.com/en-us/sqlserver/ff977043.aspx"&gt;here&lt;/a&gt;. These videos give an indication of the breadth of material you need to know for each area (rather than everything you actually need to know). There is also an excellent reading list put together by &lt;a href="http://www.SQLskills.com/"&gt;SQLskills&lt;/a&gt; at &lt;a href="http://www.SQLskills.com/MCM.asp"&gt;Microsoft Certified Master - SQL Server Online Training - Links and Study Aids&lt;/a&gt;  &lt;p&gt;(Ref.: Brent Ozar’s &lt;a href="http://www.brentozar.com/archive/2010/11/changes-microsoft-certified-master-of-sql-server-program/"&gt;blog&lt;/a&gt;, Paul Randell’s &lt;a href="http://www.sqlskills.com/BLOGS/PAUL/post/Big-changes-to-the-MCM-program-and-how-SQLskills-can-help-you.aspx"&gt;blog&lt;/a&gt;)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7173079028113568922?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7173079028113568922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7173079028113568922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7173079028113568922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7173079028113568922'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/changes-to-microsoft-certified-master.html' title='Changes to Microsoft Certified Master: Microsoft SQL Server 2008'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6700968759905751045</id><published>2010-12-05T16:18:00.001+08:00</published><updated>2010-12-05T16:18:52.257+08:00</updated><title type='text'>DevJam 2010</title><content type='html'>&lt;p&gt;I really enjoy our User Group’s end of year ‘DevJam’ events (despite the fact that it involves a bit of work to organise). It is great to see so many local developers willing to give up their time to present a talk. Around 50 people attended last Thursday’s event, so it was a relief when the pizza finally arrived. A crowd of developers deprived of pizza is a riot waiting to happen ;) !&lt;/p&gt; &lt;p&gt;It was a great line-up of topics with a nice mixture of content, and every presenter did a great job of informing and entertaining. Every talk received a good number of audience votes, but we have to have some winners in order to give out the prizes! The favourite talks (in order) were:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Adrian McGrath&amp;nbsp; - WPF: Design Time Data  &lt;li&gt;Alistair Waddell&amp;nbsp; - A simple approach to test your data driven app  &lt;li&gt;Michael Minutillo - Dynamic UI in WinForms&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Thank you to all the sponsors who help make these events possible: Microsoft (for the venue and VS2010 MSDN door prize), UGSS for the pizza and refreshments, JetBrains, Joe Albahari, RedGate, TekPub, Scooter Software, DevExpress, TechSmith. [The presenter VS2010 with MSDN prize was donated by myself from the MVP program.]&lt;/p&gt; &lt;p&gt;Thank you to everyone who attended DevJam and meetings throughout the year. Special thanks to Dave Gardner who fetched and delivered the beer.&lt;/p&gt; &lt;p&gt;[ If you are interested in running one of these events at your User Group, I put together some notes here:&amp;nbsp; &lt;a href="http://mitch-wheat.blogspot.com/2009/05/running-devjam-format-community-event.html"&gt;Running a DevJam Community Event&lt;/a&gt; ]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6700968759905751045?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6700968759905751045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6700968759905751045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6700968759905751045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6700968759905751045'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/devjam-2010.html' title='DevJam 2010'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-5857281654076282926</id><published>2010-12-01T23:16:00.001+08:00</published><updated>2010-12-01T23:16:26.140+08:00</updated><title type='text'>Reminder: Perth .NET User Group, Thurs 2nd Dec: DevJam Community Event</title><content type='html'>&lt;p&gt;Here’s the line-up of talks for our end of year DevJam community event:&amp;nbsp; &lt;ul&gt; &lt;li&gt;Mike Bain - Using SpecFlow and WatiN&lt;/li&gt; &lt;li&gt;Michael Minutillo - Dynamic UI in WinForms&lt;/li&gt; &lt;li&gt;Piers Williams – Rx:Reactive Framework&lt;/li&gt; &lt;li&gt;Alistair Waddell - A simple approach to test your data driven app&lt;/li&gt; &lt;li&gt;Dave Gardner - NuGet: The caramel goodness of open source in your projects&lt;/li&gt; &lt;li&gt;Darren Helsby - Asynchronous programming in .NET 5&lt;/li&gt; &lt;li&gt;Sam Ritchie - Ditching BizTalk for NServiceBus&lt;/li&gt; &lt;li&gt;Adrian McGrath - WPF: Design Time Data&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Where and when is DevJam happening?: &lt;ul&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;DATE&lt;/strong&gt;:&amp;nbsp;&amp;nbsp; Thursday, Dec 2nd, 5:30pm&lt;/li&gt;&lt;/ul&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;VENUE&lt;/strong&gt;:&amp;nbsp; Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth &lt;li&gt;&lt;strong&gt;COST&lt;/strong&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;There will be pizza and refeshments provided. Not to mention some great prizes!…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-5857281654076282926?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/5857281654076282926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=5857281654076282926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5857281654076282926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/5857281654076282926'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/12/reminder-perth-net-user-group-thurs-2nd.html' title='Reminder: Perth .NET User Group, Thurs 2nd Dec: DevJam Community Event'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8418694422426184701</id><published>2010-11-25T18:32:00.001+08:00</published><updated>2010-11-25T18:32:09.186+08:00</updated><title type='text'>SQL Server 2008: Using Hex Values in TSQL Scripts</title><content type='html'>&lt;p&gt;I was updating several TSQL scripts today containing ARGB values and thinking (not for the first time) that it was a shame I couldn’t use the Hex values directly (eg 0xFFB40000) rather than converting to the harder to manage base10 integer equivalent (-4980736).&lt;/p&gt; &lt;p&gt;The SQL Server 2008 release updated the &lt;a href="http://msdn.microsoft.com/en-us/library/ms187928(v=SQL.100).aspx"&gt;CONVERT()&lt;/a&gt; function to be able to do just that!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font face="Courier New"&gt;CONVERT(varbinary(4), '0xFFB40000', 1)&lt;/font&gt; &lt;p&gt;The last Style parameter governs the the conversion. &lt;p&gt;From Books Online: &lt;blockquote&gt; &lt;h5&gt;Binary Styles&lt;/h5&gt; &lt;p&gt;When expression is binary(n), varbinary(n), char(n), or varchar(n), style can be one of the values shown in the following table. Style values that are not listed in the table return an error. &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;table border="0" cellspacing="0" cellpadding="2" width="733"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="83"&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Value&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="top" width="648"&gt; &lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;Output&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="83"&gt;&lt;font size="2"&gt;0 (default)&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="648"&gt; &lt;p&gt;&lt;font size="2"&gt;Translates ASCII characters to binary bytes or binary bytes to ASCII characters. Each character or byte is converted 1:1. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;If the data_type is a binary type, the characters 0x are added to the left of the result.&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="83"&gt;&lt;font size="2"&gt;1, 2&lt;/font&gt;&lt;/td&gt; &lt;td valign="top" width="648"&gt; &lt;p&gt;&lt;font size="2"&gt;If the data_type is a binary type, the expression must be a character expression. &lt;strong&gt;The expression must be composed of an even number of hexadecimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, a, b, c, d, e, f). If the style is set to 1 the characters 0x must be the first two characters in the expression. If the expression contains an odd number of characters or if any of the characters are invalid an error is raised. &lt;/strong&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;If the length of the converted expression is greater than the length of the data_type the result will be right truncated. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;Fixed length data_types that are larger then the converted result will have zeros added to the right of the result. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;If the data_type is a character type, the expression must be a binary expression. Each binary character is converted into two hexadecimal characters. If the length of the converted expression is greater than the data_type length it will be right truncated. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;If the data_type is a fix sized character type and the length of the converted result is less than its length of the data_type; spaces are added to the right of the converted expression to maintain an even number of hexadecimal digits. &lt;/font&gt; &lt;p&gt;&lt;font size="2"&gt;The characters 0x will be added to the left of the converted result for style 1.&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8418694422426184701?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8418694422426184701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8418694422426184701' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8418694422426184701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8418694422426184701'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/11/sql-server-2008-using-hex-values-in.html' title='SQL Server 2008: Using Hex Values in TSQL Scripts'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8235447143745194111</id><published>2010-11-23T22:28:00.001+08:00</published><updated>2010-11-23T22:28:17.272+08:00</updated><title type='text'>ASP.NET Code Samples Collection</title><content type='html'>&lt;p&gt;If you missed this in the last MSDN Flash, J. D. Meier (Developer Guidance, Patterns &amp;amp; Practices) has a roundup of various ASP.NET code sample on his blog: &lt;a href="http://blogs.msdn.com/b/jmeier/archive/2010/10/31/asp-net-code-samples-collection.aspx"&gt;ASP.NET Code Samples Collection&lt;/a&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;The ASP.NET Code Samples Collection is a roundup and map of ASP.NET code samples from&amp;nbsp; various sources including the MSDN library, www.ASP.net, Code Gallery, CodePlex, and Microsoft Support.&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8235447143745194111?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8235447143745194111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8235447143745194111' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8235447143745194111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8235447143745194111'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/11/aspnet-code-samples-collection.html' title='ASP.NET Code Samples Collection'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-691309803946346974</id><published>2010-11-13T17:21:00.001+08:00</published><updated>2010-11-13T17:21:25.783+08:00</updated><title type='text'>Determine if your .NET Application has a Memory Leak</title><content type='html'>&lt;p&gt;You can use &lt;a href="http://technet.microsoft.com/en-us/library/bb490957.aspx"&gt;Perfmon&lt;/a&gt; to determine if your .NET application is leaking memory (managed or unmanaged).&lt;/p&gt; &lt;p&gt;Run Perfmon.exe and add these counters: &lt;ul&gt; &lt;li&gt;Process / &lt;strong&gt;Private bytes&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;.NET CLR Memory / &lt;strong&gt;# bytes in all heaps&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;.NET CLR LocksAndThreads / &lt;strong&gt;# of current logical threads&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Run your application for a representative length of time and exercise its functionality. &lt;p&gt;If &lt;strong&gt;Private bytes&lt;/strong&gt; is increasing but &lt;strong&gt;# bytes in all heaps &lt;/strong&gt;is not, then unmanaged memory is leaking. If both both are increasing, then managed memory is leaking.&amp;nbsp; If the &lt;strong&gt;# of current logical threads&lt;/strong&gt; is increasing beyond what you expect, then thread stacks are leaking.  &lt;p&gt;If &lt;strong&gt;Private Bytes &lt;/strong&gt;is periodically jumping in 1MB increments with a corresponding increase in &lt;strong&gt;# of current logical Threads&lt;/strong&gt;, a thread stack leak is the likely cause. &lt;p&gt;[Tracking it down is another matter! For that, one of the commercially available tools is invaluable: &lt;a href="http://memprofiler.com/"&gt;Memprofiler&lt;/a&gt;, &lt;a href="http://www.red-gate.com/products/ants_memory_profiler/index.htm"&gt;ANTS Memory Profiler&lt;/a&gt;, &lt;a href="http://www.jetbrains.com/profiler/"&gt;dotTrace&lt;/a&gt;]&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-691309803946346974?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/691309803946346974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=691309803946346974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/691309803946346974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/691309803946346974'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/11/determine-if-your-net-application-has.html' title='Determine if your .NET Application has a Memory Leak'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-995572802628679012</id><published>2010-11-07T18:00:00.001+08:00</published><updated>2010-11-07T18:00:44.968+08:00</updated><title type='text'>.NET CLR Large Object Heap</title><content type='html'>&lt;p&gt;I was recently talking to several colleagues about the CLR garbage collector, and the question of where the size of &lt;strong&gt;85,000&lt;/strong&gt; bytes as the threshold for objects on the Large Object Heap (LOH) comes from (instead of the seemingly more obvious value of 65,535).&lt;/p&gt; &lt;p&gt;This value was determined as a result of performance tuning by the CLR garbage collector team.&lt;/p&gt; &lt;p&gt;One of the reasons you should try to keep your object allocation sizes below this value (and off the Large Object Heap) is because unlike the Generation 0,1 and 2 area, the LOH is &lt;em&gt;&lt;strong&gt;not&lt;/strong&gt;&lt;/em&gt; compacted.&lt;/p&gt; &lt;p&gt;An excellent reference for the LOH is here: &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc534993.aspx"&gt;Large Object Heap Uncovered&lt;/a&gt;&lt;/p&gt; &lt;p&gt;There were changes made in .NET 4.0 as to how the LOH performs, but according to this &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/521147/large-object-heap-fragmentation-causes-outofmemoryexception"&gt;connect issue&lt;/a&gt; there are still improvements that could be made:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Based on the example provided, we were able to allocate nearly 23 times as much memory before running out of memory on the large object heap going from version 3.5 to version 4. That's not to say we are finished addressing fragmentation issues—we will continue to pay attention as we improve in future versions. In the .NET 4 release, we heard from customers that latency was a high priority. So that is where we have spent much of our focus. &lt;em&gt; [Brandon Bray: Lead program manager responsible for the garbage collector in the .NET Framework]&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;.NET 4.0 introduced differences between the workstation and server versions of the garbage collector:&lt;/p&gt; &lt;blockquote&gt; &lt;h5&gt;Comparing Workstation and Server Garbage Collection&lt;/h5&gt; &lt;p&gt;Threading and performance considerations for workstation garbage collection:  &lt;ul&gt; &lt;li&gt; &lt;p&gt;The collection occurs on the user thread that triggered the garbage collection and remains at the same priority. Because user threads typically run at normal priority, the garbage collector (which runs on a normal priority thread) must compete with other threads for CPU time. &lt;p&gt;Threads that are running native code are not suspended.&lt;/p&gt; &lt;li&gt; &lt;p&gt;Workstation garbage collection is always used on a computer that has only one processor, regardless of the &lt;a href="http://msdn.microsoft.com/en-us/library/ms229357.aspx"&gt;&amp;lt;gcServer&amp;gt;&lt;/a&gt; setting. If you specify server garbage collection, the CLR uses workstation garbage collection with concurrency disabled.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Threading and performance considerations for server garbage collection: &lt;ul&gt; &lt;li&gt; &lt;p&gt;The collection occurs on multiple dedicated threads that are running at THREAD_PRIORITY_HIGHEST priority level.&lt;/p&gt; &lt;li&gt; &lt;p&gt;A dedicated thread to perform garbage collection and a heap are provided for each CPU, and the heaps are collected at the same time. Each heap contains a small object heap and a large object heap, and all heaps can be accessed by user code. Objects on different heaps can refer to each other. &lt;/p&gt; &lt;li&gt; &lt;p&gt;Because multiple garbage collection threads work together, server garbage collection is faster than workstation garbage collection on the same size heap.&lt;/p&gt; &lt;li&gt; &lt;p&gt;Server garbage collection often has larger size segments.&lt;/p&gt; &lt;li&gt; &lt;p&gt;Server garbage collection can be resource-intensive. For example, if you have 12 processes running on a computer that has 4 processors, there will be 48 dedicated garbage collection threads if they are all using server garbage collection. In a high memory load situation, if all the processes start doing garbage collection, the garbage collector will have 48 threads to schedule.&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you are running hundreds of instances of an application, consider using workstation garbage collection with concurrent garbage collection disabled. This will result in less context switching, which can improve performance. &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Ref.: &lt;a href="http://msdn.microsoft.com/en-us/library/ee787088.aspx"&gt;Fundamentals of Garbage Collection&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-995572802628679012?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/995572802628679012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=995572802628679012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/995572802628679012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/995572802628679012'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/11/net-clr-large-object-heap.html' title='.NET CLR Large Object Heap'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3650385430362308718</id><published>2010-11-02T18:13:00.001+08:00</published><updated>2010-11-02T18:13:17.206+08:00</updated><title type='text'>Reminder: Perth .NET User Group Meeting: Thurs Nov 4th, Production .NET Debugging with Piers Williams</title><content type='html'>&lt;p&gt;In this talk, you will learn how to debug your application in the field with this exploration of advanced debugging techniques for managed code applications. Hang, crash, leak or other – we will go beyond Visual Studio debugging and talk about replicating and isolating problems using Perfmon, WMI, WinDbg, and automating the diagnosis with PowerShell using &lt;a href="http://powerdbg.codeplex.com/"&gt;PowerDbg&lt;/a&gt;. &lt;ul&gt; &lt;li&gt; &lt;p&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; Production .NET Debugging with Piers Williams&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;b&gt;DATE:&lt;/b&gt;&amp;nbsp;&amp;nbsp; Thursday, Nov 4th, 5:30pm - 7:00pm&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/p&gt; &lt;li&gt; &lt;p&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Piers is a .NET Architect with Beacon Technology, and a contributor to PowerDbg (&lt;a href="http://powerdbg.codeplex.com/"&gt;http://powerdbg.codeplex.com&lt;/a&gt;). &lt;p&gt;There will be a door prize of a choice of license from &lt;a href="http://perthdotnet.org/controlpanel/blogs/www.jetbrains.com"&gt;JetBrains&lt;/a&gt; (one of ReSharper , TeamCity Build Agent, dotTrace Profiler, RubyMine, IntelliJ IDEA), and several coupons to &lt;a href="http://www.tekpub.com/logos-and-slides"&gt;Tekpub&lt;/a&gt;'s high-quality, online screencasts for programmers. &lt;p&gt;If you have any problems getting in to the venue, please call me on 0422 971 731&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3650385430362308718?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3650385430362308718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3650385430362308718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3650385430362308718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3650385430362308718'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/11/reminder-perth-net-user-group-meeting.html' title='Reminder: Perth .NET User Group Meeting: Thurs Nov 4th, Production .NET Debugging with Piers Williams'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6131191485829080956</id><published>2010-10-22T15:23:00.001+08:00</published><updated>2010-10-22T15:23:55.564+08:00</updated><title type='text'>MSMVPS Site</title><content type='html'>&lt;p&gt;When I was awarded as a MVP, I had to decide whether to move my blog from blogger.com to the msmvps.com site. Conversations with a few MVPs about the site’s often downtime, convinced me to leave my blog where it is. Seems like it was a good decision; I haven’t been able to access the msmvps site for several hours today.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6131191485829080956?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6131191485829080956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6131191485829080956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6131191485829080956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6131191485829080956'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/msmvps-site.html' title='MSMVPS Site'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-2456185626649705396</id><published>2010-10-22T14:51:00.001+08:00</published><updated>2010-10-22T14:51:02.649+08:00</updated><title type='text'>Upgrading from SQL Server 2000 to 2008</title><content type='html'>&lt;p&gt;I put together these short notes a while back while helping with an upgrade. &lt;p&gt;&amp;nbsp; &lt;h4&gt;&lt;a name="_Toc222633101"&gt;&lt;font color="#b38d00"&gt;Side-by-Side Upgrade versus In-Place Upgrade&lt;/font&gt;&lt;/a&gt;&lt;/h4&gt; &lt;p&gt;There are two fundamental strategies for upgrading:&lt;b&gt;&lt;/b&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;In-place upgrade:&lt;/b&gt; uses the SQL Server 2008 Setup program to directly upgrade a SQL Server 2000 instance to SQL Server 2008. The older SQL Server instance is replaced.&lt;/li&gt; &lt;li&gt;&lt;b&gt;Side-by-side upgrade:&lt;/b&gt; performs operations to move all or data and other database components from SQL Server 2000 to a separate SQL Server 2008 instance.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In this case, we opted for a side-by-side upgrade, where a backup of the current database on SQL Server 2000 was restored to a clean install of SQL Server 2008 R2 and then upgraded in place. &lt;h4&gt;&amp;nbsp;&lt;/h4&gt; &lt;h4&gt;Before upgrade&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Run the Microsoft SQL Server 2008 Upgrade Advisor for all databases&lt;/b&gt; (including system databases). Review any deprecated features identified by the upgrade advisor (e.g. Notification Services, backup with TRUNCATE ONLY etc.) (SQL Server 2008's TSQL parser is stricter and some things that ran in 2000 might fail in 2008, but it is mostly deprecated TSQL language features anyway)&lt;/li&gt; &lt;li&gt;If using a SAN: &lt;strong&gt;Benchmark the SAN using SQLIO &lt;/strong&gt;and capture baseline data before performing the upgrade.&lt;/li&gt; &lt;li&gt;&lt;b&gt;Run database/application performance benchmarks&lt;/b&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Formulate and test a rollback plan &lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Ensure database consistency:&lt;/strong&gt; Run DBCC CHECKDB on databases to be upgraded to ensure that they are in a consistent state before performing the upgrade. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Back up all important files:&lt;/strong&gt; Back up all SQL Server databases from the instance to be upgraded (including master, model and msdb), data and transaction log files, as well as any application files, script files, extract files, etc. so that you can completely restore them if necessary.)&lt;/li&gt; &lt;li&gt;&lt;b&gt;Perform transaction log backup &lt;/b&gt;for all user databases and disable all the jobs including jobs for taking full backups, jobs to defrag and other maintenance plans. [It is also recommended to take an image of your database server, in case you will have to rollback.]&lt;/li&gt; &lt;li&gt;&lt;b&gt;If the&lt;/b&gt; &lt;b&gt;operating system of the server is Windows 2003&lt;/b&gt;, ensure Windows service pack 1 is installed. This needs to be done on all the nodes of a cluster in a Failover Clustered environment. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Reserve enough disk space: &lt;/strong&gt;Estimate the disk space required to upgrade SQL Server components, user databases, and any database files that might need to be created during the upgrade process. Might need two to three times the amount of disk space during the upgrade process. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Ensure enough space for system databases:&lt;/strong&gt; Configure system databases (master, model, msdb, and tempdb) to auto-grow during the upgrade process, and make sure that they have enough disk space for this growth.&lt;/li&gt; &lt;li&gt;&lt;strong&gt;Transfer logins:&lt;/strong&gt; Ensure all logins are transferred to the master database on the target server before upgrading the database. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Disable all start up stored procedures:&lt;/strong&gt; The upgrade process will usually stop and start services multiple times on the SQL Server instance being upgraded. Stored procedures set to execute on start-up might interfere with the upgrade process. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Stop replication: &lt;/strong&gt;Stop any replication and make sure that the replication log is empty at the start of the upgrade process. &lt;/li&gt; &lt;li&gt;&lt;strong&gt;Quit all applications: &lt;/strong&gt;Certain applications, including all services with SQL Server dependencies, might cause the upgrade process to fail if local applications are connected to the instance being upgraded. &lt;/li&gt;&lt;/ul&gt; &lt;h4&gt;After upgrade&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;Review all logs &lt;/li&gt; &lt;li&gt;Revisit Upgrade Advisor recommendations &lt;/li&gt; &lt;li&gt;Rebuild Indexes&lt;/li&gt; &lt;li&gt;Reconfigure Log Shipping (if this was in use)&lt;/li&gt; &lt;li&gt;Transfer and verify SQL Agent jobs and maintenance tasks &lt;/li&gt; &lt;li&gt;&lt;b&gt;Verify security settings: &lt;/b&gt;especially if there any cross server and/or cross-domain access privileges &lt;/li&gt; &lt;li&gt;Recreate any full text indexes removed from the databases. Re-populate Full-Text catalogs &lt;/li&gt; &lt;li&gt;&lt;b&gt;Update the statistics&lt;/b&gt; for all the databases. This step may take some time depending on the size of database. &lt;/li&gt; &lt;li&gt;&lt;b&gt;Change compatibility level&lt;/b&gt;: After initially restoring SQL Server 2000/2005 databases to SQL Server 2008, the compatibility level will still be 80/90, which corresponds to SQL Server 2000/2005 respectively. To take advantage of the new features of SQL Server 2008, &lt;b&gt;you must change the compatibility level to 100&lt;/b&gt;.&lt;/li&gt; &lt;li&gt;&lt;b&gt;Rebuild Indexes: &lt;/b&gt;To optimize query performance. &lt;/li&gt; &lt;li&gt;&lt;b&gt;Update usage counters&lt;/b&gt;: In earlier versions of SQL Server, the values for the table and index row counts and page counts can become incorrect. To correct any invalid row or page counts, run DBCC UPDATEUSAGE on all databases following the upgrade.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h4&gt;Resources&lt;/h4&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/cc936623(SQL.100).aspx"&gt;Resources for Upgrading to SQL Server 2008&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://download.microsoft.com/download/2/0/B/20B90384-F3FE-4331-AA12-FD58E6AB66C2/SQL%20Server%202000%20to%202008%20Upgrade%20White%20Paper.docx"&gt;SQL Server 2000 to 2008 Upgrade Whitepaper – Microsoft&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://technet.microsoft.com/en-us/library/ms144256.aspx"&gt;Using Upgrade Advisor to Prepare for Upgrades&lt;/a&gt;&lt;/li&gt; &lt;li&gt;The &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f5a6c5e9-4cd9-4e42-a21c-7291e7f0f852&amp;amp;displaylang=en"&gt;Microsoft SQL Server 2008 Upgrade Advisor&lt;/a&gt; can be downloaded from &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=f5a6c5e9-4cd9-4e42-a21c-7291e7f0f852&amp;amp;displaylang=en"&gt;here&lt;/a&gt;. The Microsoft SQL Server 2008 &lt;b&gt;R2&lt;/b&gt; Upgrade Advisor is part of the &lt;a href="http://go.microsoft.com/fwlink/?LinkId=192565"&gt;SQL Server 2008 R2 Feature Pack&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-2456185626649705396?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/2456185626649705396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=2456185626649705396' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2456185626649705396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/2456185626649705396'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/upgrading-from-sql-server-2000-to-2008.html' title='Upgrading from SQL Server 2000 to 2008'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-364647520570816053</id><published>2010-10-11T16:43:00.001+08:00</published><updated>2010-10-11T16:43:36.647+08:00</updated><title type='text'>Perth .NET User Group: December DevJam</title><content type='html'>&lt;p&gt;For December's meeting of the Perth .NET User Group (Thursday, 2nd December), we are running another DevJam community event, where anyone can give a short talk about anything .NET software development related. &lt;ul&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;strong&gt;Thursday, Dec 2nd, 5:30pm&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;You can talk about any development topic but it must be between 5 – 10 minutes long: &lt;ul&gt; &lt;li&gt;Anything you’ve done.&lt;/li&gt; &lt;li&gt;Any new technology you’ve investigated.&lt;/li&gt; &lt;li&gt;Any tips and tricks, or tools that aid development&lt;/li&gt; &lt;li&gt;Basically, anything .NET software development related!&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;How do I enter?&lt;/b&gt; You must register by sending an email to mitch.wheat at gmail.com, no later than 20th Nov, with the word &lt;b&gt;'DevJam’&lt;/b&gt; in the &lt;b&gt;subject&lt;/b&gt;, stating your talk &lt;b&gt;title&lt;/b&gt; in the &lt;b&gt;body&lt;/b&gt;. Let me know whether you will be bringing your own laptop (preferable). Presenter places are limited, so it's first come, first served. &lt;p&gt;There are prizes for the three highest, audience voted talks (with the organisers’ decision as final in case of a tie break). The first prize is a copy of &lt;a href="http://msdn.microsoft.com/en-us/subscriptions/subscriptionschart.aspx"&gt;Visual Studio 2010 Ultimate with MSDN &lt;/a&gt;subscription, worth approximately $12,000! There will several other prizes which will be announced shortly. &lt;p&gt;There will be pizza and refreshments provided. If you have any questions, please send me an email.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-364647520570816053?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/364647520570816053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=364647520570816053' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/364647520570816053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/364647520570816053'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/perth-net-user-group-december-devjam.html' title='Perth .NET User Group: December DevJam'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8219616437165268182</id><published>2010-10-07T11:57:00.001+08:00</published><updated>2010-10-07T11:57:42.647+08:00</updated><title type='text'>SQL Server 2008 Service Pack 2 Released</title><content type='html'>&lt;p&gt;Service Pack 2 for SQL Server 2008 includes new compatibility features with SQL Server 2008 R2, product improvements based on requests from the SQL Server community, and hotfix solutions provided in SQL Server 2008 SP1 Cumulative Updates 1 to 8.&lt;/p&gt; &lt;p&gt;You can download &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8fbfc1de-d25e-4790-88b5-7dda1f1d4e17&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8219616437165268182?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8219616437165268182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8219616437165268182' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8219616437165268182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8219616437165268182'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/sql-server-2008-service-pack-2-released.html' title='SQL Server 2008 Service Pack 2 Released'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4362668745608765808</id><published>2010-10-05T10:47:00.001+08:00</published><updated>2010-10-05T10:47:25.775+08:00</updated><title type='text'>MVP Re-awarded</title><content type='html'>&lt;p&gt;I’ve been re-awarded as a Microsoft MVP. Once again, I would like to thank everyone for their support. It’s an honour and I will try to live up to it. Congratulations to all those who were also awarded.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4362668745608765808?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4362668745608765808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4362668745608765808' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4362668745608765808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4362668745608765808'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/mvp-re-awarded.html' title='MVP Re-awarded'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-7734293436920797853</id><published>2010-10-04T21:48:00.001+08:00</published><updated>2010-10-04T21:48:41.273+08:00</updated><title type='text'>Reminder: Perth .NET User Group Meeting: Thurs 7th Oct, 5:30pm: So what is the Windows Server AppFabric? with Bill Chesnut</title><content type='html'>&lt;p&gt;Join us at the Perth .NET User Group for a talk exploring what the Windows Server AppFabric is, looking at both hosting and caching,&amp;nbsp; and learn how to configure and manage WCF and WF services in AppFabric. We will examine the diagnostic and tracing functionality while building high performance and fault-tolerant applications. &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp;&amp;nbsp; So what is the Windows Server AppFabric&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Thursday, Oct 7th, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;:&amp;nbsp; Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Bill is Mentor with SolidQ Australia located in Melbourne Australia. Bill started his career in IT some 25-years ago with the US Defence as an IBM Systems Programmer. He switched to the Microsoft Windows platform 14-years ago, and has been involved with Windows development ever since. Bill has worked on numerous enterprise projects using Microsoft C/C++, Visual Basic and SQL Server. Most recently, Bill has been driving various application integration projects using BizTalk Server (2000 – 2009) to connect a variety of Microsoft Business Solutions applications with other systems. Bill is also a Microsoft Certified Training and has been actively training BizTalk developers since the release of BizTalk 2004. Bill has been awarded as a BizTalk Server MVP since 2004 and is the leader of the Melbourne .Net User Group.  &lt;p&gt;There will be a door prize of a choice of license from &lt;a href="http://perthdotnet.org/controlpanel/blogs/www.jetbrains.com"&gt;JetBrains&lt;/a&gt; (one of ReSharper , TeamCity Build Agent, dotTrace Profiler, RubyMine, IntelliJ IDEA), and several 30-day coupons to &lt;a href="http://www.tekpub.com/logos-and-slides"&gt;Tekpub&lt;/a&gt;'s high-quality, online screencasts for programmers. &lt;p&gt;&lt;strong&gt;Also note:&lt;/strong&gt; Bill will be presenting a talk on SQL Server virtualisation at the SQL Server User Group on Weds 6th Oct. Details &lt;a href="http://www.sqlserver.org.au/Events/RegisterMeeting.aspx?EventId=495"&gt;here&lt;/a&gt;. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-7734293436920797853?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/7734293436920797853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=7734293436920797853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7734293436920797853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/7734293436920797853'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/10/reminder-perth-net-user-group-meeting.html' title='Reminder: Perth .NET User Group Meeting: Thurs 7th Oct, 5:30pm: So what is the Windows Server AppFabric? with Bill Chesnut'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8027914928992718517</id><published>2010-09-30T09:11:00.001+08:00</published><updated>2010-09-30T09:11:34.346+08:00</updated><title type='text'>Reminder: Agile Talks with Dave Thomas</title><content type='html'>&lt;p&gt;Just a quick reminder that Tonight Dave Thomas is presenting two talks this evening (Thurs 30th Sept). If you haven’t already registered, please register &lt;a href="http://yownightperth.eventbrite.com/?ref=eivte&amp;amp;invite=NDI5NDIzL21pdGNoQGlpbmV0Lm5ldC5hdS8w%0A&amp;amp;utm_source=eb_email&amp;amp;utm_medium=email&amp;amp;utm_campaign=invite"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a title="http://perthdotnet.org/blogs/events/archive/2010/09/06/perth-agile-night-thurs-30th-sept-with-dave-thomas.aspx" href="http://perthdotnet.org/blogs/events/archive/2010/09/06/perth-agile-night-thurs-30th-sept-with-dave-thomas.aspx"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8027914928992718517?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8027914928992718517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8027914928992718517' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8027914928992718517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8027914928992718517'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/reminder-agile-talks-with-dave-thomas.html' title='Reminder: Agile Talks with Dave Thomas'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-671275716747869310</id><published>2010-09-29T21:43:00.001+08:00</published><updated>2010-09-29T21:43:53.662+08:00</updated><title type='text'>Windows Phone 7 Deep Dive Workshop</title><content type='html'>&lt;p&gt;It’s a fact that we sometimes miss out in Perth when it comes to events that make the circuit over East. Well not this time!&lt;/p&gt; &lt;p&gt;Nick Randolph is running a free, 2-day event (14 - 15th October) on developing for Windows Phone 7: &lt;a href="http://nicksnettravels.builttoroam.com/blogengine/post/2010/09/29/Windows-Phone-7-Deep-Dive-Workshop-visiting-Perth.aspx"&gt;Windows Phone 7 Deep Dive Workshop visiting Perth&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;As well as founding the Perth .NET User Group, Nick has been working in the mobile space for many years and is a Microsoft Mobile Development MVP. Registrations are open at the above link. Get in quick, this event will fill up fast…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-671275716747869310?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/671275716747869310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=671275716747869310' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/671275716747869310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/671275716747869310'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/windows-phone-7-deep-dive-workshop.html' title='Windows Phone 7 Deep Dive Workshop'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-8442046322192420428</id><published>2010-09-21T22:18:00.001+08:00</published><updated>2010-09-21T22:18:08.289+08:00</updated><title type='text'>Perth .NET User Group Meeting: Thurs Oct 7th: So what is the Windows Server AppFabric? - Bill Chesnut</title><content type='html'>&lt;p&gt;Join us at the Perth .NET User Group, where Bill will explore what is Windows Server AppFabric, looking at both hosting and caching,&amp;nbsp; and learn how to configure and manage WCF and WF services in AppFabric. We will examine the diagnostic and tracing functionality while building high performance and fault-tolerant applications. &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt;&amp;nbsp; So what is the Windows Server AppFabric?&lt;/li&gt; &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, Oct 7th, 5:30pm - 7:00pm&lt;/li&gt; &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth&lt;/li&gt; &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Bill is Mentor with SolidQ Australia located in Melbourne Australia. Bill started his career in IT 25-years ago with the US Defence as an IBM Systems Programmer. He switched to the Microsoft Windows platform 14-years ago, and has been involved with Windows development ever since. Bill has worked on numerous enterprise projects using Microsoft C/C++, Visual Basic and SQL Server. Most recently, Bill has been driving various application integration projects using BizTalk Server (2000 – 2009) to connect a variety of Microsoft Business Solutions applications with other systems. Bill is also a Microsoft Certified Training and has been actively training BizTalk developers since the release of BizTalk 2004. Bill has been awarded as a BizTalk Server MVP since 2004 and is the leader of the Melbourne .Net User Group.  &lt;p&gt;There will be a door prize of a choice of license from &lt;a href="http://perthdotnet.org/controlpanel/blogs/www.jetbrains.com"&gt;JetBrains&lt;/a&gt; (one of ReSharper , TeamCity Build Agent, dotTrace Profiler, RubyMine, IntelliJ IDEA), and several 30-day coupons to &lt;a href="http://www.tekpub.com/logos-and-slides"&gt;Tekpub&lt;/a&gt;'s high-quality, online screencasts for programmers.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-8442046322192420428?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/8442046322192420428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=8442046322192420428' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8442046322192420428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/8442046322192420428'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/perth-net-user-group-meeting-thurs-oct.html' title='Perth .NET User Group Meeting: Thurs Oct 7th: So what is the Windows Server AppFabric? - Bill Chesnut'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-1708236599111570088</id><published>2010-09-21T22:16:00.001+08:00</published><updated>2010-09-21T22:16:17.656+08:00</updated><title type='text'>Agile Evening, Thurs 30th Sept with Dave Thomas</title><content type='html'>&lt;p&gt;Dave Thomas, a popular speaker and agile proponent has kindly agreed to present in Perth. He is a founding director of the Agile Alliance and is a Managing Director for Object Mentor a leader in XP, Craftmanship and Lean and Agile in the Large.&amp;nbsp; Dave is doing the opening keynote for the Agile 2010 Conference.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;YOW! Night: An Evening For Software Professionals&lt;br&gt;&lt;/strong&gt;Sponsored by Perth.NET and YOW! Developer Conference Australia (formerly known as JAOO) &lt;p&gt;In recognition of the importance of active software professionals who always seek improvement - YOW! Australia in cooperation with IBM, and your local user groups is pleased to invite you to join us for YOW! Nights. Hear great YOW! speakers and network with other software professionals.  &lt;blockquote&gt; &lt;p&gt;Provisional Schedule of Events (Thurs, 30th Sept) &lt;p&gt;5.30pm - 5.45pm&amp;nbsp; Doors Open  &lt;p&gt;5.45pm - 6.45pm&amp;nbsp; Presentation #1: Envisioning Backlogs  &lt;p&gt;6.45pm - 7.00pm Quick Break  &lt;p&gt;7.00pm - 8.00pm Presentation #2: Functional Programming and NoSQL Data  &lt;p&gt;8.00pm -&amp;nbsp; Q &amp;amp; A&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;This event requires registration as we expect places to fill up fast.&lt;/strong&gt; Please register &lt;a href="http://yownightperth.eventbrite.com/?ref=eivte&amp;amp;invite=NDI5NDIzL21pdGNoQGlpbmV0Lm5ldC5hdS8w%0A&amp;amp;utm_source=eb_email&amp;amp;utm_medium=email&amp;amp;utm_campaign=invite"&gt;here&lt;/a&gt; (where there are more details).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-1708236599111570088?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/1708236599111570088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=1708236599111570088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1708236599111570088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/1708236599111570088'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/agile-evening-thurs-30th-sept-with-dave.html' title='Agile Evening, Thurs 30th Sept with Dave Thomas'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-6772248454277935492</id><published>2010-09-08T23:34:00.001+08:00</published><updated>2010-09-08T23:34:14.291+08:00</updated><title type='text'>When Design Goes Bad, and The ‘One table to Rule Them All!’</title><content type='html'>&lt;p&gt;Via an interesting &lt;a href="http://www.simple-talk.com/sql/learn-sql-server/the-dis-information-principle,-part-ii/?utm_source=simpletalk&amp;amp;utm_medium=email-main&amp;amp;utm_content=DIS-20100908A&amp;amp;utm_campaign=SQL"&gt;article&lt;/a&gt; from Joe Celko on bad practices in database design and the horrors of EAV (Entity-Attribute-Value) tables, there is a &lt;a href="http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/"&gt;link&lt;/a&gt; to a great read on the ultimate ‘One table to Rule Them All’!&amp;nbsp; I find this tale very pertinent as I once did a short stint at a company with ‘start’ in their name, that had created a design with a single table for static data (although no where near as bad as the one described in &lt;a href="http://www.simple-talk.com/opinion/opinion-pieces/bad-carma/"&gt;‘Bad CaRMa’&lt;/a&gt;).&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-6772248454277935492?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/6772248454277935492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=6772248454277935492' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6772248454277935492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/6772248454277935492'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/when-design-goes-bad-and-one-table-to.html' title='When Design Goes Bad, and The ‘One table to Rule Them All!’'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-3900615803499684372</id><published>2010-09-06T22:11:00.001+08:00</published><updated>2010-09-06T22:11:37.177+08:00</updated><title type='text'>Perth Agile Night, Thurs 30th Sept with Dave Thomas</title><content type='html'>&lt;p&gt;Dave Thomas, a popular speaker and agile proponent has kindly agreed to present 2 talks in Perth. He is a founding director of the Agile Alliance and is a Managing Director for Object Mentor a leader in XP, Craftmanship and Lean and Agile in the Large.&amp;nbsp; Dave is doing the opening keynote for the Agile 2010 Conference.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;font color="#0000ff"&gt;YOW! Night: An Evening For Software Professionals&lt;/font&gt;&lt;br&gt;&lt;/strong&gt;Sponsored by Perth.NET and YOW! Developer Conference Australia (formerly known as JAOO)&lt;/p&gt; &lt;p&gt;In recognition of the importance of active software professionals who always seek improvement - YOW! Australia in cooperation with IBM, and your local user groups is pleased to invite you to join us for YOW! Nights. Hear great YOW! speakers and network with other software professionals. &lt;blockquote&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;Provisional Schedule of Events (Thurs, 30th Sept)&lt;/font&gt; &lt;p&gt;5.30pm - 5.45pm&amp;nbsp; Doors Open &lt;p&gt;5.45pm - 6.45pm&amp;nbsp; Presentation #1 Envisioning Backlogs &lt;p&gt;6.45pm - 7.00pm Quick Break &lt;p&gt;7.00pm - 8.00pm Presentation #2 Functional Programming and NoSQL Data &lt;p&gt;8.00pm -&amp;nbsp; Q &amp;amp; A&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;This event requires registration as we expect places to fill up fast.&lt;/strong&gt; Please register &lt;a href="http://yownightperth.eventbrite.com/?ref=eivte&amp;amp;invite=NDI5NDIzL21pdGNoQGlpbmV0Lm5ldC5hdS8w%0A&amp;amp;utm_source=eb_email&amp;amp;utm_medium=email&amp;amp;utm_campaign=invite"&gt;here&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-3900615803499684372?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/3900615803499684372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=3900615803499684372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3900615803499684372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/3900615803499684372'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/perth-agile-night-thurs-30th-sept-with.html' title='Perth Agile Night, Thurs 30th Sept with Dave Thomas'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-28468793.post-4680303150557421114</id><published>2010-09-01T22:23:00.001+08:00</published><updated>2010-09-01T22:23:01.642+08:00</updated><title type='text'>Reminder: Perth .NET User Group Meeting: Thurs 2nd Sept, 5:30pm: Test Driven Development – the Agile Perspective on Testing with Dwayne Read</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;font size="4"&gt;Please Note: Venue has changed to:&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Enex100 Seminar Room&lt;/strong&gt;, Level 3, Enex100, 100 St Georges Terrace&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;TOPIC:&lt;/b&gt; Test Driven Development (TDD) – the Agile Perspective on Testing  &lt;li&gt;&lt;b&gt;DATE&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Thursday, Sept 2nd, 5:30pm - 7:00pm  &lt;li&gt;&lt;b&gt;VENUE&lt;/b&gt;: Enex100 Seminar Room, Level 3, 100 St Georges Terrace, Perth  &lt;li&gt;&lt;b&gt;COST&lt;/b&gt;:&amp;nbsp;&amp;nbsp; Free. All welcome&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In this talk, we will look at how the discipline of being Test-Driven in an agile environment creates a before/just-in-time testing regime that drives the rest of the development (requirements, design and implementation). TDD is key to both optimizing (read eliminating) other “traditional” development techniques such as requirements specifications, design documents, etc as well as enabling other agile best practices such as short-iterations, architectural spikes and refactoring. We will look at the approach and what you need (people/roles, tools, process, mind-set, etc) to support this approach.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/28468793-4680303150557421114?l=mitch-wheat.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://mitch-wheat.blogspot.com/feeds/4680303150557421114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=28468793&amp;postID=4680303150557421114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4680303150557421114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/28468793/posts/default/4680303150557421114'/><link rel='alternate' type='text/html' href='http://mitch-wheat.blogspot.com/2010/09/reminder-perth-net-user-group-meeting.html' title='Reminder: Perth .NET User Group Meeting: Thurs 2nd Sept, 5:30pm: Test Driven Development – the Agile Perspective on Testing with Dwayne Read'/><author><name>Mitch Wheat</name><uri>http://www.blogger.com/profile/04779485555967868532</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
