<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Rob Farley : teched</title><link>http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx</link><description>Tags: teched</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>A busy month – a new book, a new car, a new phone</title><link>http://msmvps.com/blogs/robfarley/archive/2009/09/30/a-busy-month-a-new-book-a-new-car-a-new-phone.aspx</link><pubDate>Wed, 30 Sep 2009 12:50:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1728451</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1728451</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/09/30/a-busy-month-a-new-book-a-new-car-a-new-phone.aspx#comments</comments><description>&lt;p&gt;I don&amp;rsquo;t know why Septembers are always busy. This one feels like it&amp;rsquo;s been interesting, and I&amp;rsquo;m not sure life will be the same again.&lt;/p&gt;
&lt;p&gt;But first, some of the biggest news &amp;ndash; the book that I wrote a couple of chapters for is now available for purchase!&lt;/p&gt;
&lt;p&gt;&lt;img height="191" width="154" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.metablogapi/4380.nielsen_5F00_cover1501_5F00_514F0B46.jpg" align="left" alt="nielsen_cover150[1]" border="0" title="nielsen_cover150[1]" style="border-bottom:0px;border-left:0px;display:inline;margin-left:0px;border-top:0px;margin-right:0px;border-right:0px;" /&gt; A challenge was put out a while back for SQL MVPs to write a book for charity. Paul Nielsen spearheaded it, and I&amp;rsquo;m pleased to say that there was a massive response. I wrote two chapters, and this week we have had the notice that the book can now be purchased from Manning Press. If you go to &lt;a target="_blank" href="http://www.SQLServerMVPDeepDives.com"&gt;http://www.SQLServerMVPDeepDives.com&lt;/a&gt; you will be able to buy the Early Access Edition, which will get you updated electronic copies as the chapters become available (final layouts, images, etc still appearing). All the royalties for this book go to charity rather than the authors, so buy up! I promise to sign any copy put in front of me, but if you go to the PASS conference in November, you can probably get at least 40 or so of the other authors to sign it instead.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m planning to get a signed copy brought back from the US, and will auction it off to members of the Adelaide SQL Server User Group, giving the money to charity too.&lt;/p&gt;
&lt;p&gt;It feels good to have the book finished!&lt;/p&gt;
&lt;p&gt;September has also busy for a number of reasons. The &lt;a target="_blank" href="http://www.lobsterpot.com.au"&gt;company&lt;/a&gt; is growing nicely, celebrating a year this week, and keeping my time somewhat occupied. We achieved Gold Partner status with Microsoft at the end of August, and are ticking along well. On a more negative note, the winter has taken its toll with flu in the family, which is lousy &amp;ndash; but we also bought a new car (finally got the people mover we&amp;rsquo;ve been promising ourselves). I replaced my old phone with an iPhone (part of me thinks that I&amp;rsquo;ll go back to Windows Mobile next time), and bought my wife one too (plus a DS for her birthday). I feel like we&amp;rsquo;re more gadgety than ever!&lt;/p&gt;
&lt;p&gt;Not to mention TechEd Australia, which was a fun time. &lt;a target="_blank" href="http://www.angrykoala.com.au"&gt;Grant Paisley&lt;/a&gt; surfing at Dreamworld was a sight to behold, and I hope there are photos somewhere! I gave a talk on SQL Azure, which gave me a number of headaches leading up to the conference, finding new things I wanted to mention on a daily basis! I also gave a talk on the danger of scalar functions in SQL Server, which I will be repeating in just over a week at &lt;a target="_blank" href="http://www.sqldownunder.com/"&gt;Wagga&lt;/a&gt;, a couple of days after presenting at the &lt;a target="_blank" href="http://www.awdnug.org"&gt;Albury/Wodonga .Net User Group&lt;/a&gt;. An email arrived about half an hour after my scalar functions talk, saying that someone in the audience had just applied the principles I showed and made some vital queries run thirty times faster! Terrific news I think.&lt;/p&gt;
&lt;p&gt;Bringing another laptop (an HP Mini) home from TechEd has also added to the number of gadgets in the house&amp;hellip; &lt;/p&gt;
&lt;p&gt;Tomorrow I hope to be able to write that I have been awarded MVP status for another year, which will be a tremendous honour. I keep wondering how much longer I&amp;rsquo;ll be able to remain in the company of such a fantastically skilled and helpful crowd. Every time I receive the award I&amp;rsquo;m both humbled and proud, and feel amazingly blessed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1728451" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/code+camp/default.aspx">code camp</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/mvp/default.aspx">mvp</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/book+review/default.aspx">book review</category></item><item><title>Four speaking engagements coming up</title><link>http://msmvps.com/blogs/robfarley/archive/2009/07/16/four-speaking-engagements-coming-up.aspx</link><pubDate>Thu, 16 Jul 2009 10:55:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1702304</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1702304</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/07/16/four-speaking-engagements-coming-up.aspx#comments</comments><description>&lt;p&gt;I’m just going to list them…&lt;/p&gt;  &lt;p&gt;This Saturday (July 18th), at &lt;a href="http://www.codecampsa.com" target="_blank"&gt;Code Camp SA&lt;/a&gt;. I’m going to be talking about functions in SQL, particularly those that involve BEGIN and END.&lt;/p&gt;  &lt;p&gt;At the end of the month, at the &lt;a href="http://www.acs.org.au/sa/2009conference/" target="_blank"&gt;ACS Branch Conference&lt;/a&gt;. I’m going to be part of a panel discussing Open Source v Closed Source.&lt;/p&gt;  &lt;p&gt;In August, I’m going to be speaking at &lt;a href="http://www.sharepointusers.org.au/Adelaide/" target="_blank"&gt;SharePoint Saturday (Adelaide)&lt;/a&gt;, about the integration of Reporting Services and SharePoint.&lt;/p&gt;  &lt;p&gt;In September, I’m going to be a presenting at &lt;a href="http://www.msteched.com/australia/Public/SessionList.aspx" target="_blank"&gt;TechEd Australia&lt;/a&gt;, about SQL Azure.&lt;/p&gt;  &lt;p&gt;Be nice if there was more of an overlap in topics…&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1702304" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/code+camp/default.aspx">code camp</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/adelaide/default.aspx">adelaide</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/acs/default.aspx">acs</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Big events every month this quarter</title><link>http://msmvps.com/blogs/robfarley/archive/2009/07/01/big-events-every-month-this-quarter.aspx</link><pubDate>Wed, 01 Jul 2009 02:23:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1697416</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1697416</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/07/01/big-events-every-month-this-quarter.aspx#comments</comments><description>&lt;p&gt;A new Financial Year in Australia, and a bunch of technical events coming up.&lt;/p&gt;  &lt;p&gt;Of course there’s the &lt;a href="http://www.sqlserver.org.au" target="_blank"&gt;usual monthly user groups&lt;/a&gt;, but there’s more – particularly if you’re in Adelaide.&lt;/p&gt;  &lt;p&gt;July sees &lt;a href="http://www.codecampsa.com/" target="_blank"&gt;CodeCampSA&lt;/a&gt; in Adelaide on the weekend of July 18/19. I’ve put my name into the hat for speakers, and will try to be there for a chunk of Saturday (Sundays are too busy for me). I’m sure at least one of my sons will want to come along as well, which will be fun. Big thanks to &lt;a href="http://davidgardiner.blogspot.com/" target="_blank"&gt;David Gardiner&lt;/a&gt; for putting the website together.&lt;/p&gt;  &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:e516c336-fb60-4b42-a436-51f77f6fba12" class="wlWriterEditableSmartContent"&gt;&lt;a href="http://maps.live.com/default.aspx?v=2&amp;amp;cp=-34.92264~138.5971&amp;amp;lvl=15&amp;amp;style=r&amp;amp;sp=aN.-34.92252_138.5924_CityWest%2520(UniSA)_&amp;amp;mkt=en-us&amp;amp;FORM=LLWR" id="map-4c67c448-1eb5-4571-a88a-13d9bafab96a" title="Click to view this map on Live.com"&gt;&lt;img src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.metablogapi/0005.map6e285d2981ff_5F00_45F4D382.jpg" width="320" height="240" alt="Map picture" /&gt;&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;August sees SharePoint Saturday come to &lt;a href="http://www.sharepointsaturday.org/sydney/default.aspx" target="_blank"&gt;Sydney&lt;/a&gt; (8th) and &lt;a href="http://www.sharepointsaturday.org/adelaide/default.aspx" target="_blank"&gt;Adelaide&lt;/a&gt; (15th). You may not agree with &lt;a href="http://twitter.com/AaronSaikovski2/status/2324273317" target="_blank"&gt;Aaron about what SharePoint is&lt;/a&gt;, but if you’re into SharePoint, I’m sure you’ll get a lot out of these events.&lt;/p&gt;  &lt;p&gt;September brings Australian geeks to the Gold Coast again for the Microsoft’s annual &lt;a href="http://www.msteched.com/australia/Public/default.aspx" target="_blank"&gt;TechEd Australia&lt;/a&gt;, this year with the added incentive of an &lt;a href="http://www.msteched.com/australia/Public/windows-7-experience.aspx" target="_blank"&gt;HP Mini for attendees&lt;/a&gt; (conditions apply of course). It’s the 2140, which is a discontinued line, but that doesn’t make it any less attractive a machine. I’m sure this will help persuade people to get themselves over to Queensland.&lt;/p&gt;  &lt;p&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://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.metablogapi/1588.image_5F00_55483591.png" width="334" height="265" /&gt;&amp;#160;&amp;#160; &lt;div style="padding-bottom:0px;margin:0px;padding-left:0px;padding-right:0px;display:inline;float:none;padding-top:0px;" id="scid:84E294D0-71C9-4bd0-A0FE-95764E0368D9:79776f6f-473c-4409-aaa3-a0ecd6f4e347" class="wlWriterEditableSmartContent"&gt;&lt;a href="http://maps.live.com/default.aspx?v=2&amp;amp;cp=-28.02945~153.4315&amp;amp;lvl=15&amp;amp;style=a&amp;amp;scene=28150024&amp;amp;sp=aN.-28.02827_153.4288_Gold%2520Coast%2520Convention%2520Centre_&amp;amp;mkt=en-us&amp;amp;FORM=LLWR" id="map-5b6f7636-6577-422f-ac4d-88ba141b37d3" title="Click to view this map on Live.com"&gt;&lt;img src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.metablogapi/6862.mapee0fbab19253_5F00_77DC4E3F.jpg" width="320" height="240" alt="Map picture" /&gt;&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;And in case you hadn’t realised, I’ve recently discovered how easy it is to put maps into blogs using Windows Live Writer… just so that you can all see the beach, and understand how poorly attended the sessions would be if they ran TechEd Australia in the summer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1697416" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/adelaide/default.aspx">adelaide</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>GO - repeating batches</title><link>http://msmvps.com/blogs/robfarley/archive/2008/12/06/go-repeating-batches.aspx</link><pubDate>Fri, 05 Dec 2008 22:19:13 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1655922</guid><dc:creator>Rob Farley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1655922</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/12/06/go-repeating-batches.aspx#comments</comments><description>&lt;p&gt;GO is very cool. More so than you might think, and in a couple of interesting ways. This is the 6th tip from my TechEd Australia talk, from which you can see my &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx" target="_blank"&gt;slides&lt;/a&gt; and &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx" target="_blank"&gt;scripts&lt;/a&gt; in other posts.&lt;/p&gt; &lt;p&gt;In SQL Server, GO is the traditional batch separator. But what many people don&amp;#39;t know (but has been mentioned around the blogosphere several times over the past year or so), is that you can put a number after GO to make the batch run repeatedly. I often use this method to populate lots of sample data into a table.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;INSERT dbo.someTable (col1, col2)&lt;br /&gt;SELECT col1, col2&lt;br /&gt;FROM dbo.someTable;&lt;br /&gt;GO 5&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;If my table starts with 10 rows, it will insert a copy of those ten rows, then twenty, then forty, eighty, and finally an extra 160, leaving me with 320 rows in my table. I guess I could have hit F5 5 times, but you get the point.&lt;/p&gt; &lt;p&gt;The fun side of GO is that it&amp;#39;s a configurable option in Management Studio. Head into Tools, Options, and you&amp;#39;ll see it under Query Execution.&lt;/p&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="373" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.GOrepeatingbatches_5F00_12A82/image_5F00_9.png" width="644" border="0" /&gt; &lt;/p&gt; &lt;p&gt;Now, I would never condone changing this on a colleague&amp;#39;s machine. If you do, then GO will start causing errors. Scripts that once worked will probably start failing (but not necessarily all - simple queries might just think GO is an alias).&lt;/p&gt; &lt;p&gt;But if you want to be really mean - and again, I would never suggest you do this to that annoying colleague who always leaves their laptop unlocked when they head off to lunch, even if they just live to frustrate every waking minute of your life - if you want to be really mean, you set the Batch separator to SELECT.&lt;/p&gt; &lt;p&gt;I&amp;#39;m sure your eyes have just dilated at the pure evil. And so they should. Now, even the most basic of queries will give the nastiest of errors. Restarting SSMS won&amp;#39;t fix it. Rebooting won&amp;#39;t fix it. You had better make sure you don&amp;#39;t consider doing this to a colleague - if they realise (having searched online for &amp;quot;A fatal scripting error occurred. Incorrect syntax was encountered while parsing SELECT.&amp;quot; and found this post), they may figure it out and it won&amp;#39;t be good for you. At least make sure you&amp;#39;re around to help them when they first panic.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.GOrepeatingbatches_5F00_12A82/image_5F00_11.png"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="374" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.GOrepeatingbatches_5F00_12A82/image_5F00_thumb_5F00_4.png" width="644" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1655922" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Ordered data requires ORDER BY</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/16/ordered-data-requires-order-by.aspx</link><pubDate>Sun, 16 Nov 2008 12:05:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1654247</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1654247</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/11/16/ordered-data-requires-order-by.aspx#comments</comments><description>&lt;p&gt;When you select data out of a database table, it might seem as if the system will give you data in the order of the clustered index that is on that table (assuming it has one), but this isn&amp;#39;t quite right. I showed this in the fifth of my T-SQL tips at TechEd Australia this year.&lt;/p&gt; &lt;p&gt;If you don&amp;#39;t explicitly order data using the ORDER BY clause, the system makes no attempt to provide you with the data in any particular order. It will just give you the data in the fastest way possible. You might be lucky and get the data in a predictable order most of the time. In fact, on your system, the data might be returned in a predictable order over 99% of the time. Unfortunately, you can&amp;#39;t rely on that.&lt;/p&gt; &lt;p&gt;When the database engine is handling your query, it needs to get your data into RAM first. If it&amp;#39;s not already there, this means a trip to disk, which will generally be the slowest aspect of your query. With multiple processors and multiple disks being the norm these days, there is a good chance that one processor will head off to get the data from one disk, while another processor gets data from another. If your query isn&amp;#39;t explicitly stating the order for your data, whichever processor gets its data first is likely to determine which data appears first in your results. There are other reasons why your data might come back in an unexpected order, but this reason alone should convince you.&lt;/p&gt; &lt;p&gt;I&amp;#39;m sure reading this, you&amp;#39;re very much used to putting ORDER BY in your queries. But what happens if you&amp;#39;re using SQL Server Integration Services (SSIS)? When you set up a data flow and want to pull data out of a particular table or view, do you use the &amp;quot;Table or View&amp;quot; option in the data source? You might - it&amp;#39;s a lot easier than typing your query out if you choose the SQL Command option. Just don&amp;#39;t. Use the SQL Command option instead.&lt;/p&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="189" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.OrdereddatarequiresORDERBY_5F00_1170C/image_5F00_5.png" width="506" border="0" /&gt; &lt;/p&gt; &lt;p&gt;The problem is that SSIS can really take advantage of ordered data. If SSIS can&amp;#39;t guarantee that the data is ordered, it will assume it&amp;#39;s not, and this might hurt the performance of your package significantly. Some data flow transformations can&amp;#39;t even run on unordered data. You can tell a data flow source that the data is ordered. You can even tell it that it is, even if it&amp;#39;s not. Don&amp;#39;t do this. Only tell a data flow source that it&amp;#39;s ordered if you&amp;#39;re explicitly ordering it. If you tell SSIS that a data flow is ordered, and the data comes through in a different order (because you&amp;#39;re unlucky one time), you will get unexpected results. What I mean by &amp;#39;unexpected&amp;#39; here is &amp;#39;wrong&amp;#39;.&lt;/p&gt; &lt;p&gt;It&amp;#39;s not hard, just write out your query, and use the ORDER BY clause. You know you should...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1654247" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/ssis/default.aspx">ssis</category></item><item><title>Unique Indexes with GROUP BY</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/09/unique-indexes-with-group-by.aspx</link><pubDate>Sun, 09 Nov 2008 07:16:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1653559</guid><dc:creator>Rob Farley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1653559</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/11/09/unique-indexes-with-group-by.aspx#comments</comments><description>&lt;p&gt;Indexes are great, but if you don&amp;#39;t understand the significance of unique indexes, then you&amp;#39;re potentially missing out on some decent performance gains. &lt;/p&gt; &lt;p&gt;I&amp;#39;ve been meaning to write this blog post for a long time. This is material that I&amp;#39;ve been teaching and presenting about all year, but somehow it&amp;#39;s never turned into a blog post. It was the third tip in my presentation at TechEd Australia (and at &lt;a href="http://www.sqlserver.org.au" target="_blank"&gt;user group events&lt;/a&gt; in Adelaide and Melbourne). Today I&amp;#39;m flying back home from the US, so hopefully I&amp;#39;ll be able to spend some battery time getting it done. [Note: It&amp;#39;s ended up out of order with &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/11/09/join-simplification-in-sql-server.aspx" target="_blank"&gt;another post&lt;/a&gt; that I wrote on the plane. This one is &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx" target="_blank"&gt;Tip #3&lt;/a&gt;.]&lt;/p&gt; &lt;p&gt;This query runs in the AdventureWorks database, in almost any version of SQL Server you have. When I present on this at the moment, I use SQL Server 2005, so that people don&amp;#39;t think I&amp;#39;m just showing new SQL Server 2008 features. This concept will help you regardless of version.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT s.Name, COUNT(*)&lt;br /&gt;FROM Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; JOIN&lt;br /&gt;&amp;nbsp; Production.Product p&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID&lt;br /&gt;GROUP BY s.Name;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;It&amp;#39;s a simple query that counts the number of products in each non-empty subcategory. Having seen the logical action of the query, let&amp;#39;s look at the execution plan. This will show us what the query is actually doing. We&amp;#39;ll look at it both graphically and in text. The graphical representation is stored as XML, and additional information can be seen using the tool tips and the Properties window.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.UniqueIndexeswithGROUPBY_5F00_F2F6/6_2D00_planwithindex_5F00_4.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="391" alt="" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.UniqueIndexeswithGROUPBY_5F00_F2F6/6_2D00_planwithindex_5F00_thumb_5F00_1.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;|--Merge Join(Inner Join, MERGE:([p].[ProductSubcategoryID])=(.[ProductSubcategoryID]), RESIDUAL:([AdventureWorks].[Production].[ProductSubcategory].[ProductSubcategoryID] as .[ProductSubcategoryID]=[AdventureWorks].[Production].[Product].[ProductSubcategoryID] as [p].[ProductSubcategoryID]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Compute Scalar(DEFINE:([Expr1004]=CONVERT_IMPLICIT(int,[Expr1016],0)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Stream Aggregate(GROUP BY:([p].[ProductSubcategoryID]) DEFINE:([Expr1016]=Count(*)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Sort(ORDER BY:([p].[ProductSubcategoryID] ASC))&lt;br /&gt;&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; |--Clustered Index Scan(OBJECT:([AdventureWorks].[Production].[Product].[PK_Product_ProductID] AS [p]))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Clustered Index Scan(OBJECT:([AdventureWorks].[Production].[ProductSubcategory].[PK_ProductSubcategory_ProductSubcategoryID] AS ), ORDERED FORWARD)  &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;The Stream Aggregate operator is where the GROUP BY work is done. Having sorted the data, the system can look through it for changes, calculating whatever aggregates are needed at the time. The properties window or the text view show clearly that the count is being calculated here.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;And they show that the field being grouped by is p.ProductSubcategoryID&lt;/strong&gt;. But our query said we should group by s.Name. So what&amp;#39;s going on? It&amp;#39;s not picking the right field. It&amp;#39;s not even picking the right table.&lt;/p&gt; &lt;p&gt;But our system has a unique index on s.Name. GROUP BY looks for the distinct values from the fields in the GROUP BY clause, but if a unique index is on one of those fields, every row in that table is already known to be distinct. Our unique index is letting the system have some more freedom.&lt;/p&gt; &lt;p&gt;Because s.ProductSubcategoryID is also known to be unique (it happens to be the Primary Key (PK) of the table), it is logically equivalent to consider this field in place of s.Name. And as we are joining to the Product table on this field, it is even okay to group by the field from Product. The s.Name field is fetched later and brought into our result set using the Merge Join operator. It&amp;#39;s not hard to recognise that our query is asking for the number of products per subcategory, and that we&amp;#39;re only really grouping by s.Name because that&amp;#39;s the field that we want to display.&lt;/p&gt; &lt;p&gt;Now let&amp;#39;s consider what happens if we remove the unique index on s.Name. Interestingly, if you have been evaluating your indexes using sys.dm_db_index_usage_stats, you may consider that the index isn&amp;#39;t being used. Unfortunately, the fact that the query optimizer does actually use the query isn&amp;#39;t reported very obviously. Once the index is removed, the query plan changes. This demonstrates that the index is definitely being used, even if it&amp;#39;s not used in a way that gets reflected in sys.dm_db_index_usage_stats.&lt;/p&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.UniqueIndexeswithGROUPBY_5F00_F2F6/7_2D00_planwithoutindex_5F00_2.png"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="381" alt="" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.UniqueIndexeswithGROUPBY_5F00_F2F6/7_2D00_planwithoutindex_5F00_thumb.png" width="644" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;|--Compute Scalar(DEFINE:([Expr1004]=CONVERT_IMPLICIT(int,[Expr1007],0)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Stream Aggregate(GROUP BY:(.[Name]) DEFINE:([Expr1007]=Count(*)))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |--Sort(ORDER BY:(.[Name] ASC))&lt;br /&gt;&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; |--Hash Match(Inner Join, HASH:(.[ProductSubcategoryID])=([p].[ProductSubcategoryID]), RESIDUAL:([AdventureWorks].[Production].[ProductSubcategory].[ProductSubcategoryID] as .[ProductSubcategoryID]=[AdventureWorks].[Production].[Product].[ProductSubcategoryID] as [p].[ProductSubcategoryID]))&lt;br /&gt;&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; |--Clustered Index Scan(OBJECT:([AdventureWorks].[Production].[ProductSubcategory].[PK_ProductSubcategory_ProductSubcategoryID] AS ))&lt;br /&gt;&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; |--Clustered Index Scan(OBJECT:([AdventureWorks].[Production].[Product].[PK_Product_ProductID] AS [p]))  &lt;p&gt;It has clearly changed a lot. Now, the Stream Aggregate operator reports that it is grouping by s.Name - just like we asked. But you may also notice that the Estimated Subtree Cost is about 30% worse than the previous query. The system is treating this query in exactly the way that we asked - reporting the number of products per subcategory name, rather than per subcategory.&lt;/p&gt; &lt;p&gt;We can address this without the unique index, if we change the query. The answer is to simply include the Primary Key of the subcategory in the GROUP BY clause. Even though we don&amp;#39;t want to include that field in the result set, listing it in the GROUP BY clause will let the system optimise the query better even without the unique index. Bear in mind that if there is a duplicate subcategory name, there will be an extra row that didn&amp;#39;t appear before - but this is correct we&amp;#39;re grouping by subcategory rather than subcategory name. Having s.Name in the GROUP BY clause is ignored (as in our original plan) - it&amp;#39;s only listed there because we want to list it in the SELECT clause.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT s.Name, COUNT(*)&lt;br /&gt;FROM Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; JOIN&lt;br /&gt;&amp;nbsp; Production.Product p&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID&lt;br /&gt;GROUP BY s.Name, s.ProductSubcategoryID;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The unique index simply allows the PK to be implicitly inserted into the GROUP BY clause. &lt;/p&gt; &lt;p&gt;As a query developer, you should ask yourself if you&amp;#39;re wanting to group by the entity described by the table or just a particular column. If you&amp;#39;re really wanting it to be entity, then include the PK in the GROUP BY clause, or else understand the impact of the unique index. And definitely appreciate that there may be queries which are helped by the existence of unique indexes.&lt;/p&gt; &lt;p&gt;I do think that it&amp;#39;s worth evaluating index usage. Having an unused index in your system is like having the Yellow Pages in your house if you never use it - just taking up cupboard space. Dropping an unused index may not work for you though, particularly if it&amp;#39;s unique.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1653559" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>JOIN simplification in SQL Server</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/09/join-simplification-in-sql-server.aspx</link><pubDate>Sat, 08 Nov 2008 23:50:05 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1653544</guid><dc:creator>Rob Farley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1653544</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/11/09/join-simplification-in-sql-server.aspx#comments</comments><description>&lt;p&gt;This is another of my tips/techniques that I demonstrated recently. It is not a new SQL Server 2008 feature - it works just fine in older versions - I demonstrated it running on SQL Server 2005 but using SQL Server 2008 Management Studio. [Note: It&amp;#39;s ended up appearing earlier than &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/11/09/unique-indexes-with-group-by.aspx" target="_blank"&gt;another post&lt;/a&gt; that I wrote on the plane. This one is &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx" target="_blank"&gt;Tip #4&lt;/a&gt;.]&lt;/p&gt; &lt;p&gt;When you have a single-table query and then introduce a JOIN, there are a number of ways in which that JOIN impacts your query. I want to talk about four such JOIN effects that I&amp;#39;ve identified. Understanding these four effects will help you take advantage of the simplification I am about to show you. Don&amp;#39;t focus on the simplification, focus on the effects. I will show you later how the concept can be applied to help database developers.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;strong&gt;1. Extra columns&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This seems fairly straight forward - we have access to additional columns (the one in the new table). It&amp;#39;s the main reason we tend to join to other tables - we simply don&amp;#39;t have all the data in our original table.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;2. Duplicated rows&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Not necessarily duplicated completely, but certainly a row in our original table may appear multiple times in our result set, if it matches with multiple rows in the new table. Notice that this doesn&amp;#39;t occur if the join-fields (those used in the ON clause) in the new table are known to be unique (as is the case with a Foreign-Key lookup).&lt;/p&gt; &lt;p&gt;&lt;strong&gt;3. Eliminated rows&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;In a similar manner, if a row in our original table doesn&amp;#39;t match with any rows in the new table, it might get eliminated from the results. Notice that this doesn&amp;#39;t occur if a LEFT JOIN or FULL JOIN is being used.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;4. Added NULLs&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This effect is somewhat rarer, but still worth mentioning. If a RIGHT JOIN or FULL JOIN is being used, then there may be NULLs added to our result set to reflect rows in our new table that don&amp;#39;t have matches in our original one. This doesn&amp;#39;t happen unless a RIGHT JOIN or FULL JOIN is being used.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Let&amp;#39;s examine some queries. They all use the AdventureWorks sample database.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT p.ProductID, p.Name, p.Color, p.Size&lt;br /&gt;FROM Production.Product p;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This is our starting place. Our control query if you like. Its execution plan is very simple - a clustered index scan on the Product table. There are no other tables that need to be involved. It returns 504 rows.&lt;/p&gt; &lt;p&gt;Now let&amp;#39;s involve another table - Production.ProductSubcategory.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT p.ProductID, p.Name, p.Color, p.Size, s.Name as SubcatName&lt;br /&gt;FROM Production.Product p&lt;br /&gt;&amp;nbsp; JOIN&lt;br /&gt;&amp;nbsp; Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This is a fairly standard lookup query. It&amp;#39;s essentially still about the Product table, but we&amp;#39;re hooking into the Subcategory table to be able to fetch some more information. Clearly we want effect #1 to take place.  &lt;p&gt;But what about the other effects?  &lt;p&gt;We don&amp;#39;t have duplicated rows, as s.ProductSubcategoryID is known to be unique (it&amp;#39;s the Primary Key).  &lt;p&gt;We&amp;#39;re not introducing NULLs on the Product table side of the query, as we&amp;#39;re not using RIGHT JOIN or FULL JOIN.  &lt;p&gt;And because this is a foreign key relationship, our constraint should stop us from eliminating rows. Only valid values can be used in p.ProductSubcategoryID - but this field can take NULLs, so in fact, the Eliminated Rows effect is taking place. Looking at the results of the query show that only 295 rows are returned. This can be avoided by using a LEFT JOIN instead of the INNER JOIN.  &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT p.ProductID, p.Name, p.Color, p.Size, s.Name as SubcatName&lt;br /&gt;FROM Production.Product p&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now we are only seeing the first JOIN effect. As expected, the execution plan involves indexes on both queries.&lt;/p&gt; &lt;p&gt;But look what happens if you remove s.Name from the query.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;SELECT p.ProductID, p.Name, p.Color, p.Size&lt;br /&gt;FROM Production.Product p&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now, none of our four effects are coming into play. And when we look at the execution plan, we see something surprising.&lt;/p&gt; &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="370" alt="" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.JOINsimplificationinSQLServer_5F00_910E/image_5F00_3.png" width="644" border="0" /&gt; &lt;/p&gt; &lt;p&gt;The query has simplified back down to to a single-table query. The query optimizer has deemed that the JOIN wasn&amp;#39;t having any effect on the query and therefore removed it.&lt;/p&gt; &lt;p&gt;At the moment, this may seem quite academic, but this can be leveraged to make life a lot easier for the average database developer.&lt;/p&gt; &lt;p&gt;It turns out that about half the time I need to refer to Products, I need to perform a bunch of lookups. I need to look up ProductType information, ProductSubcategory information, ProductCategory information, and so on. But each of these lookups makes my query-writing a little slower. I might be quite quick at writing these queries, but my queries typically have ten lines or more that are just providing the lookup logic.&lt;/p&gt; &lt;p&gt;It would be so much nicer to have a view called ProductsPlus, which was a slightly denormalised version of the Product table - including all my lookup information.&lt;/p&gt; &lt;p&gt;The problem is that without an understanding of the four join-effects, the system is probably going to be performing all the lookups every time you use the ProductsPlus view, even if you&amp;#39;re not interested in all the lookup columns. Examining the join-effects, we can eliminate them, just like in the previous example.&lt;/p&gt; &lt;p&gt;Let&amp;#39;s consider the contents of our ProductsPlus view. We have foreign key relationships in place to assist. All the FK columns can take NULL, so we are using LEFT JOIN. If they didn&amp;#39;t allow NULL, INNER JOIN would be okay.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;CREATE VIEW dbo.ProductsPlus&lt;br /&gt;AS&lt;br /&gt;SELECT p.ProductID, p.Name, p.Color, p.Size, s.Name AS SubcatName, c.Name AS CatName, m.Name AS ModelName, su.Name AS SizeUnit&lt;br /&gt;FROM Production.Product p&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.ProductSubcategory s&lt;br /&gt;&amp;nbsp; ON p.ProductSubcategoryID = s.ProductSubcategoryID&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.ProductCategory c&lt;br /&gt;&amp;nbsp; ON s.ProductCategoryID = c.ProductCategoryID&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.ProductModel m&lt;br /&gt;&amp;nbsp; ON m.ProductModelID = p.ProductModelID&lt;br /&gt;&amp;nbsp; LEFT JOIN&lt;br /&gt;&amp;nbsp; Production.UnitMeasure su&lt;br /&gt;&amp;nbsp; ON su.UnitMeasureCode = p.SizeUnitMeasureCode&lt;br /&gt;;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;When I query this view using SELECT * FROM dbo.ProductsPlus, I get all the tables involved, of course.  &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="370" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.JOINsimplificationinSQLServer_5F00_910E/image_5F00_6.png" width="644" border="0" /&gt;  &lt;p&gt;But because we took care when creating the view to avoid effects #2, #3 and #4, when we only need certain columns, the other tables are completely ignored.  &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="370" alt="" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.JOINsimplificationinSQLServer_5F00_910E/image_5F00_15.png" width="644" border="0" /&gt;  &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="370" alt="" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.JOINsimplificationinSQLServer_5F00_910E/image_5F00_18.png" width="644" border="0" /&gt; &lt;/p&gt; &lt;p&gt;Now your SELECT queries can be much shorter and easier to read, without involving tables needlessly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1653544" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Doing the maths to understand SQL optimiser choices</title><link>http://msmvps.com/blogs/robfarley/archive/2008/10/12/doing-the-maths-to-understand-sql-optimiser-choices.aspx</link><pubDate>Sun, 12 Oct 2008 01:24:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650597</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1650597</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/10/12/doing-the-maths-to-understand-sql-optimiser-choices.aspx#comments</comments><description>&lt;p&gt;The second of my tips from my talk (&lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx" target="_blank"&gt;slides&lt;/a&gt; and &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx" target="_blank"&gt;scripts&lt;/a&gt; available) was about doing the maths to understand why the SQL Server optimiser behaves in the way that it does - particularly in relation to choosing whether to scan an index/heap, or whether to seek a less-suitable index for some of the data and then do a lookup to fetch the rest. This applies in SQL Server 2005 just fine, by the way, as do all the scripts from my talk.&lt;/p&gt; &lt;p&gt;The basic gist of it is that the system will decide to use a plan which minimises the number of reads required to get all the data. So My example scripts compare a scenario of looking up employees in AdventureWorks.HumanResources.Employee by managerid. There&amp;#39;s a Non-Clustered Index on ManagerID (which naturally then includes EmployeeID, which is the Clustered Index). But if we also want the LoginID field, then our NCIX isn&amp;#39;t quite so handy.&lt;/p&gt; &lt;p&gt;The choice of how to implement this comes down to basic mathematics. First, a couple of useful facts:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;The whole Employee table (CIX in the physical representation) is on 9 pages.&lt;/li&gt; &lt;li&gt;Seeks on small indexes typically take 2 reads - one to find out which page the row is on, and the other to get that page.&lt;/li&gt; &lt;li&gt;Lookups are essentially the same kind of thing as seeks.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;So let&amp;#39;s consider the two options here - scanning the table v seeking the index and looking up the rest.&lt;/p&gt; &lt;p&gt;Scanning a table is always going to be 9 reads. Easy.&lt;/p&gt; &lt;p&gt;Seeking the table is going to take a couple of reads (but maybe three even) to find the EmployeeIDs for the people that report to the manager of interest. But then it&amp;#39;s going to require another two reads for every employee in this list, to be able to get the LoginID field out of the CIX. So it&amp;#39;s going to be 2+2n reads (where n is the number of employees).&lt;/p&gt; &lt;p&gt;So if our manager has 2 reports, we get 2+2x2=6 reads using the seek, and the system will use this method.&lt;/p&gt; &lt;p&gt;But if our manager has 4 reports, we get 2+2x4=10 reads using the seek, which would make it better to use just scan the CIX instead (only 9 reads).&lt;/p&gt; &lt;p&gt;Naturally, if we change our index to include the LoginID, the query then takes 2 reads, whether the manager has 2 or 4 direct reports. It could take more if those records are stored over multiple pages. &lt;/p&gt; &lt;p&gt;Understanding this simple bit of maths can really impact your indexing strategy, and your appreciation of the way that T-SQL works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650597" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>OUTPUT clause - knowing what goes in, and what you've accidentally taken out</title><link>http://msmvps.com/blogs/robfarley/archive/2008/10/04/output-clause-knowing-what-goes-in-and-what-you-ve-accidentally-taken-out.aspx</link><pubDate>Sat, 04 Oct 2008 00:08:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1649653</guid><dc:creator>Rob Farley</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1649653</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/10/04/output-clause-knowing-what-goes-in-and-what-you-ve-accidentally-taken-out.aspx#comments</comments><description>&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/ms177564.aspx" target="_blank"&gt;OUTPUT clause&lt;/a&gt; has to be one of the best T-SQL features out there. It was new in SQL Server 2005, but it&amp;#39;s still remarkably little known. I guess like many of the features that were introduced in SQL 2005, many people just make do with the way they did things before.&lt;/p&gt; &lt;p&gt;The basic point of the OUTPUT clause is to turn a data modification statement into one that returns data (although this data can be redirected to an existing table by simply adding &amp;quot;INTO tablename&amp;quot; after it), by providing a way of accessing the &lt;em&gt;inserted&lt;/em&gt; and &lt;em&gt;deleted&lt;/em&gt; tables that we have been using in triggers for years. If a DELETE statement is being issued, only the &lt;em&gt;deleted&lt;/em&gt; table is available, and similarly &lt;em&gt;inserted&lt;/em&gt; for an INSERT statement. UPDATE provides both - and the MERGE statement (new in SQL Server 2008) populates both (although it feels as if a FULL JOIN has been applied to them).&lt;/p&gt; &lt;p&gt;I&amp;#39;m sure it&amp;#39;s easy to imagine the tremendous advantage to using it with UPDATE statements - auditing. It&amp;#39;s very easy to push the changes to an audit table, without the need to create a trigger to do it for us. But I find that the biggest advantage is for those times when carelessness has got the better of us. Hopefully these times are rare (and the more experienced we get with databases the more we seem to respect the sanctity of the data), but if you always use &amp;quot;OUTPUT deleted.*&amp;quot; when deleting, or &amp;quot;OUTPUT deleted.*, inserted.*&amp;quot;, then the odd time when you see more rows come back that you expected, you can have a plan associated with your &amp;quot;Oops&amp;quot; moment.&lt;/p&gt; &lt;p&gt;If you don&amp;#39;t use the OUTPUT clause, you get a message that tells you how many rows were affected by your query. If you expect that number to be small, and it&amp;#39;s actually quite large, you&amp;#39;ve probably done something wrong. &amp;quot;Oops&amp;quot; is probably an understatement. You may have started a transaction and be able to roll it back, but until such time as you get to that, you have locks which aren&amp;#39;t being released. Regardless of whether or not you can roll it back, having something which shows you what you&amp;#39;ve just done can really help you out. You can copy the data presented into Excel, or Notepad, or whatever, and work out your problem. If you can&amp;#39;t roll it back, then this may involve some sort of import process being quickly thrown together.&lt;/p&gt; &lt;p&gt;The benefit is far less obvious when inserting data - but in some ways, it&amp;#39;s actually even more useful.&lt;/p&gt; &lt;p&gt;We&amp;#39;ve had the @@IDENTITY and SCOPE_IDENTITY() functions available for some time, and they&amp;#39;re widely used. But if multiple records are inserted, or if the targetted table doesn&amp;#39;t contain an identity field, then they&amp;#39;re actually not quite so great. Knowing which record is which is a question of re-querying the data and hoping you can tell. But if you &amp;quot;OUTPUT inserted.*&amp;quot;, your application can immediately tell which row was inserted with which surrogate key (it&amp;#39;s less of an issue if you use a natural primary key of course). With a large number of systems opting to use guids for PKs, defaulting to a value of newid(), it really helps to have an OUTPUT clause so that the guid doesn&amp;#39;t have to be generating prior to performing the insert.&lt;/p&gt; &lt;p&gt;The biggest caveat with the OUTPUT clause is that it can be ruined by triggers. A trigger being called can prevent the inserted and deleted tables from being available at the end of the statement. I&amp;#39;d like to have a way of stating that the OUTPUT clause should still work, returning the state of the inserted and deleted tables prior to any triggers being called, but I suppose I can understand the logic behind the decision to disallow it.&lt;/p&gt; &lt;p&gt;This was one of the tips in my TechEd Australia presentation, which was re-delivered to &lt;a href="http://www.sqlserver.org.au/events" target="_blank"&gt;user groups in Adelaide and Melbourne&lt;/a&gt;. The &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx" target="_blank"&gt;scripts&lt;/a&gt; and &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx" target="_blank"&gt;slides&lt;/a&gt; are available for download. This was one of the more popular tips, based on feedback.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1649653" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/adssug/default.aspx">adssug</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Improving Your T-SQL Arsenal - slides</title><link>http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx</link><pubDate>Thu, 18 Sep 2008 03:46:16 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648150</guid><dc:creator>Rob Farley</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1648150</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/09/18/improving-your-t-sql-arsenal-slides.aspx#comments</comments><description>&lt;p&gt;I&amp;#39;ve given this presentation a couple of times at &lt;a href="http://www.sqlserver.org.au/events/" target="_blank"&gt;user-groups&lt;/a&gt; now - last week in Adelaide, and this week in Melbourne. I posted the &lt;a href="https://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx" target="_blank"&gt;scripts&lt;/a&gt; to my blog recently, making them available to people who heard this talk at TechEd Australia at the start of the month, so now I&amp;#39;ve got around to uploading the &lt;a href="https://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley/TSQLArsenal.zip" target="_blank"&gt;slide deck&lt;/a&gt; as well.&lt;/p&gt; &lt;p&gt;I actually plan to blog about many of the tips too, so watch for that over the next month or so. I&amp;#39;ll try to do at least one a week for a while, if not more. Obviously some will become longer articles, while some will be quite short. Much of the material gets covered my &lt;a href="http://www.sqlskills.com.au/course.aspx?coursecode=TSQLADV" target="_blank"&gt;Advanced T-SQL Querying and Reporting&lt;/a&gt; course too - so feel free to check that out some time if you can.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648150" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/arsenal/default.aspx">arsenal</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/training/default.aspx">training</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>DAT283</title><link>http://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx</link><pubDate>Tue, 02 Sep 2008 20:49:07 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1646487</guid><dc:creator>Rob Farley</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1646487</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/09/03/dat283.aspx#comments</comments><description>&lt;p&gt;TechEd AU this week. I&amp;#39;m giving a talk on &amp;quot;T-SQL Tips n Techniques: Improving Your T-SQL Arsenal&amp;quot; on Friday morning. The slides are available from CommNet for people registered, but the scripts are &lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley/DAT283_5F00_scripts.zip"&gt;here&lt;/a&gt; as well. Come along to the talk to see how I use the scripts, but do grab these if you want to be trying them out on your data while I present. They all work on SQL Server 2005, and they use the &lt;a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004" target="_blank"&gt;AdventureWorks&lt;/a&gt; database.&lt;/p&gt; &lt;p&gt;I&amp;#39;ll also try to do a series of blog posts about some of the tips, but as well as that, many of them are part of the &lt;a href="http://www.sqlskills.com.au/course.aspx?coursecode=TSQLADV" target="_blank"&gt;Advanced T-SQL course&lt;/a&gt; that I put together earlier in the year.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1646487" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>UNICEF Australia project at TechEd</title><link>http://msmvps.com/blogs/robfarley/archive/2008/08/07/unicef-australia-project-at-teched.aspx</link><pubDate>Thu, 07 Aug 2008 12:13:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1643700</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1643700</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/08/07/unicef-australia-project-at-teched.aspx#comments</comments><description>&lt;p&gt;It was unfortunate news when I heard that the &lt;a href="http://www.unicef.org.au/" target="_blank"&gt;UNICEF Australia site&lt;/a&gt; was hacked a little while ago. An old colleague of mine called me to let me know, and to ask if I knew anyone who could help them out. I used to work at a hosting company with this guy, and had seen quite a few websites get hacked one way or another (the typical methods being &lt;a href="http://xkcd.com/327" target="_blank"&gt;SQL Injection&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/HTTP_cookie#Cookie_poisoning" target="_blank"&gt;Cookie Poisoning&lt;/a&gt;). &lt;/p&gt; &lt;p&gt;UNICEF is one of my favourite charities. They work to promote and protect the rights of children all over the world. As a kid I remember a book called &amp;quot;I Like This Poem&amp;quot; on my mother&amp;#39;s bookshelf - a UNICEF publication containing poems that were nominated by children (like Alfred Noyes&amp;#39; &amp;quot;When Daddy Fell Into The Pond&amp;quot;) that I can&amp;#39;t seem to find any reference of online. So I was more than happy to help them get back online. I got in touch with their hosting provider, who could not have done anything to prevent the attack but were very helpful in trying to help resolve the problem. I also contacted the MVP community and got some help from a few friends in fixing up code.&lt;/p&gt; &lt;p&gt;They got back online, and I hope are relatively secure, but I also had a chat to some &lt;a href="http://blogs.msdn.com/rog42/" target="_blank"&gt;people&lt;/a&gt; &lt;a href="http://blogs.msdn.com/dglover/" target="_blank"&gt;at&lt;/a&gt; Microsoft about what they could do, and they&amp;#39;ve come to the party!&lt;/p&gt; &lt;p&gt;A couple of years ago, there was a &lt;a href="http://notgartner.wordpress.com/2006/08/10/community-project-at-teched-2006-australia/" target="_blank"&gt;community project at TechEd Australia to help the Smith Family&lt;/a&gt; (in the DevGarten). This year, UNICEF are getting helped.&lt;/p&gt; &lt;p&gt;If you&amp;#39;re going to be at &lt;a href="http://www.microsoft.com/australia/teched" target="_blank"&gt;TechEd Australia&lt;/a&gt; this year, please try to find some time to get involved in the UNICEF project. The idea will be to make sure that they have a great new (secure) website, that will encourage people to visit, donate, find out what&amp;#39;s happening with this great charity. I&amp;#39;m sure everyone who donates some time will learn a lot from the experience, and also enjoy the chance to work for the children of the world.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1643700" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Thoughts on TechEd</title><link>http://msmvps.com/blogs/robfarley/archive/2007/08/17/thoughts-on-teched.aspx</link><pubDate>Fri, 17 Aug 2007 09:47:08 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1118705</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1118705</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2007/08/17/thoughts-on-teched.aspx#comments</comments><description>&lt;p&gt;I enjoy &lt;a href="http://www.microsoft.com/australia/teched07/index.aspx" target="_blank"&gt;TechEd&lt;/a&gt;. It&amp;#39;s always good fun. Last week was my fourth TechEd, having attended for the past three years, plus in &amp;#39;99. The last three years have seen my involvement increase each time. Last year I proctored with the Hands-On Labs, and this year I presented&amp;nbsp;both a session and an Instructor-Led Lab. I&amp;#39;m a big believer in giving back to the community, and I see this as part of it.&lt;/p&gt; &lt;p&gt;I do find that the more I&amp;#39;m involved, the fewer sessions I actually get to attend. But I don&amp;#39;t feel like I&amp;#39;m missing out, because it&amp;#39;s not why I go to TechEd. I go to meet people, to help people with questions, see old friends, and to be a part of the big event. In &amp;#39;99, I went because my employer sent me. I went to learn things, and I did. In the last few years though, my approach has been quite different, and I think I&amp;#39;ve got more from the event. This year, as a speaker, I was able to mix with a slightly different crowd, but also had an entirely different Ask The Experts experience to previous years.&lt;/p&gt; &lt;p&gt;There&amp;#39;s something about community - the more you give to it, the more you feel a part of it, and the more you want to give. If you&amp;#39;re reading this, you should get involved in your local &lt;a href="http://www.sqlserver.org.au/" target="_blank"&gt;user-groups&lt;/a&gt; (or even think about starting one, like the Hobart-based &lt;a href="http://www.datawise.com.au" target="_blank"&gt;Datawise guys&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1118705" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/adssug/default.aspx">adssug</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Bloggers' Lunch at TechEd AU</title><link>http://msmvps.com/blogs/robfarley/archive/2007/08/08/bloggers-lunch-at-teched-au.aspx</link><pubDate>Wed, 08 Aug 2007 06:08:43 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1094610</guid><dc:creator>Rob Farley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1094610</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2007/08/08/bloggers-lunch-at-teched-au.aspx#comments</comments><description>&lt;p&gt;TechEd is always a great event. Today I&amp;#39;ve helped with an Instructor-Led Lab on Report Builder, attended a few sessions, helped plenty of people with questions, and participated in the Bloggers&amp;#39; Lunch. &lt;/p&gt; &lt;p&gt;This was a panel that Frank Arrigo hosted, involving five people from the blogging space. It was interesting, but I had to leave early.&lt;/p&gt; &lt;p&gt;I did get to ask a question about what they saw as the difference between &amp;#39;proper&amp;#39; journalism and blogging. The panelists generally agreed with my thoughts that the main difference was the responsibility that journalists have. Bloggers (including me) have no responsibility over what they write. They can write whatever they want, flaming people as much or as little as they like. On the other hand, journalists tend to represent their newspapers and their professional reputation, and therefore need to be more careful about what they say.&lt;/p&gt; &lt;p&gt;But then someone who blogs on behalf of their organisation would seem to be somewhere in between. And then I think the difference between bloggers and journalists is the skill. Journalists tend to study journalism, and make a career of it. So&amp;nbsp;I think you&amp;#39;re going to find that in general, journalists write better posts than non-journalists. But perhaps things are changing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1094610" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/web/default.aspx">web</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>Code Camps galore</title><link>http://msmvps.com/blogs/robfarley/archive/2007/07/21/code-camps-galore.aspx</link><pubDate>Sat, 21 Jul 2007 10:32:28 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1045509</guid><dc:creator>Rob Farley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1045509</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2007/07/21/code-camps-galore.aspx#comments</comments><description>&lt;p&gt;We all know that Adelaide hosted Code Camp SA recently - it was a great success, and &lt;a href="http://davidgardiner.blogspot.com/2007/07/codecampsa-2007-reflections.html" target="_blank"&gt;some people even wished I was there&lt;/a&gt;!&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.microsoft.com/australia/teched07/index.aspx" target="_blank"&gt;TechEd&lt;/a&gt; is coming up of course, but now there are two code camps scheduled for October, on the same weekend (13-14) and at the same venue! Yes, that place is&amp;nbsp;Wagga Wagga - one Wagga for each event.&lt;/p&gt; &lt;p&gt;Firstly, and most importantly I&amp;#39;m sure, is the second &lt;a href="http://www.sqldownunder.com/" target="_blank"&gt;SQL Down Under Code Camp&lt;/a&gt;. But the other one is the &lt;a href="http://www.securitycampoz.com/" target="_blank"&gt;Security Camp Oz&lt;/a&gt;. With me doing the SQL Security talk at TechEd this year, I&amp;#39;m sure I&amp;#39;ll have a good reason to attend both!&lt;/p&gt; &lt;p&gt;Also in October, but the weekend before, and in the UK, the SQL community is hosting &lt;a href="http://www.sqlbits.com/" target="_blank"&gt;SQLBits&lt;/a&gt;. These guys have three streams (Dev, DBA, BI), and promises to be a fantastic event. I only wish I could be there. I&amp;#39;m sure &lt;a href="http://sqlblogcasts.com/blogs/tonyrogerson" target="_blank"&gt;Tony&lt;/a&gt;, &lt;a href="http://sqlblogcasts.com/blogs/simons/" target="_blank"&gt;Simon&lt;/a&gt;, &lt;a href="http://blogs.conchango.com/jamiethomson/" target="_blank"&gt;Jamie&lt;/a&gt;, &lt;a href="http://sqlblogcasts.com/blogs/sqldbatips/" target="_blank"&gt;Jasper&lt;/a&gt; and &lt;a href="http://cwebbbi.spaces.live.com/" target="_blank"&gt;Chris&lt;/a&gt; will do a fantastic job.&lt;/p&gt; &lt;p&gt;Seems wherever you are, October will be a big month for training.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1045509" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/wagga/default.aspx">wagga</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/code+camp/default.aspx">code camp</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/security/default.aspx">security</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/training/default.aspx">training</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>TechEd slides uploaded</title><link>http://msmvps.com/blogs/robfarley/archive/2007/07/20/teched-slides-uploaded.aspx</link><pubDate>Fri, 20 Jul 2007 05:44:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1042344</guid><dc:creator>Rob Farley</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1042344</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2007/07/20/teched-slides-uploaded.aspx#comments</comments><description>&lt;p&gt;I should&amp;#39;ve posted that I was confirmed as a speaker at this year&amp;#39;s TechEd Australia. It&amp;#39;s in just over two weeks&amp;#39; time - August 7-10. Today I uploaded my slide deck, so that delegates may be able to download the slides before they come to the talk.&lt;/p&gt; &lt;p&gt;I&amp;#39;m doing the Microsoft SQL Server 2005 Security Best Practices talk - code DAT308. It&amp;#39;s on Thursday morning at 9:45. Much better than being on Friday morning, when everyone might be a little bleary-eyed after the party at Movie World.&lt;/p&gt; &lt;p&gt;I&amp;#39;m also going to be doing an Instructor-Led Lab, on Database Mirroring. I don&amp;#39;t have a timetable for that yet, but if you&amp;#39;re interested, then do come along.&lt;/p&gt; &lt;p&gt;Just bear in mind that TechEd Australia is completely sold out now, so if my presenting has persuaded you to come along, then I&amp;#39;m sorry - you&amp;#39;re a bit too late. ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1042344" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item><item><title>How to find TechEd Australia 2007 in a search tool</title><link>http://msmvps.com/blogs/robfarley/archive/2007/07/03/how-to-find-teched-australia-2007-in-a-search-tool.aspx</link><pubDate>Tue, 03 Jul 2007 08:23:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:998816</guid><dc:creator>Rob Farley</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=998816</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2007/07/03/how-to-find-teched-australia-2007-in-a-search-tool.aspx#comments</comments><description>&lt;p&gt;This is just hilarious, but kinda sad for Microsoft.&lt;/p&gt; &lt;p&gt;I was in a class, and asked who amongst the students were going to TechEd this year. I had a couple of strange looks, so I pulled up Internet Explorer and went to search for the event site. Knowing that searching tends to be the best way of finding sites like this, I went to &lt;a href="http://live.com" target="_blank"&gt;live.com&lt;/a&gt; and entered teched australia. No such luck. So then I tried the competitor search company, that term that is in the dictionary but I imagine Microsoft employees are discouraged from using to mean &amp;#39;internet search&amp;#39;. You know the one. If you don&amp;#39;t, then just look at the links below.&lt;/p&gt; &lt;p&gt;Try these two links. Today, one is vastly more useful for finding the site that I&amp;#39;m after. I imagine that this will change, and I think the fact that the Australian company Teched appears at the top of the live.com results is perhaps a nice reflection of the fact that MS clearly don&amp;#39;t use live.com to advertise their own sites. Just a shame that live.com&amp;#39;s first mention of the TechEd Conference on the microsoft.com site is actually to microsoft.com/australia/teched&lt;strong&gt;2006&lt;/strong&gt;, even though this seems to redirect to this year&amp;#39;s site.&lt;/p&gt;&lt;img style="margin:0px 2px 2px;" src="http://www.anatex.com/productcart/pc/catalog/FingerBrushes_small.jpg" align="right" alt="" /&gt;  &lt;p&gt;&lt;a title="http://search.live.com/results.aspx?q=teched+australia&amp;amp;mkt=en-au" href="http://search.live.com/results.aspx?q=teched+australia&amp;amp;mkt=en-au"&gt;http://search.live.com/results.aspx?q=teched+australia&amp;amp;mkt=en-au&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="http://www.google.com.au/search?q=teched+australia" href="http://www.google.com.au/search?q=teched+australia"&gt;http://www.google.com.au/search?q=teched+australia&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a title="http://www.microsoft.com/australia/teched07/index.aspx" href="http://www.microsoft.com/australia/teched07/index.aspx"&gt;http://www.microsoft.com/australia/teched07/index.aspx&lt;/a&gt;&amp;nbsp;is the site if you&amp;#39;re actually trying to find it - but also check out the discussion about the &lt;a href="http://blogs.msdn.com/frankarr/archive/2007/07/02/where-s-the-flair.aspx" target="_blank"&gt;flairs&lt;/a&gt; this&amp;nbsp; year. I think if people start to make pictures that use finger gestures, it could quickly get &amp;quot;out of hand&amp;quot;, but&amp;nbsp;let&amp;#39;s see what happens. I&amp;#39;d love to see Microsoft give out &lt;a href="http://www.anatex.com/productcart/pc/viewPrd.asp?idcategory=26&amp;amp;idproduct=18" target="_blank"&gt;Finger Brushes&lt;/a&gt; to delegates, just to see how much mess people can make of the Gold Coast. After all, Painting Has Never Been So Fun!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=998816" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/community/default.aspx">community</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/australia/default.aspx">australia</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/teched/default.aspx">teched</category></item></channel></rss>