<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SQL</title>
        <link>http://www.mostlylucid.net/category/25.aspx</link>
        <description>SQL</description>
        <language>en-US</language>
        <copyright>Scott Galloway</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <item>
            <title>I Suck!</title>
            <link>http://mostlylucid.net/archive/2004/07/06/i-suck.aspx</link>
            <description>&lt;p&gt;Yeah, yeah, I'm sorry I've been negelecting you my lovely reader. There's just a whole lot to play with at the moment, just got a &lt;a href="http://products.sony.co.uk/productdetail.asp?id=11_61_6019"&gt;reasonably priced Video Camera&lt;/a&gt;, my &lt;a href="http://www.specialized.com/SBCBkModel.jsp?spid=5955"&gt;lovely bike&lt;/a&gt;, been playing with VS.NET 2005 Beta 1, getting a new deployment (and tracking down a deadlock) on &lt;a href="http://www.icslearn.co.uk/"&gt;this site&lt;/a&gt; and finally playing with &lt;a href="http://www.adobe.com/products/premiere/main.html"&gt;Adobe Premiere Pro&lt;/a&gt; - which is just awesome, if you've been stuck with &lt;a href="http://www.microsoft.com/windowsxp/using/moviemaker/default.mspx"&gt;Windows Movie Maker&lt;/a&gt;, try a real editing package!&lt;br /&gt;Whew...as well as that I've been looking into &lt;a href="http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=273960"&gt;SQL Hierarchies&lt;/a&gt; using something called &lt;a href="http://www.intelligententerprise.com/001020/celko.jhtml?_requestid=273960"&gt;'Nested Sets' by Joe Celko&lt;/a&gt; - this really is the best way I've seen of doing hierarchies (well, trees) in SQL. Also ordered his book on the subject &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/1558609202/mostlylucid-21"&gt;Joe Celko's Trees and Hierarchies in SQL for Smarties&lt;/a&gt; ...so, with all of that I have to get back to this site. I was very aware that I was just &lt;a href="http://crofsblogs.typepad.com/ckbetas/2003/07/metablogging.html"&gt;metablogging&lt;/a&gt; for a while there which I personally can't stand. So,l no promises but I'll try and get back to things as soon as I can!&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;UPDATE:&lt;/font&gt; Ooh, this is a pretty complex subject and really pretty interesting. There's a couple of other links I can recommend &lt;a href="http://troels.arvin.dk/db/rdbms/links/"&gt;this site&lt;/a&gt; has the most complete set of links to the best methods of modelling hiearchical data in T-SQL, this &lt;a href="http://www.yafla.com/papers/sqlhierarchies/sqlhierarchies.htm"&gt;site has a really nice method&lt;/a&gt; for supporting Nested Sets in a basically 'automatic' way. There's a whole lot to learn about this topic (much of which is mentioned in the &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/1558609202/mostlylucid-21"&gt;book I mentioned earlier&lt;/a&gt;) and articles &lt;a href="http://www.dbazine.com/tropashko4.shtml"&gt;like this&lt;/a&gt; on the &lt;a href="http://www.dbazine.com/tropashko4.shtml"&gt;'Nested Interval' model&lt;/a&gt; look really useful but will take a bit of work to figure out. Luckily the system I'm developing is fairly loosely coupled in it's Schema, allowing me to easily upgrade the hierarchical model I use if necessary...&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/892.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/07/06/i-suck.aspx</guid>
            <pubDate>Wed, 07 Jul 2004 03:41:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/07/06/i-suck.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/892.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Yukon presentation - it rules!</title>
            <link>http://mostlylucid.net/archive/2003/11/25/yukon-presentation---it-rules.aspx</link>
            <description>&lt;p&gt;Just been catching up on the &lt;a href="http://microsoft.sitestream.com/PDC2003/Default.htm"&gt;PDC presentations&lt;/a&gt;, came across &lt;a href="http://microsoft.sitestream.com/PDC2003/DAT/DAT300_files/Default.htm"&gt;this one on Yukon&lt;/a&gt;, also, for an interesting perspective on why you should use SPs in Sql Server, watch the first 10 minutes! Man, I am so looking foward to Yukon reaching RTM; the architectures which this thing enables will be so elegant.&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;UPDATE:&lt;/font&gt; As &lt;a href="http://weblogs.asp.net/jgalloway"&gt;Jon Galloway&lt;/a&gt; pointed out, these are pretty buggy; the UI takes a bit of getting used to (or sucks to an incredible degree would be more accurate) - hint, don't click on the images for each track, click on the text. Worth persevering though!&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/663.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/11/25/yukon-presentation---it-rules.aspx</guid>
            <pubDate>Tue, 25 Nov 2003 13:23:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/11/25/yukon-presentation---it-rules.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/663.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Now this really bugs me...</title>
            <link>http://mostlylucid.net/archive/2003/11/22/now-this-really-bugs-me.aspx</link>
            <description>&lt;p&gt;Noticed a link in my referrer log from &lt;a href="http://dotnetguy.techieswithcats.com/archives/003970.shtml"&gt;this post&lt;/a&gt; which comments on a comment I made in the &lt;a href="http://weblogs.asp.net/fbouma/posts/38178.aspx"&gt;whole Dyanmic SQL debate&lt;/a&gt;, this comment:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Right. Because evaluating arguments based on their &lt;strong&gt;validity&lt;/strong&gt; is too much work, so it's much easier to pick the "winner" by &lt;strong&gt;picking the side with the least vested interest&lt;/strong&gt;. It apparently has &lt;strong&gt;nothing to do with the fact that Frans is, well, correct&lt;/strong&gt;?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Based on my comment taken out of context from &lt;a href="http://www.mostlylucid.co.uk/posts/622.aspx"&gt;this post&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;"&lt;em&gt;To be honest I'm always a bit reticent to pay much credence to an argument on an approach to Data Access from someone who has a vested interest."&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Sorry, but I did not 'pick a winner' I said in the same post that I took no absolute position in this debate, for the most part I disagreed with Frans's position because I did not agree with many of his arguments, the vested interest comment was based on this by Frans- &lt;/p&gt;
&lt;p&gt;"&lt;em&gt;A good O/R mapper helps you with this. Microsoft also believes stored procedures are over: Microsoft's next generation business framework MBF is based on Objectspaces, which generates SQL on the fly.&lt;/em&gt; ". &lt;/p&gt;
&lt;p&gt;So his position seemed to be boiling down to the belief that you should use an O/R mapper (such as of course, LLBLGen Pro), it was also positing the belief that Microsoft had the belief that this was also true (Objectspaces is ONE approach, Yukon actually increases the utility of Stored procedures by allowing the use of cLR code within them) , in addition I made several comments; and replied to a comment from Frans here on my own site which did challenge the validity or his argument - is it too much work to read ALL the comments? &lt;br /&gt;My initial comment boiled down to the fact that if you have a strong vested interest in any position on any topic, it is likely that your arguments will be slanted to one position over the other, I love pizza so if someone asks what 'the best' food is, I'm going to argue for Pizza. If you also read further into the comments - and Rob Howard's folow up comments - the validity of Frans's argument is challenged alot! What these comments on my post seem to come down to is that this guy agrees with Frans's position, didn't bother checking the 'facts' presented and therefore chose to take task with my position because he didn't agree with it...fine!&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/658.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/11/22/now-this-really-bugs-me.aspx</guid>
            <pubDate>Sun, 23 Nov 2003 01:12:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/11/22/now-this-really-bugs-me.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/658.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQLJunkies...fine, fine blogging site</title>
            <link>http://mostlylucid.net/archive/2003/11/20/sqljunkies.fine-fine-blogging-site.aspx</link>
            <description>The &lt;a href="http://sqljunkies.com/WebLog/"&gt;SqlJunkies weblog site&lt;/a&gt; is really starting to fill out, it's fantastic to have so many SQL experts posting in one place! Oh, and I'm not just saying that because I agree with &lt;a href="http://sqljunkies.com/WebLog/DonnyMack/posts/473.aspx"&gt;Donny Mack's views on SPs&lt;/a&gt;; well, partially, reporting is still a pain but I had discovered a good link to a version using the &lt;a href="http://www.algonet.se/~sommar/dyn-search.html"&gt;SP to generate the Dynamic SQL which seemed like a sound approach.&lt;/a&gt;&lt;img src="http://mostlylucid.net/aggbug/654.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/11/20/sqljunkies.fine-fine-blogging-site.aspx</guid>
            <pubDate>Fri, 21 Nov 2003 06:10:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/11/20/sqljunkies.fine-fine-blogging-site.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/654.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Stored Procedures versus Dynamic SQL - the old debate...Frans Bouma's take...</title>
            <link>http://mostlylucid.net/archive/2003/11/18/stored-procedures-versus-dynamic-sql---the-old-debate.frans-boumas.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://weblogs.asp.net/fbouma"&gt;Frans Bouma&lt;/a&gt; really doesn't see the point of using &lt;a href="http://weblogs.asp.net/fbouma/posts/38178.aspx"&gt;Stored Procedures over using Dynamic SQL&lt;/a&gt; - so Frans, what's your take on such things as &lt;a href="http://www.sqlteam.com/item.asp?ItemID=1015"&gt;Indexed Views &lt;/a&gt;and User Defined Functions - which are essentially SPs but there's no equivalent for Dynamic SQL, so you're suggesting I should not use these any more? &lt;br /&gt;To be honest I'm always a bit reticent to pay much credence to an argument on an approach to Data Access from someone who has a &lt;a href="http://www.llblgen.com/"&gt;vested interest&lt;/a&gt; (I know &lt;a href="http://www.llblgen.com/"&gt;LLBLGen Pro&lt;/a&gt; supports SPs but it does have a strong bias towards Dynamically Generated T-SQL), kinda like MS on the Linux debate...slight vested interest (or former &lt;a href="http://www.fool.com/News/mft/2003/mft03032502.htm"&gt;Halliburton CEO&lt;/a&gt; on &lt;a href="http://www.thetip.org/art_Haliburton_Awarded_Massive_Iraqi_Oil_Reconstruction_Deal268_icle.html"&gt;Iraq &lt;/a&gt;- but that's a different matter :-))&lt;br /&gt;I do use SPs almost exclusively for Data access, I have no vested interest in one approach or the other, I used to use Dynamic SQL in the bad old days of ASP/VBScript but switched to SPs when I needed more oomph in my data access code. I have a strong preference for manipulating data using Set based logic, yes, for more complex operations I'll bring the data into code but in general, I use the DB for manipulating and then return the smallest amount of data back to code. The reason I do this isn't stubbornness, simply I find it easier to filter and composite my data closest to it's source. &lt;br /&gt;I also find some of Frans's arguments a bit lacking, there is an argument for using Dynamic SQL where you have to react to user input for filtering data; reports are a classic example where you might want to find  matching data items based on a variable number of inputs - by all means use Dynamic SQL for that, but in 90% of cases I just want to pull data from a DB as quickly and painlessly as possible this is where I'd use SPs. I often use &lt;a href="http://www.eggheadcafe.com/articles/20010823.asp"&gt;Table variables&lt;/a&gt; for compositing and filtering data, treating SPs as set providers and modifying the eventual output resultset to contain only the data I actually need - this would usually require multiple trips to and from the DB (we're talking in the dozens here for each instance) and would be pretty slow, as well as causing heavy network traffic which I can usually ill afford in  highly scalable sites.&lt;br /&gt;In short what I'm saying is that for my purposes, the 90% Stored Procedures, 10% Dynamic SQL works best - making absolute statements about such things is like commenting on religion, politics or Open Source  or Java - I don't believe there is a completely binary argument to be made in any of these areas, there's too many entrenched views - horses for courses is my opinion :-)&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/648.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/11/18/stored-procedures-versus-dynamic-sql---the-old-debate.frans-boumas.aspx</guid>
            <pubDate>Wed, 19 Nov 2003 01:12:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/11/18/stored-procedures-versus-dynamic-sql---the-old-debate.frans-boumas.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/648.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Run .NET code from Sql Server - before Yukon!</title>
            <link>http://mostlylucid.net/archive/2003/10/14/run-.net-code-from-sql-server---before-yukon.aspx</link>
            <description>Found &lt;a href="http://www.turtlenecksoftware.com/"&gt;this&lt;/a&gt; on &lt;a href="http://weblogs.asp.net/ashben/"&gt;Ashutosh Nilkanth's &lt;/a&gt;blog (good name!), basically allows you to run pretty much any CLR code using a Sql Server extended stored procedure - not nearly as good as &lt;a href="http://www.microsoft.com/sql/evaluation/yukon.asp"&gt;Yukon&lt;/a&gt;, but if you need to do this now, it is a start!&lt;img src="http://mostlylucid.net/aggbug/614.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/10/14/run-.net-code-from-sql-server---before-yukon.aspx</guid>
            <pubDate>Wed, 15 Oct 2003 00:25:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/10/14/run-.net-code-from-sql-server---before-yukon.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/614.aspx</wfw:commentRss>
        </item>
        <item>
            <title>SQL Server 2000 Indexed Views</title>
            <link>http://mostlylucid.net/archive/2003/09/17/sql-server-2000-indexed-views.aspx</link>
            <description>Though I'd point to an excellent &lt;a href="http://www.sqlteam.com/item.asp?ItemID=1015" target="_blank"&gt;article on Indexed Views&lt;/a&gt;. For those who don't know what these are, well, if you have a fairly complex database schema, you can gain a great deal of performance benefits by aggregating the output of common queries into indexed views. Unlike normal views, these are authomatically updated when the underlying data changes (normal views are pretty much just running another query when you call them). 
They're best suited when you perform frequent queries on relatively static underlying data (kind of a database level cache)...&lt;img src="http://mostlylucid.net/aggbug/568.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2003/09/17/sql-server-2000-indexed-views.aspx</guid>
            <pubDate>Thu, 18 Sep 2003 05:15:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2003/09/17/sql-server-2000-indexed-views.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/568.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
