<?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 - All Comments</title><link>http://msmvps.com/blogs/robfarley/default.aspx</link><description>&lt;a rel="author" href="https://profiles.google.com/104951979913927264290/"&gt;Rob Farley&lt;/a&gt; now blogs at &lt;a href="http://sqlblog.com/blogs/rob_farley"&gt;http://sqlblog.com/blogs/rob_farley&lt;/a&gt; - Rob is the Owner/Principal with LobsterPot Solutions (a MS Gold Partner consulting firm), Microsoft MVP (SQL Server) and leader of the SQL User Group in Adelaide, Australia</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>Behind the scenes of PowerShell and SQL</title><link>http://msmvps.com/blogs/robfarley/archive/2007/01/05/powershell-and-sql.aspx#1823678</link><pubDate>Tue, 12 Feb 2013 00:11:53 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1823678</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;Every year, PowerShell increases its stranglehold on the Windows Server system and the applications that&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1823678" width="1" height="1"&gt;</description></item><item><title>Incorrect Results with Indexed Views</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/09/join-simplification-in-sql-server.aspx#1823512</link><pubDate>Tue, 05 Feb 2013 22:18:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1823512</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;Microsoft have released a fix for incorrect results returned when querying an indexed view: The problem&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1823512" width="1" height="1"&gt;</description></item><item><title>Joins in single-table queries</title><link>http://msmvps.com/blogs/robfarley/archive/2008/10/12/doing-the-maths-to-understand-sql-optimiser-choices.aspx#1820695</link><pubDate>Tue, 11 Dec 2012 00:05:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1820695</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;Tables are only metadata. They don’t store data. I’ve written something about this before, but I want&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1820695" width="1" height="1"&gt;</description></item><item><title>A T-SQL Tip: Working calculations</title><link>http://msmvps.com/blogs/robfarley/archive/2009/03/25/converting-to-and-from-julian-format-in-t-sql.aspx#1803553</link><pubDate>Tue, 13 Dec 2011 00:46:17 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1803553</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;T-SQL Tuesday again and this month is on T-SQL Tips (thanks Allen !). In some ways it’s a tough topic,&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1803553" width="1" height="1"&gt;</description></item><item><title>When is a SQL function not a function?</title><link>http://msmvps.com/blogs/robfarley/archive/2009/12/05/dangers-of-begin-and-end.aspx#1802181</link><pubDate>Tue, 08 Nov 2011 00:01:23 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1802181</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;Should SQL Server even have functions? (Oh yeah – this is a T-SQL Tuesday post , hosted this month by&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1802181" width="1" height="1"&gt;</description></item><item><title>Enforcing Uniqueness for Performance</title><link>http://msmvps.com/blogs/robfarley/archive/2008/11/09/unique-indexes-with-group-by.aspx#1796873</link><pubDate>Thu, 28 Jul 2011 15:38:57 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1796873</guid><dc:creator>Paul White: Page Free Space</dc:creator><description>&lt;p&gt;Just a quick blog entry today, leading up to the next one (which is going to be *awesome*).&amp;#160; A little&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1796873" width="1" height="1"&gt;</description></item><item><title>Using SQL Execution Plans to discover the Swedish alphabet</title><link>http://msmvps.com/blogs/robfarley/archive/2010/01/22/sargable-functions-in-sql-server.aspx#1785565</link><pubDate>Mon, 03 Jan 2011 05:54:54 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1785565</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;SQL Server is quite remarkable in a bunch of ways. In this post, I’m using the way that the Query Optimizer&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1785565" width="1" height="1"&gt;</description></item><item><title>A Year of Tuesdays: T-SQL Tuesday Meta-Roundup</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/02/invitation-for-t-sql-tuesday-003-relationships.aspx#1783702</link><pubDate>Tue, 07 Dec 2010 18:43:28 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1783702</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Just over a year ago I kicked off T-SQL Tuesday , &amp;quot;a recurring, revolving blog party.&amp;quot; The idea was simple:&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1783702" width="1" height="1"&gt;</description></item><item><title>PASS Summit North America 2010</title><link>http://msmvps.com/blogs/robfarley/archive/2008/04/16/excitement-building-at-summit.aspx#1782252</link><pubDate>Sat, 13 Nov 2010 21:23:03 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1782252</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;My first PASS Summit didn’t let me down. LobsterPot Solutions sent two people to PASS this year – I was&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1782252" width="1" height="1"&gt;</description></item><item><title>Managing to get time away</title><link>http://msmvps.com/blogs/robfarley/archive/2006/12/19/the-only-way-to-do-a-handover.aspx#1775646</link><pubDate>Tue, 10 Aug 2010 03:32:51 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1775646</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;Conference season is coming up, and this means time away from work. Something not quite as trivial as&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1775646" width="1" height="1"&gt;</description></item><item><title>Christian’s book – not just Brent’s</title><link>http://msmvps.com/blogs/robfarley/archive/2007/10/25/a-tribute.aspx#1772823</link><pubDate>Tue, 29 Jun 2010 04:55:12 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1772823</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;I like to joke with Christian Bolton ( @christianbolton ) about the time when he got accused of claiming&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1772823" width="1" height="1"&gt;</description></item><item><title>T-SQL Tuesday #002: The Roundup</title><link>http://msmvps.com/blogs/robfarley/archive/2010/01/12/t-sql-tuesday-having-puzzle-answer.aspx#1762497</link><pubDate>Sun, 28 Mar 2010 19:58:20 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1762497</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;According to T-SQL Tuesday rules as ratified by me in the first and second T-SQL Tuesday posts, the T-SQL&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1762497" width="1" height="1"&gt;</description></item><item><title>A CASE study in SARGability</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/02/a-case-study-in-sargability.aspx#1758588</link><pubDate>Sat, 20 Feb 2010 07:54:58 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1758588</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;(Reposted from my msmvps.com blog ) A recent discussion on Twitter about a query that Denny Cherry was&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1758588" width="1" height="1"&gt;</description></item><item><title>SARGable functions in SQL Server</title><link>http://msmvps.com/blogs/robfarley/archive/2010/01/22/sargable-functions-in-sql-server.aspx#1758587</link><pubDate>Sat, 20 Feb 2010 07:51:13 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1758587</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;(Reposted from my msmvps.com blog ) SARGable is an adjective in SQL that means that an item can be found&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1758587" width="1" height="1"&gt;</description></item><item><title>re: The Query Optimizer’s handling of Relationships for T-SQL Tuesday #003</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/09/the-query-optimizer-s-handling-of-relationships-for-t-sql-tuesday-003.aspx#1757524</link><pubDate>Sun, 14 Feb 2010 22:51:39 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1757524</guid><dc:creator>Rob Farley</dc:creator><description>&lt;p&gt;@Joe - Thanks for that. I didn&amp;#39;t realise that, and it makes for some interesting thoughts. I do wish that SQL Server did it that way - perhaps at some point it might, or maybe that&amp;#39;s just a pipe dream.&lt;/p&gt;
&lt;p&gt;@RobLobbe - Sorry, we&amp;#39;ll have to disagree on that one. I&amp;#39;ve seen too many situations where the Query Optimizer has been able to run a query so much better because a Foreign Key is in place. I&amp;#39;ve also seen too many situations where a database without FKs has referential integrity issues, and I would always want my Test and Production systems to be identical. Thanks for commenting though - it&amp;#39;s always good to hear other perspectives.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1757524" width="1" height="1"&gt;</description></item><item><title>re: The Query Optimizer’s handling of Relationships for T-SQL Tuesday #003</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/09/the-query-optimizer-s-handling-of-relationships-for-t-sql-tuesday-003.aspx#1757520</link><pubDate>Sun, 14 Feb 2010 22:35:34 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1757520</guid><dc:creator>Rob Lobbe</dc:creator><description>&lt;p&gt;Foreign Keys are a DESIGN tool. And should be treated as such. As far as the Query Optimizer goes, it should NEVER be an issue in my production database. FK&amp;#39;s should be removed, as they only cause overhead to day-to-day processing.&lt;/p&gt;
&lt;p&gt;It the feature of an application is to &amp;#39;display an error for every FK breach&amp;#39; the vendor&amp;#39;s going to get an earful for a shoddy product. Likewise if the product is relying on a cascade delete, what else are they &amp;#39;guessing&amp;#39; at - especial if I want audit&amp;#39;s and history retention.&lt;/p&gt;
&lt;p&gt;In a development, or testing environment, sure put them in. They make sure the application doesn&amp;#39;t break the rules, but from an optimizer standpoint I&amp;#39;m not concerned with this overhead - the final product will be that much better, without them.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1757520" width="1" height="1"&gt;</description></item><item><title>re: The Query Optimizer’s handling of Relationships for T-SQL Tuesday #003</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/09/the-query-optimizer-s-handling-of-relationships-for-t-sql-tuesday-003.aspx#1757480</link><pubDate>Sun, 14 Feb 2010 19:06:30 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1757480</guid><dc:creator>Joe Celko</dc:creator><description>&lt;p&gt;FYI&lt;/p&gt;
&lt;p&gt;Sybase and other SQLs implement the PK-FK relationships as pointer chains that connect the FK to the single PK value in the entire schema. They think of the schema as a whole. You can see the advantages of this for CASCADE, JOIN and other operations. &lt;/p&gt;
&lt;p&gt;SQL Server and other lesser SQLs implement each table separately as if they were files, so the PK value is repeated over and over in the FK columns. To get good join performance, you usually index FKs in such products.&lt;/p&gt;
&lt;p&gt;SQLs that use hashing actually want longer keys because they hash with fewer collisions.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1757480" width="1" height="1"&gt;</description></item><item><title>re: The Query Optimizer’s handling of Relationships for T-SQL Tuesday #003</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/09/the-query-optimizer-s-handling-of-relationships-for-t-sql-tuesday-003.aspx#1756373</link><pubDate>Wed, 10 Feb 2010 13:34:15 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1756373</guid><dc:creator>Jeremiah Peschka</dc:creator><description>&lt;p&gt;I&amp;#39;m guessing you&amp;#39;re referring to the difference between using a surrogate key and a superkey. I make that guess because if your PK is on a natural candidate key, it wouldn&amp;#39;t be a question.&lt;/p&gt;
&lt;p&gt;As long as the unique index has all included columns for queries (effectively making it a second clustered index), I would say that it&amp;#39;s probably a better candidate for the FK than the artificial PK.&lt;/p&gt;
&lt;p&gt;While we&amp;#39;re frequently told we should use surrogate PKs, isn&amp;#39;t it more important to balance logic and reason (referencing the natural candidate key) with convenience (referencing the surrogate key). A pure relational theorist, of course, would say to use the natural key. I&amp;#39;ve used with both and haven&amp;#39;t seen appreciable differences in application performance. These days the choice comes down to what my predecessor has done.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1756373" width="1" height="1"&gt;</description></item><item><title>Almost T-SQL Tuesday #003: </title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/02/invitation-for-t-sql-tuesday-003-relationships.aspx#1756318</link><pubDate>Wed, 10 Feb 2010 05:47:27 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1756318</guid><dc:creator>Michael Coles: Sergeant SQL</dc:creator><description>&lt;p&gt;Looks like I just missed the deadline for T-SQL Tuesday #003 [oh well, whatcha gonna do]. The other day&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1756318" width="1" height="1"&gt;</description></item><item><title>T-SQL Tuesday #3: Database Relationships</title><link>http://msmvps.com/blogs/robfarley/archive/2010/02/02/invitation-for-t-sql-tuesday-003-relationships.aspx#1756289</link><pubDate>Wed, 10 Feb 2010 02:32:59 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1756289</guid><dc:creator>Allen White</dc:creator><description>&lt;p&gt;In my first T-SQL Tuesday submission I thought I&amp;#39;d mention something that we often take for granted when&lt;/p&gt;
&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1756289" width="1" height="1"&gt;</description></item></channel></rss>