<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/"><channel><title>SQL</title><link>http://blog.steeleprice.net/category/26.aspx</link><description>SQL</description><managingEditor>H. Steele Price, IV</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>H. Steele Price, IV</dc:creator><title>We don't need no stinkin' DBAs...</title><link>http://blog.steeleprice.net/archive/2008/06/02/1497.aspx</link><pubDate>Mon, 02 Jun 2008 18:02:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2008/06/02/1497.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/1497.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2008/06/02/1497.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/1497.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/1497.aspx</trackback:ping><description>&lt;P&gt;This is precisely why I think that we need &lt;A href="http://blog.steeleprice.net/archive/2008/05/20/1485.aspx" target=_blank&gt;EntityDB&lt;/A&gt;. DBA's are great when you have the luxury of hiring one (or having one on staff).&amp;nbsp; MicroISVs and Small companies with a need for custom software do not always have this luxury, nor the insight to hire one.&amp;nbsp; In today's world of Code Generation, Metadata and an awesome pool of brain's at Microsoft - this can all be automated by some the best in the business.&amp;nbsp; Linq Plumbing should not be rocket science, it should be straight-forward and simple to understand.&amp;nbsp; I should not have to have a DBA to write a decent scalable model when the Object Model can generate a proper Database and communication layer all by itself.&amp;nbsp; I say it &lt;EM&gt;CAN&lt;/EM&gt;, it just doesn't because there is not yet enough screaming for it.&amp;nbsp; So in the meantime, I will just keep screaming&amp;nbsp;a little louder each day.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;For example, one commercially available survey software that I won't name here, had code in it that retrieved of tens of thousands of rows from the database only to filter them out in a for/each loop in C#. 
&lt;P&gt;Needless to say, that ended up being a big bottleneck in terms of CPU use and network bandwidth. 
&lt;P&gt;The sales rep swore up and down about the scalability of the solution, when, in reality, it didn't take much traffic to bring the data center to its knees. 
&lt;P&gt;The moral of the story: trust your developers to write code, not manage huge amounts of data. 
&lt;P&gt;Depending on your developers, you may want to be careful about how much to trust them with the data. 
&lt;P&gt;Experienced DBAs can be a real pain to work with and that's what makes them great. 
&lt;P&gt;They demand referential integrity and schemas and won't let you make one little change to the schema to simplify what code you have to write.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://franksworld.com/blog/archive/2008/06/02/10968.aspx"&gt;Andy Leonard on Twitter's Woes&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/1497.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>EntityDB: The next great Microsoft tool (if they would just make it)</title><link>http://blog.steeleprice.net/archive/2008/05/20/1485.aspx</link><pubDate>Tue, 20 May 2008 15:38:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2008/05/20/1485.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/1485.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2008/05/20/1485.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/1485.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/1485.aspx</trackback:ping><description>&lt;P&gt;Reading in the Industry blogs, official samples and documentation provided with MS SQL Server 2005+, Visual Studio 2008 and Linq to Sql and the Entity Framework, you will get the impression that we have a tremendous ability to efficiently decipher how to interact with a Database.&amp;nbsp; Additionally, Industry leaders have led us down a path of Code Generators, Designers and the separation of UI Design from functional Object code; read "Astoria" and/or "MVC" here...&lt;/P&gt;
&lt;P&gt;Didn't CASE do this sort of thing for us years ago?&amp;nbsp; Didn't it also fail?&amp;nbsp; There is huge amount of traffic about the topic of "Falling down when you hit a threshold" and insistence that all things should be built ultra-scalable.&amp;nbsp; OK, that's great if you love to write plumbing.&amp;nbsp; I for one, don't. What if that could be done for you, with the most efficient options always at your disposal; of course with the opportunity to tweak and extend to meet a specific need.&lt;/P&gt;
&lt;P&gt;While there are many great arguments to be had over what is exactly ultra-efficient and those who think they have a better method must be able to override and extend the selected generation of code that is offered by not only being able to write that code, but also to inject it into the Generated Code (or at the least allowed to edit the templates) produced by Visual Studio.&lt;/P&gt;
&lt;P&gt;If you don't already know why this is so important, we need to first look at the massive shift in Business Software Development and where we are going to be running most business applications.&amp;nbsp; We used to run all our apps on our own hardware, inside our own network and everything was under our tight control.&amp;nbsp; While this model still applies to much corporate development, I believe it will become less and less used as a cost effective alternative to a HOSTED solution.&amp;nbsp; Pricing of hosted solutions have plummeted in recent years, in fact I am almost willing to bet that the cost of electricity alone using hardware just a few years old would cover the cost of a hosted solution.&amp;nbsp; And what happens when I DO need to scale, How do I add 20 servers to the Web Farm overnight?&amp;nbsp; Staffing requirements and maintenance of hardware start to become totally offset when we look at this model. I CANNOT BUILD A SERVER CHEAPER THAN I CAN HOST ONE!&amp;nbsp; That is the real bottom line.&lt;/P&gt;
&lt;P&gt;I would wager that MOST applications would run just fine on a hosted solution with one machine doing all the work, at least in the beginning, or at least with a hoster that gives you Web on one machine and your DB on another.&amp;nbsp; Are we talking about every solution here?&amp;nbsp; No, but I think we are talking about a gigantic sector of the market that is currently all but ignored by the provided tools we have at our disposal.&lt;/P&gt;
&lt;P&gt;Don't get me wrong here, we have GREAT tools available and more coming, do they target what is really needed?&lt;/P&gt;
&lt;P&gt;First lets look at the three new primary tools given to us by Microsoft.&amp;nbsp; WCF, Linq to Sql and the Entity Framework.&amp;nbsp; WCF provides a great pipeline to pass data between our UI, Business Objects and Database, but it just plumbing.&amp;nbsp; Linq to Sql and EF provide a great way to interact with a Database IF and ONLY If you have a proper database in place first.&lt;/P&gt;
&lt;P&gt;What does this mean to most data-driven development projects?&amp;nbsp; It means they either need a DBA, or they need to hire one for the portion of the application that defines the database.&amp;nbsp; This is one reason &lt;A href="http://wiki.rubyonrails.org/rails/pages/understandingmigrations" target=_blank&gt;Migrations for Ruby on Rails&lt;/A&gt; has gained so much popularity, it hides this chore.&amp;nbsp; Most of us don't care about the DB, it's just a place that holds data.&amp;nbsp; Some of you can go on and on all day about the subtleties of databases but that is completely outside the scope of what I am talking about here. Not only will Migrations create a DB and Schema around what your App needs, it will also keep it up to date with changes made by any developer that can be easily stored in Version Control software like SVN or TFS.&lt;/P&gt;
&lt;P&gt;This is what the Designers for Linq to Sql and/or Entity Framework need to do for us.&amp;nbsp; I really don't mind changing my Linq to SQL Apps over to Entity Framework if it will allow us to focus on one great technology.&amp;nbsp; It's great that they can operate against a currently created database, but they should also create one (IN AN OPTIMIZED WAY) when one does not exist.&amp;nbsp; It should create Stored Procedures if I tell it to... Even if we are migrating a legacy application, I would still like to see what a tool spits out for me.&amp;nbsp; I just might use the new techniques.&amp;nbsp; There are tons of ways to move data from one schema to another, again, outside the scope of this article.&amp;nbsp; So back to the scope...&amp;nbsp; EF Does a great job of creating an interaction between Database and Business Objects, but it doesn't help us rapidly create a NEW model without an existing database and I think this is important in two ways, first and foremost, I don't want to write any plumbing code to do this.&amp;nbsp; The tools are smart enough already to do almost all the work for us, it can go just a little bit further and create the expected interaction that solves most of the interaction of the database work for us.&amp;nbsp; I can create a Model with the EF Designer by adding Properties and Associations, but it won't go and create a database around that model.&lt;/P&gt;
&lt;P&gt;I should not have to know about how the interaction happens, just that it does and that it does so in a fairly efficient manner.&amp;nbsp; If I lose a certain percentage of performance due to layers, then so be it if I can create my application 10 times faster.&amp;nbsp; If the tool developers choose to implement change tracking in a DataContext or Object Context that is great, do so in a way that makes sense for the CODE developers to use, not require me to go hire Database professionals to argue about the proper plumbing or storage techniques.&amp;nbsp; Linq ALREADY knows how to create efficient SQL, if it did so in code generation vs. dynamically at runtime who cares?&lt;/P&gt;
&lt;P&gt;We can host a solution out in the cloud so should we need to be worried about the optimization of how our application persists its data?&amp;nbsp; Certainly there is is need to cover legacy applications and all the DBAs running around out there, that is well covered right now.&amp;nbsp; What we seem to be missing is the ability for competent application developers to create Rich Internet Applications (read Silverlight and Ajax) and have the data persisted without a bunch of plumbing and tweaking.&lt;/P&gt;
&lt;P&gt;What is NOT covered is the ability to rapidly envision, design, develop and deploy solutions destined to live on a Hosted Solution -- even if it is "hosted" internally.&amp;nbsp; This solution will most likely have a distinct separation between UI, Business Objects and Database, but do I really need to see those distinctions in my code?&amp;nbsp; Not really.&amp;nbsp; Do I really need to spend the time to wire up all the Databinding when the MetaData already knows what I need to do?&amp;nbsp; No Way, a tool can create that for us.&amp;nbsp; It can already look into our metadata and see what we need to do to hook up a DataGridView to a table.&lt;/P&gt;
&lt;P&gt;I would venture to say that the tools are already here, they just don't work the way we need them to so we can build these applications quickly.&amp;nbsp; I spend MOST of my time Creating a Database, then working on plumbing and interactions between the Database and the UI, I should not have to do this any more.&amp;nbsp; Microsoft did a fabulous job of giving us a database that can scale with us as our application grows.&amp;nbsp; We have SQL CE, SQL Server Express and SQL Server Enterprise to grow with us, we can use SQL CE for Mobile Apps and offline stuff, wouldn't it be wonderful if I did not have to architect that portion of the solution any more?&amp;nbsp; I am talking about the people who do not have the luxury of a full time DBA.&lt;/P&gt;
&lt;P&gt;Of course, the solution is there, staring us right in the face, the answer is the Designer for Entity Framework.&amp;nbsp; If this Designer could be used to build out the Database, and track the Schema changes, then it would take down part of the battle, just a little more work and it could completely remove the NEED (we should always have the option to extend and modify though) for us to write anything between the Business Objects and the Database.&lt;/P&gt;
&lt;P&gt;We should not need to write Serializers for Silverlight, WCF or anything else, the tools already KNOW how to do that, they just don't.&amp;nbsp; The MetaData is there, let's use it.&amp;nbsp; Rob Conery's Subsonic and ActiveRecord shows there is interest in such a tool, but I say this tool needs to come from Microsoft and it needs to be built into the current generation of tools we are using or are being pushed to use (aka Linq).&amp;nbsp; With Rob and Phil working AT Microsoft why can't they contribute some of that knowledge over to the ADO team and get this into the EF Tools we need.&amp;nbsp; Pablo, Mike, Dinesh and the rest of the ADO Team are doing a great job so far, but they are only touching on what we really need.&amp;nbsp; The newest version of EF finally gets a way to do disconnected graphs which is a step towards the goal thanks to &lt;A href="http://blogs.msdn.com/dsimmons/" target=_blank&gt;Danny Simmons&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;These tools need to work seamlessly with Linq and allow me as a developer to write applications with little or no concern for how my data is persisting.&amp;nbsp; I want to create Controls that I can offer to my UI which work seamlessly with Ajax or Silverlight and not require me to write a ton of plumbing just to move things back and forth from one layer to another.&lt;/P&gt;
&lt;P&gt;This is the challenge for the new world of development.&amp;nbsp; We have already moved to a hosted world and our tools need to move there with us. But what do I know, I am a VB developer first and foremost... This is what I know, my customers are asking me to create these applications and to create them really fast.&amp;nbsp; I can choose to use the tools I know best or I can branch out and find something new.&amp;nbsp; The problem here is that I have already invested years of time to learn the tools I am using and they are simply not doing what I need them to do to make my job truly easier.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;My Invoice Object doesn't really need to know what DataContext my Customer Object lives in and I as a developer should not have to be concerned about that in the slightest.&amp;nbsp; I should be able to freely take a Customer I loaded from Invoice "A" and assign it to be used for Invoice "B" without worrying what context it came from, Invoice "B" just needs to know its a valid Customer or that it is a new one I just created without me forcing something into the plumbing to test it.&amp;nbsp; It should know how to roll itself back when I cancel changes, etc.&lt;/P&gt;
&lt;P&gt;With Generics and XML Literals, VB is a Top Notch Code Generator.&amp;nbsp; &lt;A href="http://msmvps.com/blogs/kathleen/" target=_blank&gt;Kathleen has proven that here&lt;/A&gt; and &lt;A href="http://karlshifflett.wordpress.com/2008/03/02/visual-studio-2008-designers-and-code-generators-you-have-overlooked/" target=_blank&gt;Karl talks about Metadata and what we can do with it over here&lt;/A&gt;... We don't need Yet Another Code Generator.&amp;nbsp; We need something that works with the existing modelers and designers and just makes our life as developers easier.&amp;nbsp; It needs to be INSIDE Visual Studio and we need to be able to work with the templates.&amp;nbsp; I should not need LLBLGen or MyGeneration or CodeSmith or SubSonic to do something Visual Studio pretty much already knows HOW to do, it just doesn't.&amp;nbsp; I don't need another designer that works with an existing database, I need the CURRENT Designers to Make the Database AND the plumbing.&lt;/P&gt;
&lt;P&gt;I personally think this should be the direction for the next revision of Visual Basic.&amp;nbsp; VB IS the glue that puts the framework together, sure you could also do it in C# (if they added XML Literals...) but VB is already geared for it so why not enhance it's productivity even further by giving us a way to be far more productive than we are today.&amp;nbsp; This does not require any great shift in the tools we already have, it just requires Microsoft to use them smarter and provide us the keys we need to open the door.&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/1485.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>Inside T-SQL</title><link>http://blog.steeleprice.net/archive/2007/06/05/1173.aspx</link><pubDate>Tue, 05 Jun 2007 05:45:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2007/06/05/1173.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/1173.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2007/06/05/1173.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/1173.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/1173.aspx</trackback:ping><description>&lt;p&gt;Itzik Ben-Gan once again displays his mastery of T-SQL.&amp;nbsp; He shows us ways to do somedificult or even unconventional things inside Stored Procedures and Functions.&amp;nbsp; He also comments that CLR Functions can be up to 3 times faster at doing String Manioulation than using raw T-SQL.&amp;nbsp; This of course make sense due to the effieciency that the CLR provides for this over the oftem cryptic or limited functionality provided by T-SQL.&lt;/p&gt; &lt;p&gt;His biggest offering was a phenomenal Pivot Stored Procedure that overcomes the limitations of the PIVOT() functionality (such as dynamic columns names) most of which can be &lt;a href="http://www.sql.co.il/books/insidetsql2005/sample_chapters.htm"&gt;found here&lt;/a&gt;&amp;nbsp; He also has some pretty interesting uses of the STUFF() Function.&lt;/p&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/1173.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>Aggregate Data with XML and SQL2005</title><link>http://blog.steeleprice.net/archive/2007/02/22/1117.aspx</link><pubDate>Thu, 22 Feb 2007 23:50:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2007/02/22/1117.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/1117.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2007/02/22/1117.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/1117.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/1117.aspx</trackback:ping><description>&lt;P&gt;I was completely wrong about what I understood about GROUP BY with FOR XML PATH() commands.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blog.steeleprice.net/archive/2006/06/15/881.aspx"&gt;I specifically asked about this&lt;/A&gt; at &lt;A title="TechED Main Site" href="http://www.microsoft.com/teched" target=_blank&gt;TechED&lt;/A&gt; last year and just never actually tried it, I just took it for granted that it didn't work for some reason.&amp;nbsp; For the heck of it (and out of complete frustration), I did try it a week ago and lo and behold it just worked...&lt;/P&gt;
&lt;P&gt;I quickly tore apart some old procedures that FINALLY got upgraded to SQL2005 and the difference in the code and speed where dramatic!&amp;nbsp; I am totally happy with this solution.&lt;/P&gt;
&lt;P&gt;The following works perfectly fine (and fast...)&lt;/P&gt;&lt;PRE&gt;    &lt;SPAN class=kwrd&gt;SELECT&lt;/SPAN&gt;
        RequestorID &lt;SPAN class=kwrd&gt;As&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@RequestorID'&lt;/SPAN&gt;, 
        dbo.fn_GetLBRequestorName(RequestorID,@LocationUID) &lt;SPAN class=kwrd&gt;As&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@RequestorName'&lt;/SPAN&gt;,
        &lt;SPAN class=kwrd&gt;Count&lt;/SPAN&gt;(LogEntryID) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@Entries'&lt;/SPAN&gt;, 
        &lt;SPAN class=kwrd&gt;Sum&lt;/SPAN&gt;(Pages) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@Pages'&lt;/SPAN&gt;, 
        &lt;SPAN class=kwrd&gt;Sum&lt;/SPAN&gt;(Billable) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@Billable'&lt;/SPAN&gt;, 
        &lt;SPAN class=kwrd&gt;Sum&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;CASE&lt;/SPAN&gt; Billable &lt;SPAN class=kwrd&gt;WHEN&lt;/SPAN&gt; 0 &lt;SPAN class=kwrd&gt;THEN&lt;/SPAN&gt; 1 &lt;SPAN class=kwrd&gt;ELSE&lt;/SPAN&gt; 0 &lt;SPAN class=kwrd&gt;END&lt;/SPAN&gt;) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@NonBillable'&lt;/SPAN&gt;, 
        &lt;SPAN class=kwrd&gt;Sum&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;CASE&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;WHEN&lt;/SPAN&gt; ((Date_Completed &amp;gt; &lt;SPAN class=str&gt;'01/01/1900'&lt;/SPAN&gt;)) &lt;SPAN class=kwrd&gt;THEN&lt;/SPAN&gt; 1 &lt;SPAN class=kwrd&gt;ELSE&lt;/SPAN&gt; 0 &lt;SPAN class=kwrd&gt;END&lt;/SPAN&gt;) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@Completed'&lt;/SPAN&gt;,
        &lt;SPAN class=kwrd&gt;Sum&lt;/SPAN&gt;(&lt;SPAN class=kwrd&gt;CASE&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;WHEN&lt;/SPAN&gt; ((Date_Completed &amp;lt; &lt;SPAN class=str&gt;'01/01/2000'&lt;/SPAN&gt;)) &lt;SPAN class=kwrd&gt;THEN&lt;/SPAN&gt; 1 &lt;SPAN class=kwrd&gt;ELSE&lt;/SPAN&gt; 0 &lt;SPAN class=kwrd&gt;END&lt;/SPAN&gt;) &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; &lt;SPAN class=str&gt;'@Incomplete'&lt;/SPAN&gt;
    &lt;SPAN class=kwrd&gt;FROM&lt;/SPAN&gt;
        LogEntry
    &lt;SPAN class=kwrd&gt;WHERE&lt;/SPAN&gt;
        (LocationUID = @LocationUID) &lt;SPAN class=kwrd&gt;AND&lt;/SPAN&gt;
        (
            ((@StartDate &lt;SPAN class=kwrd&gt;is&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;Null&lt;/SPAN&gt;) &lt;SPAN class=kwrd&gt;OR&lt;/SPAN&gt; (@EndDate &lt;SPAN class=kwrd&gt;is&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;Null&lt;/SPAN&gt;)) &lt;SPAN class=kwrd&gt;OR&lt;/SPAN&gt; 
            (Date_Received &lt;SPAN class=kwrd&gt;between&lt;/SPAN&gt; @StartDate &lt;SPAN class=kwrd&gt;and&lt;/SPAN&gt; @EndDate)
        )
    &lt;SPAN class=kwrd&gt;GROUP&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;BY&lt;/SPAN&gt; RequestorID
    &lt;SPAN class=kwrd&gt;ORDER&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;BY&lt;/SPAN&gt; RequestorID
    &lt;SPAN class=kwrd&gt;FOR&lt;/SPAN&gt; XML &lt;SPAN class=kwrd&gt;PATH&lt;/SPAN&gt;(&lt;SPAN class=str&gt;'Requestor'&lt;/SPAN&gt;), TYPE, ROOT(&lt;SPAN class=str&gt;'Requestors'&lt;/SPAN&gt;)
&lt;/PRE&gt;
&lt;P&gt;I will be putting an updated article up revealing my findings and the sheer delight it is to create Structured XML with SQL 2005.&amp;nbsp; The SQL 2000 Solution is &lt;A href="http://blog.steeleprice.net/articles/154.aspx"&gt;over here&lt;/A&gt; and is pretty ugly.&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/1117.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>SQL Server 2005 - XML and Recursion</title><link>http://blog.steeleprice.net/archive/2006/06/15/881.aspx</link><pubDate>Thu, 15 Jun 2006 15:26:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2006/06/15/881.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/881.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2006/06/15/881.aspx#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/881.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/881.aspx</trackback:ping><description>&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;I have been thinking about some ways to combine two new features of SQL 2005 to do some very complex Hierarchies without having to resort to using SQL Explicit and really confusing, verbose scripts.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Those two Features are For XML and Recursion.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;I attended the two deep dive sessions for each of these today and have a few take-aways that are going to help me to formulate my ideas around this.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;First, in the XML Deep Dive, &lt;A href="http://sqljunkies.com/weblog/mrys/"&gt;Michael Rys&lt;/A&gt; gave a little more detail than he was able to at last year's PDC session that I attended. Here are some features that I am going to definitely be using in my development:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;Type directive&lt;/SPAN&gt; - Enables you to return an XMLDocument datatype to ADO instead of raw text strings, the primary advantage here is that you don't need to use a SQL Datareader to concatenate all the XML results any more. Just tack it on like this&amp;#8230; "select * from orders for xml auto, type"&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;Path Mode&lt;/SPAN&gt; - This lets you rename the elements returned easily, path('myelement') returns &amp;lt;myelement&amp;gt; instead of the table name.&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;With XmlNamespaces&lt;/SPAN&gt; - Allows you to set specific namespaces for the elements&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;Wrapper Elements&lt;/SPAN&gt; through Column Aliasing and Nested Subqueries to support additional hierarchies&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;XslNil&lt;/SPAN&gt; to support empty elements&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;SPAN style="FONT-WEIGHT: bold"&gt;Root directive&lt;/SPAN&gt; to support adding a Root element - i.e. root('MyRoot')&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;One thing I was disappointed to hear is that "Group By" is still not allowed explicitly you have to hide it some way, like in this &lt;A href="http://blog.steeleprice.net/articles/154.aspx"&gt;&lt;U&gt;&lt;FONT color=#800080&gt;previous article I wrote for aggregates&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt; I was totally wrong about this, I guess I misunderstood, I feel like an idiot now for not just trying it... Group By works fine when structured &lt;A href="http://blog.steeleprice.net/archive/2007/02/22/1117.aspx"&gt;like this&lt;/A&gt;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&lt;A href="http://www.sql.co.il/"&gt;Itzik Ben-Gan&lt;/A&gt; gave a great presentation on doing recursion effectively.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I really got a lot out of his advanced techniques for using CTEs (Common Table Expressions).&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Consider using CTEs when you need to retrieve self joins that exhibit nested hierarchies in your data such as an OrgChart (so and so reports to so and so&amp;#8230;) or Part Kits, Kits are a list of parts that may contain other Kits.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Sometimes people resorted to using cursors or temp tables to achieve these results in the past, now there is a very efficient way to do this type of recursion in SQL Server.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Recursion can be inefficient when it needs to replicate a lot of data to call itself, but the SQL Team decided to internally do all recursion as loops which are much more efficient.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;There is still a safety net to prevent non-terminating loops (usually due to data errors) which you may turn off programmatically if you are really sure you want to do infinite recursion.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The MaxRecursion property is not something you should use to limit data either, you should be doing this with a proper recursion level counter as one of your rows and jump out at whatever threshold you set, also, you should be doing boolean tests to find repeating cycles so that infinite loops are avoided.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;There is now a RowNumber() function that is extremely fast and with a little though about recursion can be used for on the fly sorting in hierarchical recordsets.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;This can really improve your performance over sorting by non-indexed text fields and doing multiple sorts in hierarchies.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I'll post more about that in a future article.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Now, putting all of this together, I am sure that I can create very efficient and very fast ways of creating Hierarchies that involve nested joins, recursion, subqueries and aggregates (all at the same time) that where either impossible or at best extremely difficult in the past.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;When I have some time to organize my thoughts about this when I get back from the conference I will write up an article that talks about it in detail.&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/881.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>SQL Server 2005 - Everywhere Edition</title><link>http://blog.steeleprice.net/archive/2006/06/15/880.aspx</link><pubDate>Thu, 15 Jun 2006 09:01:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2006/06/15/880.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/880.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2006/06/15/880.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/880.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/880.aspx</trackback:ping><description>&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Microsoft Officially Announces&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;SQL Server 2005 - Everywhere Edition.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Have you every wanted to just access some LOCAL data on your laptop without having to install SQL Express or some other server system just to store some info?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Of course you have, most of us have used things like access .MDB files, XML, or even raw text to do this in the past, now we have the option of storing SQL Server data locally and further have the ability to sync and merge with a server on a remote network for occasionally connected systems.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;If you have done any Mobile Development for PDAs or Tablets then you may know there is the option of SQL Mobile&amp;#8230; That is essentially what this is (renamed), but it is being greatly enhanced.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Some of the internal enhancement I can't talk about yet, but here is what I can:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Licensing - Free (essentially the same as SQL Express) now available on XP/2003/Vista as well&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Database Size Limit - 4Gb (not set in stone, but most likely)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Runtime Size - 1.4Mb - running In Process with your App (including Office Apps for VSTO developers)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;This means no server to install, just some DLLs that are independent from anything else and can just be added/removed without harming any other app on your system.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Single Data File(.sdf) - no transaction log, etc.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Sync with a backend SQL Server through Merge &amp;amp; Replication - (More than just RDA soon)&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Differencing Tools in the ADO.NET extensions (MergeUpdated(), MergeInserts(), MergeDeletes())&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Complete control over collision handling so you can choose client wins, Server wins or create a custom solution because you have access to both sides of the colliding row.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Multi-connection support so you can run multiple background processes on the same file.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Windows can handle the ACL on the file so you can lock the file to a group of domain users, etc.&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;For just replicating server data locally for partially disconnected access this will really be useful.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I look forward to installing and testing the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=85E0C3CE-3FA1-453A-8CE9-AF6CA20946C3&amp;amp;displaylang=en"&gt;&lt;U&gt;&lt;FONT color=#800080&gt;CTP that is now available here&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;. &lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/880.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>Should I do that in T-SQL?</title><link>http://blog.steeleprice.net/archive/2006/06/13/872.aspx</link><pubDate>Tue, 13 Jun 2006 08:02:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2006/06/13/872.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/872.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2006/06/13/872.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/872.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/872.aspx</trackback:ping><description>Richard Campbell delivered an "as always" great session about SQL Query optimization, this year his special flavor of tools extend to differences in SQL 2005 and where very enlightening. &lt;EM&gt;&lt;STRONG&gt;&lt;A href="http://www.campbellassociates.ca/blog/Trackback.aspx?guid=30fb2286-2729-44ba-bd5e-943bfb176062"&gt;update: Here's the code.&lt;/A&gt;&lt;/STRONG&gt;&lt;/EM&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;One thing he covers has always been the fabulous &lt;A href="http://www.stephenforte.net/owdasblog/PermaLink.aspx?guid=2b0532fc-4318-4ac0-a405-15d6d813eeb8"&gt;&lt;U&gt;&lt;FONT color=#800080&gt;Rozenshtein method of doing Crosstabs (Pivot tables)&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While this is not really necessary since we have the Case Statement; it is quite useful when you need to create something that will run in virtually any database that supports SQL statements or when you need to create dynamic SQL and for some reason can't use a Stored Procedure.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;He noted the still persistent problem of crosstabs in SQL 2005 with the new Pivot Command.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;While this does help, it still forces you to hard code the column names or build the SQL Dynamically (which will bypass the compiler and optimizer).&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;If you want to know the real reason for this, it's because the low-level plumbing is extremely difficult to achieve in a performant way and will most likely be included in a future release when they can pound the algorithms down to improve performance.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Another noted example is to get rid of cursors by using temp tables (and Table Variables I might add).&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Also covered was the new Ranking commands in SQL 2005, and how to simulate them (with small differences) in SQL 2000.&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="FONT-SIZE: 11pt; MARGIN: 0in; FONT-FAMILY: Calibri; mso-outline-level: 1"&gt;Overall a most enjoyable session, Thanks Richard.&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/872.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>Language Integrated Queries</title><link>http://blog.steeleprice.net/archive/2005/09/17/818.aspx</link><pubDate>Sat, 17 Sep 2005 10:22:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2005/09/17/818.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/818.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2005/09/17/818.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/818.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/818.aspx</trackback:ping><description>&lt;P&gt;&lt;A href="http://msdn.microsoft.com/netframework/future/linq/"&gt;The LINQ Project&lt;/A&gt; is probably the most exciting announcement of PDC for me.&lt;/P&gt;
&lt;P&gt;I have been using an O/R Mapper for quite some time and I couldn't imagine designing a new application without using one.&lt;/P&gt;
&lt;P&gt;We all heard about ObjectSpaces way back on 2002 and how it would bring object orientation to relational database UIs.&amp;nbsp; Then we all wondered what happened to it when they decided to pull it from the 2.0 Framework.&amp;nbsp; Well, the ideas of ObjectSpaces were rolled into an even more ambitious project, that is LINQ.&lt;/P&gt;
&lt;P&gt;LINQ is broken into several Namespaces: DLinq, XLinq; which target SQL and XML specifically.&lt;/P&gt;
&lt;P&gt;LINQ will not render tools such as LLBLGen useless, in fact, it will further enhance what they do best and allow them to focus on how to do the mapping, LINQ will provide a unified approach to provide the plumbing while third party tools can focus on doing the mapping for us.&lt;/P&gt;
&lt;P&gt;Then using LINQ we can interact with our data in a very object oriented way that is standardized across implementations and does not require us to remain dedicated to a 3rd party solution to provide proprietary ways to actually do the objectness.&lt;/P&gt;
&lt;P&gt;One of the biggest gripes I hear from people about XML is how hard it is to understand and implement things like XPath and XQuery.&amp;nbsp; XLinq and DLinq&amp;nbsp;are going to unify the way we interact with persited data in either&amp;nbsp;XML or SQL, we will essentially access them both in the same way, this is HUGE, it removes the ramp up time developers will need to be able to intuitively write programs that need to interact with data.&lt;/P&gt;
&lt;P&gt;As the project progresses, other persistant data will be added so that we can interact with things like the Registry, WMI, LDAP and other structures in the exact same way without having to learn the internal plumbing required to do that sort of interaction.&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/818.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>Community Launch Team Member</title><link>http://blog.steeleprice.net/archive/2005/09/14/813.aspx</link><pubDate>Wed, 14 Sep 2005 20:40:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2005/09/14/813.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/813.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2005/09/14/813.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/813.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/813.aspx</trackback:ping><description>&lt;P&gt;I am the INETA &lt;FONT size=2&gt;Community Launch Team Member for Phoenix.&lt;/FONT&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;FONT size=2&gt;The Community Launch Team Members will be the local experts on the new products and will speak to their user group at their local Community Launch event of Visual Studio and SQL Server after the official product launch.&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=2&gt;This means that I will be the guy who has the pleasure of introducing and speaking about Visual Studio 2005 and SQL Server 2005 to the Phoenix area.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Feel free to email me with any questions you may have about these two outstanding tools and how they will impact your development process.&lt;/FONT&gt;&lt;/P&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/813.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>H. Steele Price, IV</dc:creator><title>On Dynamic SQL</title><link>http://blog.steeleprice.net/archive/2005/06/22/673.aspx</link><pubDate>Wed, 22 Jun 2005 11:58:00 GMT</pubDate><guid>http://blog.steeleprice.net/archive/2005/06/22/673.aspx</guid><wfw:comment>http://blog.steeleprice.net/comments/673.aspx</wfw:comment><comments>http://blog.steeleprice.net/archive/2005/06/22/673.aspx#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://blog.steeleprice.net/comments/commentRss/673.aspx</wfw:commentRss><trackback:ping>http://blog.steeleprice.net/services/trackbacks/673.aspx</trackback:ping><description>&lt;p&gt;About a Year and a Half ago, &lt;a href="http://blog.steeleprice.net/archive/2003/11/24/136.aspx"&gt;I posted this comment&lt;/a&gt; during &lt;a href="http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx"&gt;the great StoredProc vs. Dynamic SQL debate between &lt;a href="http://weblogs.asp.net/rhoward/archive/2003/11/17/38095.aspx"&gt;Rob Howard&lt;/a&gt; and Frans Bouma&lt;/a&gt;.  I was at the time in favor of Stored Procs.
&lt;/p&gt;
&lt;p&gt;After much work, frustration, observation and rational thinking, I have completely reversed my opinion.
&lt;/p&gt;
&lt;p&gt;The biggest reasons I have reversed that opinion is because I am moving toward embracing a Service Oriented Architecture and Connected Systems.  This doesn't have a lot to do with the whole debate until I started generating my Business Logic Layer and Data Access Layer with LLBLGen Pro.
&lt;/p&gt;
&lt;p&gt;Granted I was sceptical, I strongly debated whether to use CSLA and Stored Procs or a DQE (dynamic query engine).  In the final analysis, I chose the DQE.
&lt;/p&gt;
&lt;p&gt;Why, you ask?  The reason is simple, doing this:&lt;/p&gt;
&lt;pre&gt;
WHERE
     (@MyParam1 is NULL or MyParam1_Field Like @MyParam1) AND
     (@MyParam2 is NULL or MyParam2_Field Like @MyParam2)
&lt;/pre&gt;
or this:
&lt;pre&gt;
WHERE
     MyParam1_Field = COALESCE(@MyParam1,MyParam1_Field) AND
     MyParam2_Field = COALESCE(@MyParam2,MyParam2_Field)
&lt;/pre&gt;
&lt;p&gt;is just stupid, especially when you have a dozen parameters against a table with a million rows.&lt;/p&gt;
&lt;p&gt;It's ugly programming any way you look at it and it is just a hack.&lt;/p&gt;
&lt;p&gt;Not only does the performance suck, it's hard to maintain (even when generated). Furthermore, in CRUD StoredProcs you are still using a procedure that is saving a whole record instead of just the fields that have changed.&lt;/p&gt;
&lt;p&gt;When I need to save a complex data object with elements from different tables, making a Stored Proc do this efficiently and passing back validation/locking errors, etc. is something my DAL should be doing and not something actually inside the database.&lt;/p&gt;
&lt;p&gt;When I started looking at my database as just a persistant storage mechanism and not part of my program, then ripping out all the business logic from inside the database just makes sense.&lt;/p&gt;
&lt;p&gt;If you want to connect to multiple Database backends, then this starts becoming an even bigger priority.  Sure a few of the other players support StoredProcs, you are still going to have to generate them all for each database vendor.&lt;/p&gt;
&lt;p&gt;Why would I want to go through that pain when I can just let a DQE do it for me and not worry about maintaining change scripts.&lt;/p&gt;
&lt;p&gt;Security is another big issue people throw up when talking about SPs vs. DSQL, well, for the last couple of years, I have ONLY used Integrated Security in my connection string so that is no longer a selling point for SPs any more either.&lt;/p&gt;
&lt;p&gt;So I admit it, I have flip-flopped.  As we move towards an even more disconnected and distributed world the logical layers we use to architect our applications are going to end up in the hands of automation tools and hopefully hand-tooling things like Stored Procedures will become a piece of architectural history.&lt;/p&gt;&lt;img src ="http://blog.steeleprice.net/aggbug/673.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>