<?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 : sql server 2008</title><link>http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx</link><description>Tags: sql server 2008</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>High ROI items for SQL Server 2008</title><link>http://msmvps.com/blogs/robfarley/archive/2009/12/18/high-roi-items-for-sql-server-2008.aspx</link><pubDate>Thu, 17 Dec 2009 23:02:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1745828</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=1745828</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/12/18/high-roi-items-for-sql-server-2008.aspx#comments</comments><description>&lt;p&gt;To persuade your boss to embrace an upgrade to SQL 2008, you need to know which features have high Return On Investment. They may have seen presentations talking about features like Spatial, or MERGE (and been quite impressed), but they may well have left those presentations thinking about the effort that’s would be involved in rewriting applications to take advantage of these features. It’s all well and good to see your customers on a map, but someone has to make that spatial data appear somewhere.&lt;/p&gt;  &lt;p&gt;This post is a callout for features that will benefit you (and your boss) as soon as you do the upgrade (or soon after). And I welcome comments to list other items as well.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Block Computation &lt;/strong&gt;(in SSAS – which reduces the effort in processing significantly, for no change in the application )&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Transparent Data Encryption &lt;/strong&gt;(in the Database Engine – which makes sure that data at rest is encrypted, with no change in the application)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Backup Compression &lt;/strong&gt;(which reduces the size of backups, and can be set as the default so that existing backup scripts don’t need to change)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Data Compression &lt;/strong&gt;(minimal change to turn on compression on tables which will compress nicely)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Filtered Indexes &lt;/strong&gt;(because how far off is your next index creation, really?)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Auditing &lt;/strong&gt;&amp;amp; &lt;strong&gt;Change Data Tracking &lt;/strong&gt;(because it’s very easy to turn on and then review the data as you need it)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Export to Word in SSRS &lt;/strong&gt;(because everyone’s wanted this for so long)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;SSRS paging &lt;/strong&gt;(because SSRS used to get _all_ the data for a report before rendering it – but not in 2008)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Resource Governor&lt;/strong&gt; (easy to set up, nice to have in place for when you might want it)&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Hot-add memory&lt;/strong&gt; (so that you can just plug in more memory without having to do restarts)&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’m not suggesting that an upgrade should be done flippantly. You should still consider the effort of thoroughly testing your system under SQL 2008. But hopefully this list can highlight some of the things that I’ve found are good persuaders. A list of “What’s New in SQL 2008” can be found at &lt;a title="http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx" href="http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx"&gt;http://www.microsoft.com/sqlserver/2008/en/us/whats-new.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Like I said, you may have other items on your own list, and I invite you to comment on this. You may also have things in place to handle things like encryption, and you may be running Hyperbac or one of the other compression tools.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1745828" 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/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+improvements/default.aspx">sql improvements</category></item><item><title>StreamInsight talk coming up at SQLBits</title><link>http://msmvps.com/blogs/robfarley/archive/2009/11/20/streaminsight-talk-coming-up-at-sqlbits.aspx</link><pubDate>Fri, 20 Nov 2009 11:47:24 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1740965</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=1740965</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/11/20/streaminsight-talk-coming-up-at-sqlbits.aspx#comments</comments><description>&lt;p&gt;My talk on &lt;a href="http://msdn.microsoft.com/en-us/library/dd631799%28SQL.10%29.aspx" target="_blank"&gt;StreamInsight&lt;/a&gt; is up next. I’ll try to blog more about that later. For now, I want to mention more about &lt;a href="http://www.sqlbits.com" target="_blank"&gt;SQLBits&lt;/a&gt; itself. This is by far the largest SQL-only conference I’ve attended (I haven’t been to SQL-PASS yet), and it’s great to be involved.&lt;/p&gt;  &lt;p&gt;Yesterday I had an all-day seminar about the new items for Developers in SQL 2008. It was a good time – the delegates responded very positively, and many of them have caught up with me since.&lt;/p&gt;  &lt;p&gt;But for me, the conference is being a great way of catching up with (and meeting for the first time) a bunch of SQL people that I rarely see. I’ve met people that lived only a few miles from where I grew up, and people that read my blog (Hi!), discovered people who have connections to Adelaide, and even found that my Adelaide friend Martin Cairney (who is also here) has a strange connection to Donald Farmer (of Microsoft), that their parents shared a back fence or something… Now Trevor Dwyer tells me a colleague of his knows me from somewhere… the world is very small here.&lt;/p&gt;  &lt;p&gt;My StreamInsight talk will be interesting I hope. I have some stuff to show off, and I plan to involve the audience a little as well. If you’re at SQLBits and feel like being involved in an interactive session, then definitely come along. I want to hear from people in the audience who have dabbled with StreamInsight and also other vendors’ Complex Event Processing offerings. This is a brand new technology from Microsoft, and there will be a large range of adoption levels in the room.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1740965" 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/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+bits/default.aspx">sql bits</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/streaminsight/default.aspx">streaminsight</category></item><item><title>A review – SQL Server 2008 Internals</title><link>http://msmvps.com/blogs/robfarley/archive/2009/06/13/a-review-sql-server-2008-internals.aspx</link><pubDate>Sat, 13 Jun 2009 04:37:45 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1695166</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=1695166</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/06/13/a-review-sql-server-2008-internals.aspx#comments</comments><description>&lt;p&gt;I’m reading SQL Server 2008 Internals at the moment. I say ‘reading’, because I think it’s going to be long-term thing. It’s just so full of useful information, that I’m sure I’ll be reading it over and over for a long time yet.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://sqlblog.com/blogs/kalen_delaney/" target="_blank"&gt;Kalen Delaney&lt;/a&gt;’s books are always great, but in this one she has help from &lt;a href="http://www.sqlskills.com/" target="_blank"&gt;Paul Randal &amp;amp; Kimberly Tripp&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/conor_cunningham_msft" target="_blank"&gt;Conor Cunningham&lt;/a&gt; and &lt;a href="http://sqlblog.com/blogs/adam_machanic/" target="_blank"&gt;Adam Machanic&lt;/a&gt; – all SQL Server legends in their own right. The book they have made is just excellent, and should be read by everyone who wants to get deeper into SQL Server. There are some sections I’ve only skimmed over so far, whilst others I’ve read thoroughly. In time I think I will have read every page multiple times, but this is definitely a resource that can be read that way (yes, Kimberly, it has a good index).&lt;/p&gt;  &lt;p&gt;It covers so much useful stuff it’s hard to think of a better resource for SQL Server 2008. It doesn’t go into design very much, but it will affect your design decisions. It doesn’t go into writing queries, but it will affect the queries you write. I really think this book would be an asset to anyone who wants to know more about SQL Server.&lt;/p&gt;  &lt;p&gt;[Updated: &lt;a href="http://www.mspress.com.au/searchresults.aspx?s=a2V5d29yZA==-I7x1ozBkcPY=&amp;amp;k=c3FsIHNlcnZlciAyMDA4IGludGVybmFscw==-lfBFhWZqdoU=" target="_blank"&gt;This link&lt;/a&gt; should take you to where you can find and buy the book. MSPress have 50% off their books until June 30, 2009, which makes this book an even better investment]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1695166" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/book+review/default.aspx">book review</category></item><item><title>Seriously cheap exams in Australia</title><link>http://msmvps.com/blogs/robfarley/archive/2009/05/06/seriously-cheap-exams-in-australia.aspx</link><pubDate>Wed, 06 May 2009 02:56:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1691922</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=1691922</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/05/06/seriously-cheap-exams-in-australia.aspx#comments</comments><description>&lt;p&gt;If you’re an MCP in Australia and you haven’t passed any exams over the past couple of years (since July 1, 2007), then Microsoft has an offer at the moment to let you do an exam for only US$25 (until June 30, 2009). Ok, so that means the price really depends on the value of the Aussie dollar, but either way, it’s not a bad opportunity.&lt;/p&gt;  &lt;p&gt;The offer is only on for a very short time, but why not check out &lt;a title="http://www.learnandcertify.com/mcpupgrade/" href="http://www.learnandcertify.com/mcpupgrade/"&gt;http://www.learnandcertify.com/mcpupgrade/&lt;/a&gt; and see what you can do? I’m thinking it’s a nice opportunity to knock over one of those Upgrade exams to get yourself from MCITP:SQL2005 to MCITP:SQL2008. You don’t get a second shot with this one, and you can only get one voucher – but it’s so cheap you may as well try it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1691922" 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/certification/default.aspx">certification</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql/default.aspx">sql</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/professional+development/default.aspx">professional development</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>SQL Server 2008 SP1 download</title><link>http://msmvps.com/blogs/robfarley/archive/2009/04/08/sql-server-2008-sp1-download.aspx</link><pubDate>Wed, 08 Apr 2009 01:01:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1685733</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=1685733</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2009/04/08/sql-server-2008-sp1-download.aspx#comments</comments><description>&lt;p&gt;You can get it from &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19"&gt;http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=66ab3dbb-bf3e-4f46-9559-ccc6a4f9dc19&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;For all those people who have been waiting for SP1 before considering a migration to SQL Server 2008, it has now been released.&lt;/p&gt;  &lt;p&gt;There’s also a new version of the Feature Pack for SQL Server 2008, available from: &lt;a title="http://www.microsoft.com/downloads/details.aspx?familyid=B33D2C78-1059-4CE2-B80D-2343C099BCB4&amp;amp;displaylang=en" href="http://www.microsoft.com/downloads/details.aspx?familyid=B33D2C78-1059-4CE2-B80D-2343C099BCB4&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=B33D2C78-1059-4CE2-B80D-2343C099BCB4&amp;amp;displaylang=en&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1685733" 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/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>The problem with America - spatial data</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/17/the-problem-with-america-spatial-data.aspx</link><pubDate>Sun, 16 Nov 2008 21:53:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1654287</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=1654287</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/11/17/the-problem-with-america-spatial-data.aspx#comments</comments><description>&lt;p&gt;Ok, it&amp;#39;s not really a problem with America, just a problem with the perception of straight lines like the USA-Canada border. It&amp;#39;s roughly the latitude line 49 degrees north. A line that goes East-West, on a straight line.&lt;/p&gt; &lt;p&gt;Except that latitude lines aren&amp;#39;t straight - except the equator. Just look on a globe and you&amp;#39;ll see what I mean.The curvature of the earth just gets in the way a bit. If you&amp;#39;re ten miles from the North Pole and travel east until you come back on yourself, you&amp;#39;ve just gone around in a circle that&amp;#39;s 20 miles across. The smaller the circle, the more obvious the effect. The bigger the circle (like when you&amp;#39;re near the equator), the less obvious the effect. But it&amp;#39;s still there.&lt;/p&gt; &lt;p&gt;Pilots understand the principle. When I flew from London to Seattle earlier this year, we went across the top of Greenland, because that&amp;#39;s the quickest way of getting there. Pick up a globe of the world, and you&amp;#39;ll see exactly why we should fly that way.&lt;/p&gt; &lt;p&gt;When someone wants to fly from one point on the 49th parallel to another, or to simply draw a line, the shortest route actually goes a little further north. The 49th parallel is like that 20-mile circle - it bends to match the curvature of the Earth.&lt;/p&gt; &lt;p&gt;So if you&amp;#39;re mapping the world using spatial data for SQL Server 2008, you may want to consider this when looking at the American border. It&amp;#39;s not a straight line along the 49th parallel, because the 49th parallel isn&amp;#39;t a straight line. &lt;/p&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="223" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.TheproblemwithAmericaspatialdata_5F00_14EE8/image_5F00_3.png" width="358" border="0" /&gt; &lt;/p&gt; &lt;p&gt;To demonstrate this, my friend Greg Larsen (who runs the &lt;a href="http://oassug.org/" target="_blank"&gt;Olympic Area SQL Server User Group&lt;/a&gt;) has sent me a query. You&amp;#39;ll notice that there are some locations north of the 49th parallel that are with the polygon which seems to be bound by the 49th parallel.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;USE AdventureWorks2008;&lt;br /&gt;GO&lt;br /&gt;DECLARE @region geography; &lt;br /&gt;SET @region = geography::STGeomFromText(&amp;#39;POLYGON((-67 49, -125 49, -125 24, -67 24, -67 49))&amp;#39;, 4326); &lt;/em&gt; &lt;p&gt;&lt;em&gt;SELECT&amp;nbsp; [AddressLine1] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[City] &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[SpatialLocation].Long AS Long&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,[SpatialLocation].Lat AS Lat&lt;br /&gt;FROM [AdventureWorks2008].[Person].[Address]&lt;br /&gt;WHERE [SpatialLocation].STIntersects(@region) = 1 &lt;br /&gt;and [SpatialLocation].Lat &amp;gt; 49;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This query actually gives us 632 rows. That&amp;#39;s 632 addresses in the sample database which are more than 49 degrees North, and yet are within a polygon which has corners at -67 49 and -125 49. Hopefully you can look at the picture of the US border and see where those 632 rows much be.&lt;/p&gt; &lt;p&gt;SQL Server spatial stuff is really clever. But perhaps we need a way of telling it to draw lines east-west, instead of as the crow flies.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1654287" 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/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/spatial/default.aspx">spatial</category></item><item><title>Missing Index in SQL Server 2008 - should try harder!</title><link>http://msmvps.com/blogs/robfarley/archive/2008/10/12/missing-index-in-sql-server-2008-should-try-harder.aspx</link><pubDate>Sun, 12 Oct 2008 03:38:48 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1650606</guid><dc:creator>Rob Farley</dc:creator><slash:comments>12</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1650606</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/10/12/missing-index-in-sql-server-2008-should-try-harder.aspx#comments</comments><description>&lt;p&gt;Ok, maybe I&amp;#39;m being a little harsh, but I just feel like it should be better.&lt;/p&gt; &lt;p&gt;Let me show you the niceness of the way that missing indexes are handled in SQL Server 2008. &lt;/p&gt; &lt;p&gt;Using AdventureWorks (not AdventureWorks2008) on a SQL Server 2008 install, if I show the Execution Plan from this simple query, I get a nice suggestion. My query...&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;select productid, orderqty &lt;br /&gt;from sales.salesorderdetail&lt;br /&gt;where carriertrackingnumber = &amp;#39;FB88-4B92-82&amp;#39;;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;...could be improved through better indexing. It uses 1240 reads to get this data, which seems awful. The system shows me that it could be improved, and suggests an index.  &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="389" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.MissingIndexinSQLServer2008shouldtryhard_5F00_CD94/image_5F00_6.png" width="644" border="0" /&gt;  &lt;p&gt;It&amp;#39;s there, in green. It says:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;CREATE NONCLUSTERED INDEX [&amp;lt;Name of Missing Index, sysname,&amp;gt;] ON [Sales].[SalesOrderDetail] ([CarrierTrackingNumber])&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;(that&amp;#39;s right, no semi-colon on the end, but I&amp;#39;m fine about that)&lt;/p&gt; &lt;p&gt;What I&amp;#39;m not fine with is the fact that this index isn&amp;#39;t actually so ideal. If I create it (supplying a name, of course), we see it&amp;#39;s being used, and it should be clear that a better index ought to be better.&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="389" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.MissingIndexinSQLServer2008shouldtryhard_5F00_CD94/image_5F00_5.png" width="644" border="0" /&gt; &lt;/p&gt; &lt;p&gt;This query uses 42 reads to get the required information, which is significantly better than 1740, but still not brilliant. In fact, 42 is about 2.4% of 1740, so it&amp;#39;s hardly the 99.6512% improvement that Management Studio suggested would be seen.&lt;/p&gt; &lt;p&gt;My preference would be to consider that Key Lookup as well. it&amp;#39;s taking 92% of this improved query. We can avoid the Key Lookup by creating an index which INCLUDEs the columns we&amp;#39;re interested in. Like this:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;CREATE NONCLUSTERED INDEX [MyNewIndex2] ON [Sales].[SalesOrderDetail] ([CarrierTrackingNumber]) INCLUDE (ProductID, OrderQty);&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;If I create this index, we see that the execution plan becomes just the Index Seek (on my new index), and the number of reads drops to just 3. Yes 3. That&amp;#39;s 0.17% of the original query, and only 7.1% of the reads of the improved query! 99.83% of the original reads have been eliminated - much more like the figures promised by my Missing Index suggestion, except it got it wrong.  &lt;p&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="389" alt="image" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.MissingIndexinSQLServer2008shouldtryhard_5F00_CD94/image_5F00_9.png" width="644" border="0" /&gt;  &lt;p&gt;I like the idea of detecting Missing Indexes, and I love the fact that it suggests these in Execution Plan viewer... I just want it to be slightly better by considering INCLUDEd columns.  &lt;p&gt;I&amp;#39;ve suggested this be improved on the Connect site at &lt;a title="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=375024" href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=375024" target="_blank"&gt;https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=375024&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1650606" 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/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+improvements/default.aspx">sql improvements</category></item><item><title>Accelerated SQL Server 2008 - Walters, Coles, Ferracchiati, Rae &amp; Farmer</title><link>http://msmvps.com/blogs/robfarley/archive/2008/09/21/accelerated-sql-server-2008-walters-coles-ferracchiati-rae-amp-farmer.aspx</link><pubDate>Sun, 21 Sep 2008 09:03:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1648447</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=1648447</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/09/21/accelerated-sql-server-2008-walters-coles-ferracchiati-rae-amp-farmer.aspx#comments</comments><description>&lt;p&gt;&lt;a href="http://apress.com/book/view/1590599691" target="_blank"&gt;Apress&lt;/a&gt; asked me to review this book, so here goes... I was a little disappointed, but on the whole thought it was pretty good. I also posted this review to Amazon, where I figure more people will read it.&lt;/p&gt; &lt;p&gt;&lt;em&gt;I saw this book come out, and had high expectations. The authors are all great guys who really know their stuff. What&amp;#39;s more, Donald Farmer is _the_ guy for Data Mining, so I was hoping for a big section about the improvements in that area for SQL 2008. &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;Looking through it though, it feels like a book that was written for SQL 2005 that just got updated a little for SQL 2008, and that wasn&amp;#39;t what I was wanting. And to boot, there are things that are just plain missing. There&amp;#39;s not a single page on Data Mining, and some of my favourite features just don&amp;#39;t appear. For Xmpl, in the FOR XML section, there&amp;#39;s no mention of FOR XML PATH at all - which has to be the best way of using FOR XML. &lt;/em&gt; &lt;p&gt;&lt;em&gt;However, I will still recommend this book. I will recommend this book to people who are moving from SQL 2000 and want to know what&amp;#39;s new in both SQL 2005 and 2008, but there is a better reason again:&lt;/em&gt; &lt;p&gt;&lt;em&gt;It&amp;#39;s really honest! It&amp;#39;s written by Microsoft guys, and they give really frank opinions about things. There are times when they happily point out that one feature or another isn&amp;#39;t really as useful as it sounds. It&amp;#39;s the kind of thing that more books need.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1648447" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Another new SSMS 2008 goodie - moving files into a project</title><link>http://msmvps.com/blogs/robfarley/archive/2008/08/28/another-new-ssms-2008-goodie-moving-files-into-a-project.aspx</link><pubDate>Wed, 27 Aug 2008 21:24:41 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645848</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=1645848</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/08/28/another-new-ssms-2008-goodie-moving-files-into-a-project.aspx#comments</comments><description>&lt;p&gt;So many times I&amp;#39;m writing a query, and I think &amp;quot;I want to put this into that project...&amp;quot;, but because I didn&amp;#39;t add it when I first made the query it&amp;#39;s a pain (and I end up copying the text into a new query).&lt;/p&gt; &lt;p&gt;But in SSMS 2008, I&amp;#39;ve just noticed the File menu has a &amp;quot;Move &amp;lt;file&amp;gt; into project&amp;quot; entry down near the bottom. So now I can just choose that and my query magically appears in the project. Terrific!&lt;/p&gt; &lt;p&gt;There seems to be so many nice little things in SSMS 2008 - try right-clicking on some data in the results grid, and you&amp;#39;ll see &amp;quot;Copy with Headers&amp;quot;. Really useful! I recommend grabbing SSMS 2008 and using it whenever you would&amp;#39;ve normally used SSMS 2005.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645848" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Map of the world in the Spatial Results tab (and converting from Geometry to Geography)</title><link>http://msmvps.com/blogs/robfarley/archive/2008/08/25/map-of-the-world-in-the-spatial-results-tab-and-converting-from-geometry-to-geography.aspx</link><pubDate>Mon, 25 Aug 2008 11:11:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1645711</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=1645711</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/08/25/map-of-the-world-in-the-spatial-results-tab-and-converting-from-geometry-to-geography.aspx#comments</comments><description>&lt;p&gt;One of the things on my list of stuff to check out in the RTM version of SQL Server Management Studio in 2008 is the Spatial Results tab that &lt;a href="http://blogs.msdn.com/isaac/archive/2008/06/02/eye-candy-of-the-highest-order.aspx" target="_blank"&gt;Isaac Kunen talked about a while back&lt;/a&gt;. He called it Eye Candy, and it really is.&lt;/p&gt; &lt;p&gt;I started by grabbing a set of data from Virtual Earth expert (and good friend) &lt;a href="http://www.soulsolutions.com.au/Blog.aspx" target="_blank"&gt;John O&amp;#39;Brien&lt;/a&gt;, containing geometry figures for the world. Geometry for things that are on the world isn&amp;#39;t exactly the best, but it was better than nothing. So then there was the matter of converting it to the Geography type. &lt;a href="http://msdn.microsoft.com/en-us/library/bb895270.aspx" target="_blank"&gt;Geometry&lt;/a&gt; is on a flat plane, &lt;a href="http://msdn.microsoft.com/en-us/library/bb895266.aspx" target="_blank"&gt;Geography&lt;/a&gt; is on the world - understanding the spherical nature of it.&lt;/p&gt; &lt;p&gt;But either way, it was still very nice to query. &lt;/p&gt; &lt;p&gt;Converting the data into the Geography type was the next challenge. I started by adding a column which was the right type, and tried the simple:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;update dbo.WorldBorders set geog = geography::STGeomFromText([geom].ToString(),4326)&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;It failed. Seems that there were problems with some of them. So I tweaked my script a little to try them all individually, setting the ones that couldn&amp;#39;t be done to POINT(0 0). For this, I used &lt;em&gt;GO n&lt;/em&gt; to run it a bunch of times (but I could&amp;#39;ve checked @@ROWCOUNT in a WHILE loop to be a little more precise). And I used the system of updating a derived table to make sure that I could update the first record each time.  &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;begin try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; update w&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set geog = geography::STGeomFromText([geom].ToString(),4326)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from (select top (1) * from WorldBorders where geog is null order by iso2) w&lt;br /&gt;end try&lt;br /&gt;begin catch&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; update w&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set geog = &amp;#39;Point(0 0)&amp;#39;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from (select top (1) * from WorldBorders where geog is null order by iso2) w&lt;br /&gt;end catch&lt;br /&gt;go 250&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;This converted the ones that were possible, and this script:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;select * from WorldBorders&lt;br /&gt;where geog.STAsText() = &amp;#39;POINT (0 0)&amp;#39;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.MapoftheworldintheSpatialResultstabandco_5F00_DEAB/world_5F00_2.jpg"&gt;&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="131" alt="world" src="http://msmvps.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/robfarley.MapoftheworldintheSpatialResultstabandco_5F00_DEAB/world_5F00_thumb.jpg" width="244" align="right" border="0" /&gt;&lt;/a&gt; ...showed me that the countries that didn&amp;#39;t convert were Canada, Fiji, Italy, Cote d&amp;#39;Ivoire, Antarctica, Russia, United Kingdom and Svalbard. And you can see that from the Spatial Results tab too. Fiji and Svalbard are clearly missing, right? I love the Spatial Results tab - when you have a query which involves Spatial data, it just appears, containing a graphical representation of the data. You can even change the projection if you&amp;#39;re not happy with the one that it shows by default.&lt;/p&gt; &lt;p&gt;As for why they&amp;#39;re missing? Well, I haven&amp;#39;t got around to looking yet. Probably, one of the shapes involved is listed in the wrong order (which is important for geography, but not for geometry). Also could be that Antartica, Russia and Canada are just too big. &lt;/p&gt; &lt;p&gt;When I tried to count how many polygons there were for each one, using:&lt;/p&gt; &lt;p&gt;select *, geom.STNumGeometries()&lt;br /&gt;from WorldBorders&lt;br /&gt;where geog.STAsText() = &amp;#39;POINT (0 0)&amp;#39;  &lt;p&gt;I found that some of the geometry fields weren&amp;#39;t valid. So I tried:&lt;/p&gt; &lt;p&gt;select *, geom.MakeValid().STNumGeometries()&lt;br /&gt;from WorldBorders&lt;br /&gt;where geog.STAsText() = &amp;#39;POINT (0 0)&amp;#39;  &lt;p&gt;...instead, which worked (telling me I have 954 polyons, including 478 from Canada alone). I may have wrecked some of my shapes using MakeValid(), but hopefully it will be okay. Svalbard converted okay by just putting MakeValid() back in the original conversion script.  &lt;p&gt;Enter my table of numbers so that I can easily handle each polygon separately, I dumped the polygons to a separate table:  &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;select&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; n.num, w.iso2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,w.geom.STAsText() as geomtext&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,w.geom.MakeValid().STNumGeometries() as numpolygons&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,w.geom.MakeValid().STGeometryN(n.num).STAsText() as polygon&lt;br /&gt;into dbo.worldpolygons&lt;br /&gt;from WorldBorders w&lt;br /&gt;&amp;nbsp;&amp;nbsp; join&lt;br /&gt;&amp;nbsp;&amp;nbsp; master.dbo.nums n&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; on n.num &amp;lt;= w.geom.MakeValid().STNumGeometries()&lt;br /&gt;where w.geog.STAsText() = &amp;#39;POINT (0 0)&amp;#39;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Converting these polygons to geography separately still gives a few errors, but I&amp;#39;m feeling a lot closer. More on this in another post, when I have the time to be able to look at it some more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1645711" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/spatial/default.aspx">spatial</category></item><item><title>COPY_ONLY backup option more obvious in SQL Server 2008</title><link>http://msmvps.com/blogs/robfarley/archive/2008/06/20/copy-only-backup-option-more-obvious-in-sql-server-2008.aspx</link><pubDate>Fri, 20 Jun 2008 07:32:10 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1635974</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=1635974</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/06/20/copy-only-backup-option-more-obvious-in-sql-server-2008.aspx#comments</comments><description>&lt;p&gt;I feel like I keep finding reasons to use SQL Server &lt;strong&gt;2008&lt;/strong&gt; Management Studio with SQL 2005 instances, and here&amp;#39;s another - the COPY_ONLY option now appears on the Backup dialog box (others include the DROP &amp;amp; CREATE scripting option, multi-server queries and the Select Top 1000 Rows menu entry).&lt;img style="border-top-width:0px;border-left-width:0px;border-bottom-width:0px;margin:5px;border-right-width:0px;" height="273" alt="copyonly" src="http://msmvps.com/blogs/robfarley/WindowsLiveWriter/COPY_ONLYbackupoptionmoreobviousinSQLSer_14DE2/copyonly_3.png" width="304" align="right" border="0" /&gt; &lt;/p&gt; &lt;p&gt;It&amp;#39;s not a new option (it just wasn&amp;#39;t part of the dialog box), but there&amp;#39;s an option when backing up a database called COPY_ONLY. It goes in the WITH section. It means that the backup you&amp;#39;re taking won&amp;#39;t be included in your ordinary backup/restore sequence. Let&amp;#39;s paint a scenario.&lt;/p&gt; &lt;p&gt;Your system takes a full database backup on a Sunday morning. Monday, Wednesday and Friday you do differential backups. Everything&amp;#39;s great, each of the differential backups only looks at changes since Sunday, when the last full backup was taken.&lt;/p&gt; &lt;p&gt;Except that one Thursday, one of the developers wants to refresh the test environment with a recent copy of the production system. Instead of finding Sunday&amp;#39;s backup and using that, they make a new backup, and restore that onto test. Everything works, and that new backup gets deleted. &lt;/p&gt; &lt;p&gt;Which means that Friday&amp;#39;s differential backup is based on the Thursday backup instead of Sunday. When a disaster occurs on Saturday, you&amp;#39;re in a bit of strife.&lt;/p&gt; &lt;p&gt;If the developer had used the COPY_ONLY option, then Friday&amp;#39;s differential would still&amp;#39;ve been based on Sunday&amp;#39;s backup. That&amp;#39;s the whole point of COPY_ONLY - it doesn&amp;#39;t reset all the flags that indicate which data should be included in the differential.&lt;/p&gt; &lt;p&gt;Like I said earlier, it&amp;#39;s not new - it&amp;#39;s was introduced in SQL 2005. I don&amp;#39;t know why it didn&amp;#39;t appear in the SQL 2005 dialog box - it didn&amp;#39;t even turn up in a service-pack. Since so many people learn about features through the user-interface, it really could&amp;#39;ve helped educate users about this useful option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1635974" 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/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>"No Match Output" in SSIS 2008</title><link>http://msmvps.com/blogs/robfarley/archive/2008/06/12/quot-no-match-output-quot-in-ssis-2008.aspx</link><pubDate>Thu, 12 Jun 2008 03:50:21 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1634269</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=1634269</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/06/12/quot-no-match-output-quot-in-ssis-2008.aspx#comments</comments><description>&lt;p&gt;The hairy Irishman (his description - I just call him Sacha) is presenting to the &lt;a href="http://www.sqlserver.org.au/Events/ViewEvent.aspx?EventId=338" target="_blank"&gt;Adelaide SQL Server User Group&lt;/a&gt; today, talking about improvements in SQL Server 2008 Integration Services. Right now he&amp;#39;s talking about the No Match output of the Lookup Component, and I&amp;#39;m wondering why I had always just accepted that in SQL 2005, rows that didn&amp;#39;t match a lookup would get pumped out to the error output.&lt;/p&gt; &lt;p&gt;For those of you who are saying &amp;quot;Sorry, what?&amp;quot;, let me explain...&lt;/p&gt; &lt;p&gt;If you have a data flow in Integration Services which is missing a particular piece of information, and you need to get that information from another source, you are likely to do a Lookup transformation, which can perform a query to find the values to be inserted into each row in the flow. Of course if the data is just in two tables, you&amp;#39;d just do a join in your original source query, but as soon as you&amp;#39;re talking about files, you don&amp;#39;t have that luxury in quite the same way. Sure you could populate a table and then read it back, but a Lookup may end up being much quicker. &lt;/p&gt; &lt;p&gt;Now, in SQL Server 2005, if a row couldn&amp;#39;t find the looked up value, it would be considered an error, along with truncation errors and errors in connection to the lookup source. I just accepted this as okay before, but the more I come across the No Match output (which can be used as well as the error output), the more I like it. So I can much more easily separate the rows that have caused errors from the rows that just couldn&amp;#39;t be found in the lookup source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1634269" 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/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/ssis/default.aspx">ssis</category></item><item><title>PowerShell changes in SQL Server 2008 RC0</title><link>http://msmvps.com/blogs/robfarley/archive/2008/06/12/powershell-changes-in-sql-server-2008-rc0.aspx</link><pubDate>Thu, 12 Jun 2008 02:48:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1634249</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=1634249</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/06/12/powershell-changes-in-sql-server-2008-rc0.aspx#comments</comments><description>&lt;p&gt;Regular readers of my blog will remember my post about &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/03/04/sql-server-2008-powershell-snapin.aspx" target="_blank"&gt;how to get PowerShell for SQL into your regular PowerShell window&lt;/a&gt;. Except that if you&amp;#39;ve just installed SQL Server 2008 RC0, you may have noticed it doesn&amp;#39;t work any more.&lt;/p&gt; &lt;p&gt;Never fear, they&amp;#39;ve just changed the name a bit. They&amp;#39;ve put 100 on the end of both. So just change your console file to list the two snapins as SqlServerProviderSnapin100 and SqlServerCmdletSnapin100. Calling PowerShell with the -PSConsoleFile option still works as before of course.&lt;/p&gt; &lt;p&gt;On a lighter note, they&amp;#39;ve fixed the case sensitivity. I can now &amp;quot;cd databases&amp;quot; just fine, without it needing me to use a capital D.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1634249" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/powershell/default.aspx">powershell</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Fuzzy in T-SQL</title><link>http://msmvps.com/blogs/robfarley/archive/2008/04/18/fuzzy-in-t-sql.aspx</link><pubDate>Thu, 17 Apr 2008 14:49:49 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1592356</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=1592356</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/04/18/fuzzy-in-t-sql.aspx#comments</comments><description>&lt;p&gt;SQL Server gives you &lt;a href="http://msdn2.microsoft.com/en-us/library/ms345128.aspx" target="_blank"&gt;Fuzzy Lookups and Fuzzy Grouping&lt;/a&gt;, but only in SQL Server Integration Services. It&amp;#39;s not even on the list of SSIS enhancements for SQL Server 2008.&lt;/p&gt; &lt;p&gt;This week at the MVP Summit, I was having a discussion about this with &lt;a href="http://blogs.conchango.com/jamiethomson/" target="_blank"&gt;Jamie Thomson&lt;/a&gt;, and we had a chat with one of the T-SQL guys to suggest it. The response came back with &amp;quot;Log in on connect&amp;quot;, which I did just now. &lt;a title="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=338664" href="https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=338664"&gt;https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=338664&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Please check it out and provide comments, votes, validations. All this will help persuade Microsoft to implement this useful feature. And tell your friends too! The more it receives, the more likely it will be implemented.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1592356" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+improvements/default.aspx">sql improvements</category></item><item><title>Local Server Group queries</title><link>http://msmvps.com/blogs/robfarley/archive/2008/03/04/local-server-group-queries.aspx</link><pubDate>Tue, 04 Mar 2008 01:54:19 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1532615</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=1532615</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/03/04/local-server-group-queries.aspx#comments</comments><description>&lt;p&gt;This is really quite cool, especially since it&amp;#39;s a tool feature, and one that will help SQL Server 2005 installs.&lt;/p&gt; &lt;p&gt;Suppose you have many servers, all registered in Management Studio, in the Registered Servers window. Now you can right-click on the Local Server Group, and pick the &amp;quot;New Query&amp;quot; option. Write a query, and it gives you a result set including the results from all the servers, as if you&amp;#39;d done a UNION ALL using linked servers.&lt;/p&gt; &lt;p&gt;So now if you want to do something like&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;select name, database_id from master.sys.databases;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;on a query against multiple servers, you get three columns. Server Name, plus the columns from the query.&lt;/p&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="454" alt="localservergroupqueries" src="http://msmvps.com/blogs/robfarley/WindowsLiveWriter/LocalServerGroupqueries_B578/localservergroupqueries_3.png" width="635" border="0" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1532615" 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/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>SQL Server 2008 PowerShell SnapIn</title><link>http://msmvps.com/blogs/robfarley/archive/2008/03/04/sql-server-2008-powershell-snapin.aspx</link><pubDate>Mon, 03 Mar 2008 23:17:32 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1532492</guid><dc:creator>Rob Farley</dc:creator><slash:comments>18</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1532492</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/03/04/sql-server-2008-powershell-snapin.aspx#comments</comments><description>&lt;p&gt;Installing &lt;a href="http://connect.microsoft.com/sql" target="_blank"&gt;SQL Server 2008&lt;/a&gt; gives you SQLPS.exe, an application you can run which is a &lt;a href="http://www.microsoft.com/powershell" target="_blank"&gt;PowerShell&lt;/a&gt; including the PSDrives for SQL Server (and compatible with SQL Server 2005 as well!).&lt;/p&gt; &lt;p&gt;But how do you make this work with your current copy of PowerShell? Well, I just worked this out. &lt;a href="http://geekswithblogs.net/darrengosbell/" target="_blank"&gt;Darren Gosbell&lt;/a&gt; was lamenting with me about the fact that it&amp;#39;s not a SnapIn for PowerShell, but it turns out it is. We ran: &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;Get-PSSnapin -reg&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;...and got the following results:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : SqlServerCmdletSnapin&lt;br /&gt;PSVersion&amp;nbsp;&amp;nbsp; : 1.0&lt;br /&gt;Description : This is a PowerShell snap-in that includes various SQL Server cmdlets.  &lt;p&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : SqlServerProviderSnapin&lt;br /&gt;PSVersion&amp;nbsp;&amp;nbsp; : 1.0&lt;br /&gt;Description : SQL Server Provider&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;So then I ran: &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;Add-PSSnapin SqlServerProviderSnapin&lt;br /&gt;Add-PSSnapin SqlServerCmdletSnapin&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And now I have the full SQLPS functionality in my usual PowerShell window. Lovely. And by putting this into a PowerShell console file, I can have it load up automagically for me. SqlServerProviderSnapin gives me the SQL: and SQLPolicy: drives, whereas SqlServerCmdletSnapin gives me Invoke-Sqlcmd for running queries. &lt;blockquote&gt; &lt;p&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;PSConsoleFile ConsoleSchemaVersion=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;PSVersion&amp;gt;1.0&amp;lt;/PSVersion&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;PSSnapIns&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PSSnapIn Name=&amp;quot;SqlServerProviderSnapin&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;PSSnapIn Name=&amp;quot;SqlServerCmdletSnapin&amp;quot; /&amp;gt; &lt;br /&gt;&amp;nbsp; &amp;lt;/PSSnapIns&amp;gt;&lt;br /&gt;&amp;lt;/PSConsoleFile&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;I&amp;#39;m still not convinced about the merits of using PowerShell to manage SQL Server, but as more Windows Admins adopt PowerShell as their preferred scripting language, I think it&amp;#39;s worth having it as an option.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1532492" 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/powershell/default.aspx">powershell</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Using ScriptingOptions with SQLPS</title><link>http://msmvps.com/blogs/robfarley/archive/2008/03/04/using-scriptingoptions-with-sqlps.aspx</link><pubDate>Mon, 03 Mar 2008 22:53:47 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1532472</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=1532472</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/03/04/using-scriptingoptions-with-sqlps.aspx#comments</comments><description>I&amp;#39;ve written before that &lt;a href="http://msmvps.com/blogs/robfarley/archive/2008/02/23/sql-server-2008-ctp6-gives-you-powershell.aspx" target="_blank"&gt;SQL Server 2008 (February CTP) gives you SQLPS&lt;/a&gt; - a &lt;a href="http://www.microsoft.com/powershell/" target="_blank"&gt;PowerShell&lt;/a&gt; interface to SQL Server.  &lt;p&gt;So I was trying to get the ScriptingOptions happening, and this is the only way I&amp;#39;ve found so far. It&amp;#39;s ugly, and if you have a better way of doing this, please post a comment for me.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;[reflection.assembly]::LoadWithPartialName(&amp;quot;Microsoft.SqlServer.Smo&amp;quot;)&lt;br /&gt;$so = New-Object Microsoft.SqlServer.Management.Smo.ScriptingOptions&lt;br /&gt;$so.DriAllConstraints = $true&lt;br /&gt;(get-item Sales.Store).Script($so)&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;And this gives me the Sales.Store table with all the default constraints thrown in. Much better. Ugly way of doing it, but at least it works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1532472" 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/powershell/default.aspx">powershell</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Melbourne Launch</title><link>http://msmvps.com/blogs/robfarley/archive/2008/03/04/melbourne-launch.aspx</link><pubDate>Mon, 03 Mar 2008 21:50:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1532431</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=1532431</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/03/04/melbourne-launch.aspx#comments</comments><description>&lt;p&gt;So I&amp;#39;m at the &lt;a href="http://www.microsoft.com/australia/heroes/" target="_blank"&gt;Heroes launch&lt;/a&gt; in Melbourne today. I&amp;#39;m going to hang out at the Experts booth, so if you&amp;#39;re here and have a question about SQL Server 2008, why not come over?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1532431" 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+server+2008/default.aspx">sql server 2008</category></item><item><title>SQL Server 2008 CTP6 gives you PowerShell</title><link>http://msmvps.com/blogs/robfarley/archive/2008/02/23/sql-server-2008-ctp6-gives-you-powershell.aspx</link><pubDate>Sat, 23 Feb 2008 06:00:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1522250</guid><dc:creator>Rob Farley</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/robfarley/rsscomments.aspx?PostID=1522250</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/02/23/sql-server-2008-ctp6-gives-you-powershell.aspx#comments</comments><description>&lt;p&gt;The sixth CTP of SQL Server 2008, made available this past week at &lt;a href="http://connect.microsoft.com/sql"&gt;http://connect.microsoft.com/sql&lt;/a&gt; provides a PowerShell provider for SQL Server, which is backwards compatible with SQL Server 2005 as well. I showed it a little at the User Group in Melbourne a few days ago, and &lt;a href="http://www.jimmcleod.net/blog/index.php/2008/02/19/melbourne-sql-server-user-group/" target="_blank"&gt;some people seemed to like it&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="257" alt="powershell_sql" src="http://msmvps.com/blogs/robfarley/WindowsLiveWriter/SQLServer2008CTP6givesyouPowerShell_E807/powershell_sql_3.png" width="260" align="right" border="0" /&gt; Basically, you can now open up PowerShell, and change directory to the PowerShell drive &amp;quot;SQL:&amp;quot;. Then change directories through the instances, databases, tables, and so on. At any point, try something like &amp;quot;dir | gm&amp;quot; (gm is Get-Member, dir is an alias for Get-ChildItem), to find out what properties and methods are available on the objects in that folder.&lt;/p&gt; &lt;p&gt;Whilst T-SQL will probably remain the preferred environment for many, this scripting seems to be a step up from using &lt;a href="http://msmvps.com/blogs/robfarley/archive/tags/powershell/default.aspx" target="_blank"&gt;SMO through PowerShell&lt;/a&gt;. However, it seems to be just a wrapper for SMO - when I tried to find out information about the Script() method on tables, it turns out to take a parameter of type &lt;em&gt;Microsoft.SqlServer.Management.Smo.ScriptingOptions&lt;/em&gt; - I found this a little disappointing, and I haven&amp;#39;t figured out the best way of getting help on methods that are on these objects either.&lt;/p&gt; &lt;p&gt;It&amp;#39;s definitely a good start though - should be a very nice feature of SQL Server 2008.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1522250" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/robfarley/archive/tags/powershell/default.aspx">powershell</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/sql+server+2008/default.aspx">sql server 2008</category></item><item><title>Querying distances using Spatial data types in SQL 2008</title><link>http://msmvps.com/blogs/robfarley/archive/2008/01/08/querying-distances-using-spatial-data-types-in-sql-2008.aspx</link><pubDate>Tue, 08 Jan 2008 12:34:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1447073</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=1447073</wfw:commentRss><comments>http://msmvps.com/blogs/robfarley/archive/2008/01/08/querying-distances-using-spatial-data-types-in-sql-2008.aspx#comments</comments><description>&lt;p&gt;SQL Server 2008 has spatial types which are very useful for all kinds of applications. I thought it would be nice to produce one of those charts like you get in maps, telling you the distance between cities.&lt;/p&gt; &lt;p&gt;So I start by populating the data. This uses the &lt;strong&gt;geography&lt;/strong&gt; data type, which understands about the spherical nature of the world. The data is populated using POINTS, using data which I found around the internet. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;create table dbo.Cities &lt;br /&gt;(id int identity(1,1) primary key,&lt;br /&gt;name char(3) not null,&lt;br /&gt;fullname varchar(100) not null,&lt;br /&gt;location geography); &lt;/em&gt;&lt;/p&gt; &lt;p&gt;&lt;em&gt;insert into dbo.cities values &lt;br /&gt;(&amp;#39;ADL&amp;#39;,&amp;#39;Adelaide&amp;#39;, &amp;#39;POINT(-34.92 138.58)&amp;#39;),&lt;br /&gt;(&amp;#39;MEL&amp;#39;,&amp;#39;Melbourne&amp;#39;, &amp;#39;POINT(-37.78 144.97)&amp;#39;),&lt;br /&gt;(&amp;#39;SYD&amp;#39;,&amp;#39;Sydney&amp;#39;, &amp;#39;POINT(-34 151)&amp;#39;),&lt;br /&gt;(&amp;#39;PER&amp;#39;,&amp;#39;Perth&amp;#39;, &amp;#39;POINT(-31.95 115.87)&amp;#39;),&lt;br /&gt;(&amp;#39;BRI&amp;#39;,&amp;#39;Brisbane&amp;#39;, &amp;#39;POINT(-27.48 153.13)&amp;#39;),&lt;br /&gt;(&amp;#39;CAN&amp;#39;,&amp;#39;Canberra&amp;#39;, &amp;#39;POINT(-35.3 149.12)&amp;#39;),&lt;br /&gt;(&amp;#39;HOB&amp;#39;,&amp;#39;Hobart&amp;#39;, &amp;#39;POINT(-42.87 147.32)&amp;#39;)&lt;br /&gt;;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Now that this is populated, a simple query will produce the results that can be put into a report. &lt;a href="http://msdn2.microsoft.com/en-us/library/bb933808(SQL.100).aspx" target="_blank"&gt;STDistance&lt;/a&gt; is a method which applies to one geography value, accepting another as a parameter. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;em&gt;select c1.name city1, c2.name city2, c1.location.STDistance(c2.location) / 1000 distance&lt;br /&gt;from dbo.Cities c1 &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; join dbo.Cities c2&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on c2.id &amp;lt;= c1.id&lt;br /&gt;;&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px;" height="215" alt="distances" src="http://msmvps.com/blogs/robfarley/WindowsLiveWriter/QueryingdistancesusingSpatialdatatypesin_14473/distances_3.png" width="641" align="right" border="0" /&gt;Now, I can make a simple matrix in SSRS, using &lt;em&gt;=IIF(Fields!city1.Value = Fields!city2.Value, Fields!city1.Value, Sum(Fields!distance.Value)) &lt;/em&gt;as the value in the centre of the matrix, with city1 and city2 on the rows and columns. This formula means that through the main diagonal of the matrix, the city names will be displayed. Hiding the header rows and columns, we quite quickly achieve something that looks like the image here. Of course, if you&amp;#39;re doing this for a proper application instead of just a proof-of-concept, you should take the time to format it more nicely. Colours, borders, that type of thing. But you get the idea.&lt;/p&gt; &lt;p&gt;I&amp;#39;m not sure how useful this is to your own applications - but it&amp;#39;s so easy to query this kind of spatial data, I encourage you to start considering it to be a useful part of your toolset.&lt;/p&gt; &lt;p&gt;This week, a tour of SQL Server User Groups in Australia starts, covering the spatial features in SQL Server 2008. The list of the meetings are at &lt;a href="http://www.sqlserver.org.au"&gt;http://www.sqlserver.org.au&lt;/a&gt;, and includes all seven groups.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1447073" 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/sql+server+2008/default.aspx">sql server 2008</category><category domain="http://msmvps.com/blogs/robfarley/archive/tags/spatial/default.aspx">spatial</category></item></channel></rss>