<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>Links</title>
        <link>http://weblogs.sqlteam.com/jeffs/category/247.aspx</link>
        <description>Random links from the "Internet tubes" that you may enjoy -- free of charge!</description>
        <language>en-US</language>
        <copyright>Jeff Smith</copyright>
        <managingEditor>smith_jeffreyt@yahoo.com</managingEditor>
        <generator>Subtext Version 1.9.4.0</generator>
        <item>
            <title>Implementing Table Inheritance with SQL Server</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2008/02/21/60522.aspx</link>
            <description>I have a new article up at SQLTeam:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.sqlteam.com/article/implementing-table-inheritance-in-sql-server" target="_blank"&gt;Implementing Table Inheritance with Sql Server&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It discusses the situation where you have multiple entities that are distinct, yet they have many attributes or relations in common.   There is an easy way to simplify your database design and your code if you use the concept of a "base table" for that common data, which is very similar to the concept of &lt;span style="font-style: italic;"&gt;Inheritance&lt;/span&gt; in Object-Oriented programming.&lt;br /&gt;
&lt;br /&gt;
I recently had to do this for a client that tracks Contributions to their foundation; there is a base set of data that all Contributions have, such as who donated, how they paid, the date a tax letter was sent, etc. But for certain contribution types we need additional information, such as if they bought an Auction Item, sponsored an Event, and so on. Thus, we set up a "base table" of Contributions and sub-tables for the different types, and set up a constraint to ensure that the right subtable is used depending on the type.  &lt;br /&gt;
&lt;br /&gt;
It sounds complicated and like it may require fancy triggers or at the very least CHECK constraints, but it is very easy to model in T-SQL -- especially in SQL Server 2005+.  The end result is that you have a less redundant database design and much less code to write to maintain that data.  &lt;br /&gt;
&lt;br /&gt;
Check it out if it sounds interesting, or helpful, or if none of this makes any sense and you're wondering what the heck I'm talking about.&lt;br /&gt;
&lt;br /&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60522.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2008/02/21/60522.aspx</guid>
            <pubDate>Thu, 21 Feb 2008 16:05:35 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60522.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2008/02/21/60522.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60522.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60522.aspx</trackback:ping>
        </item>
        <item>
            <title> Working with Time Spans and Durations in SQL Server</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/10/15/time-spans-durations-sql-server.aspx</link>
            <description>If you read this blog on a regular basis, you probably know that a frequently covered topic is &lt;a href="http://weblogs.sqlteam.com/jeffs/category/283.aspx"&gt;dates and times and the use of the DateTime data type&lt;/a&gt;.   Well, along those same lines, my latest article has just been published over at SQL Team: &lt;a style="font-weight: bold;" target="_blank" href="http://www.sqlteam.com/article/working-with-time-spans-and-durations-in-sql-server"&gt;Working with Time Spans and Durations in SQL Server&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
From the Article:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-left: 40px; font-style: italic;"&gt;What is the best way to return the "duration" of an event in SQL, given the start and end datetime values? How can we add up these durations to return grand totals? What data types should be used to return this data to our clients? How do we handle overflows, such as when hours go over 23 or minutes total up to over 59? Are there any T-SQL functions or other techniques that are useful in these scenarios?&lt;/div&gt;
&lt;br /&gt;
It is mostly targeted towards beginner SQL programmers, but even experienced programmers may find some of the ideas and tips useful.&lt;a style="font-weight: bold;" target="_blank" href="http://www.sqlteam.com/article/working-with-time-spans-and-durations-in-sql-server"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/a&gt;&lt;a style="font-weight: bold;" target="_blank" href="http://www.sqlteam.com/article/working-with-time-spans-and-durations-in-sql-server"&gt;Article link&lt;/a&gt;&lt;br /&gt;
&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;see also:&lt;br /&gt;
&lt;/span&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl08_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2007/10/15/time-spans-durations-sql-server.aspx"&gt; Working with Time Spans and Durations in SQL Server&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a title="View Entry" href="../../../../jeffs/archive/2007/09/10/group-by-month-sql.aspx"&gt;Group by Month (and other time periods)&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl08_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2007/08/29/SQL-Dates-and-Times.aspx"&gt;Working with Date and/or Time values in SQL Server: Don't Format, Don't Convert -- just use DATETIME&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl10_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2007/07/03/60248.aspx"&gt;Data Types -- The Easiest Part of Database Design&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl06_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2007/04/13/format-date-sql-server.aspx"&gt;How to format a Date or DateTime in SQL Server&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl06_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2004/12/02/2954.aspx"&gt;Breaking apart the DateTime datatype -- Separating Dates from Times in your Tables&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl04_HyperLink1" title="View Entry" href="../../../../jeffs/archive/2007/10/31/sql-server-2005-date-time-only-data-types.aspx"&gt;Date Only and Time Only data types in SQL Server 2005 (without the CLR)&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a title="View Entry" href="../../../../jeffs/archive/2007/01/02/56079.aspx"&gt;Essential SQL Server Date, Time and DateTime Functions&lt;/a&gt; 				 				&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60374.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/10/15/time-spans-durations-sql-server.aspx</guid>
            <pubDate>Mon, 15 Oct 2007 13:28:43 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60374.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/10/15/time-spans-durations-sql-server.aspx#feedback</comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60374.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60374.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL Server 2008 - Enhancements in Date and Time Data Types (link)</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/08/30/sql-2008-date-and-time-enhancements.aspx</link>
            <description>Speaking of &lt;a href="http://weblogs.sqlteam.com/jeffs/archive/2007/08/29/SQL-Dates-and-Times.aspx"&gt;dates and times&lt;/a&gt;, there's a nice post from &lt;a target="_blank" href="http://blogs.msdn.com/manisblog/default.aspx"&gt;Ravi. S. Maniam&lt;/a&gt; over at the &lt;a target="_blank" href="http://blogs.msdn.com"&gt;msdn blogs&lt;/a&gt; regarding the new and exciting &lt;a target="_blank" href="http://blogs.msdn.com/manisblog/archive/2007/08/28/sql-server-2008-enhancements-in-date-and-time-data-types.aspx"&gt;Enhancements in Date and Time Data Types for SQL Server 2008&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
It will be very interesting to see how date and time usage changes once SQL Server 2008 becomes the most commonly used edition.  Of course, since even SQL 2005 still doesn't seem to be as widely adopted as I would like, who knows when that will be!&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60315.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/08/30/sql-2008-date-and-time-enhancements.aspx</guid>
            <pubDate>Fri, 31 Aug 2007 02:05:02 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60315.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/08/30/sql-2008-date-and-time-enhancements.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60315.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60315.aspx</trackback:ping>
        </item>
        <item>
            <title>More on GROUP BY; Examining SUM(Distinct) </title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/07/31/60274.aspx</link>
            <description>I've written a two part article on using SQL GROUP BY clauses over at &lt;a target="_blank" href="http://www.sqlteam.com"&gt;SQLTeam.com&lt;/a&gt;.  It's always a common topic of discussion and confusion amongst beginner and intermediate SQL programmers alike, so I thought I'd write a fairly long and hopefully comprehensive piece that takes a common summary report request and works towards the solution step-by-step.&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://www.sqlteam.com/article/how-to-use-group-by-in-sql-server"&gt;Part I:&lt;/a&gt;  Intro to GROUP BY; Duplicates caused by JOINS; Identifying "Virtual Primary Keys"; Using COUNT(Distinct)&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://www.sqlteam.com/article/how-to-use-group-by-with-distinct-aggregates-and-derived-tables"&gt;Part II:&lt;/a&gt;  Examining SUM(Distinct); GROUPING before JOINING; Using Derived Tables&lt;br /&gt;
    &lt;/li&gt;
&lt;/ul&gt;
I tried to focus on what happens when you join two tables and then try to group and aggregate the results, and where and how to do this to avoid aggregating duplicate values.   As always, I attempt to demonstrate breaking down the larger problem into smaller, simpler parts and then putting those pieces together to produce the final result.&lt;br /&gt;
&lt;br /&gt;
Perhaps most importantly: if you've ever used &lt;span style="font-style: italic;"&gt;SUM(Distinct) &lt;/span&gt;in your code in an attempt to handle duplicates, be sure to read Part II.  As &lt;a target="_blank" href="http://en.wikipedia.org/wiki/Inigo_Montoya"&gt;Inigo Montoya&lt;/a&gt; would say: &lt;span style="font-style: italic;"&gt;I do not think it means what you think it means!&lt;/span&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60274.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/07/31/60274.aspx</guid>
            <pubDate>Tue, 31 Jul 2007 16:44:49 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60274.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/07/31/60274.aspx#feedback</comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60274.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60274.aspx</trackback:ping>
        </item>
        <item>
            <title>Using LINQ with SQL (link)</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/07/13/60256.aspx</link>
            <description>There's a great series of posts over at &lt;a href="http://weblogs.asp.net/scottgu/default.aspx" target="_blank"&gt;Scott Guthrie's Blog&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt; covering &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx" target="_blank"&gt;LINQ&lt;/a&gt;, a new feature in the upcoming version of Visual Studio ("Orcas"). Check it out; I have not had a chance to play around with it yet, but it certainly looks very interesting.  The articles are very well done and explain the concept very clearly with lots of examples.&lt;br /&gt;
&lt;br /&gt;
From the article:&lt;br /&gt;
&lt;br /&gt;
&lt;p style="margin-left: 40px; font-style: italic;"&gt;&lt;font size="2" face="arial"&gt;The above language features help make &lt;em&gt;querying data &lt;/em&gt;a first class programming concept.  We call this overall querying programming model "LINQ" - which stands for &lt;em&gt;.NET Language Integrated Query&lt;/em&gt;.  &lt;/font&gt;&lt;/p&gt;
&lt;p style="margin-left: 40px; font-style: italic;"&gt;&lt;font size="2" face="arial"&gt;Developers can use LINQ with any data source.  They can express efficient query behavior in their programming language of choice, optionally transform/shape data query results into whatever format they want, and then easily manipulate the results.  LINQ-enabled languages can provide full type-safety and compile-time checking of query expressions, and development tools can provide full intellisense, debugging, and rich refactoring support when writing LINQ code. &lt;/font&gt;&lt;/p&gt;
Link: &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx"&gt;Using LINQ to SQL (Part 1)&lt;/a&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60256.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/07/13/60256.aspx</guid>
            <pubDate>Fri, 13 Jul 2007 20:27:44 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60256.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/07/13/60256.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60256.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60256.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL 2005 PIVOT Operator (link)</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/07/12/60253.aspx</link>
            <description>There's two interesting posts over at the &lt;a target="_blank" href="http://blogs.msdn.com"&gt;MSDN blogs&lt;/a&gt; from &lt;a href="http://blogs.msdn.com/craigfr/"&gt;Craig Freedman&lt;/a&gt; about the new PIVOT operator in SQL 2005.  First, he gives a nice &lt;a href="http://blogs.msdn.com/craigfr/archive/2007/07/03/the-pivot-operator.aspx" target="_blank"&gt;overview&lt;/a&gt; of the operator and how to use it, and then he follows it up with a &lt;a href="http://blogs.msdn.com/craigfr/archive/2007/07/09/pivot-query-plans.aspx" target="_blank"&gt;performance analysis&lt;/a&gt; as well.  A good read, check it out.  &lt;br /&gt;
&lt;br /&gt;
I hope to cover both the PIVOT and also the UNPIVOT operators a little myself at some point in a future post.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;see also:&lt;br /&gt;
&lt;/span&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2003/10/24/363.aspx" title="View Entry"&gt;Keep those SQL Crosstabs flexible!&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2005/05/11/5101.aspx" title="View Entry"&gt;.NET CrossTabs: Transforming a Normalized DataReader into a Pivoted DataTable&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2005/05/12/5127.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl04_HyperLink1"&gt;.NET CrossTabs versus SQL Server CrossTabs&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2005/05/15/5175.aspx" title="View Entry"&gt;ASP and ADO Pivots -- Old School CrossTabs&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/04/20/60182.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl02_HyperLink1"&gt;Sorting Columns with the C# Pivot Function&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;
&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60253.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/07/12/60253.aspx</guid>
            <pubDate>Thu, 12 Jul 2007 13:24:38 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60253.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/07/12/60253.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60253.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60253.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL Server 2005: CROSS APPLY</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/06/12/60228.aspx</link>
            <description>&lt;p&gt;If you are using SQL 2005 and find User Defined Functions helpful, be sure to read my new article over at &lt;a href="http://sqlteam.com" target="_blank"&gt;SQLTeam&lt;/a&gt;: &lt;/p&gt;
&lt;p style="margin-left: 40px; font-style: italic; font-weight: bold;"&gt;&lt;a href="http://www.sqlteam.com/article/returning-complex-data-from-user-defined-functions-with-cross-apply" target="_blank"&gt;Returning Complex Data from User-Defined Functions with CROSS APPLY&lt;/a&gt;&lt;/p&gt;
&lt;p style="margin-left: 40px; font-style: italic;"&gt;SQL Server User-Defined Functions (UDFs) can return either a single value or virtual tables. However, sometimes we might like for a User-Defined Function to simply return more than 1 piece of information, but an entire table is more than what we need. For example, suppose we want a function that parses a single VARCHAR() containing a street address and returns: &lt;/p&gt;
&lt;ul style="margin-left: 40px; font-style: italic;"&gt;
    &lt;li&gt;Street Number &lt;/li&gt;
    &lt;li&gt;Street Name &lt;/li&gt;
    &lt;li&gt;Unit Number&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="margin-left: 40px; font-style: italic;"&gt;In other words, it would accept "100 Main St #44" and return 3 distinct, separate values:&lt;/p&gt;
&lt;ul style="margin-left: 40px; font-style: italic;"&gt;
    &lt;li&gt;Street Number: "100" &lt;/li&gt;
    &lt;li&gt;Street Name: "Main St" &lt;/li&gt;
    &lt;li&gt;Unit Number: "#44"&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="margin-left: 40px;"&gt;&lt;span style="font-style: italic;"&gt;As you can see, each value would have its own label and also potentially its own data type. Other examples would be a function that accepts an email address and returns the username and the domain separately, or a function that accepts a full name and parses it into separate First, Middle and Last values. In general, if a single function call can return multiple pieces of information all at once, it reduces the number of function calls you need to make, resulting in shorter code and allowing you to put more complex business logic into fewer functions.&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt; &lt;a href="http://www.sqlteam.com/article/returning-complex-data-from-user-defined-functions-with-cross-apply" target="_blank"&gt;Article link.&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
Stay tuned for more posts soon on CROSS APPLY and OUTER APPLY -- they are very useful features and can be really helpful if you need to transform or clean up denormalized (or just plain messy!) data using User Defined Functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;see also:&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/06/12/60228.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl04_HyperLink1"&gt;SQL Server 2005: CROSS APPLY&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/10/18/sql-server-cross-apply.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl02_HyperLink1"&gt;Taking a look at CROSS APPLY&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/05/21/60211.aspx" title="View Entry"&gt;SQL Server 2005: Specifying Partitions for Aggregate Functions&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/05/02/60194.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl06_HyperLink1"&gt;SQL Server 2005: Using EXCEPT and INTERSECT to compare tables&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/04/27/SQL-2005-Regular-Expression-Replace.aspx" title="View Entry"&gt;Regular Expression Replace in SQL 2005  (via the CLR)&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/03/30/More-SQL-Server-2005-Solutions.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl08_HyperLink1"&gt;More with SQL Server 2005 : Top n Per Group, Paging, and Common Table Expressions&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2007/03/28/60146.aspx" title="View Entry"&gt;SQL Server 2005: Using PARTITION and RANK in your criteria&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href="../../../../jeffs/archive/2006/04/27/9713.aspx" title="View Entry" id="ctl00_pageContent_Editor_Results_rprSelectionList_ctl10_HyperLink1"&gt;Lots of great SQL Server 2005 Express Downloads&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60228.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/06/12/60228.aspx</guid>
            <pubDate>Tue, 12 Jun 2007 12:52:16 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60228.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/06/12/60228.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60228.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60228.aspx</trackback:ping>
        </item>
        <item>
            <title>Slightly more dynamic ORDER BY in SQL Server 2005</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/06/05/60224.aspx</link>
            <description>There's a very interesting way of handling &lt;a href="http://john-sheehan.com/blog/index.php/slightly-more-dynamic-order-by-in-sql-server-2005/" target="_blank"&gt;complicated, multi-column dynamic sorts&lt;/a&gt; over at &lt;a href="http://john-sheehan.com/blog/" target="_blank"&gt;john-sheenan.com&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I am not sure about the efficiency of this approach, but in general dynamic sorting tends not to be very efficient anyway (unless you use dynamically-created SQL statements).  Overall, it is a very clever use of RANK() and definitely worth a look.&lt;br /&gt;
&lt;br /&gt;
Thanks for the great idea, John!&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60224.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/06/05/60224.aspx</guid>
            <pubDate>Tue, 05 Jun 2007 14:24:56 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60224.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/06/05/60224.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60224.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60224.aspx</trackback:ping>
        </item>
        <item>
            <title>Using SQLBulkCopy to copy any .NET Object  to a SQL Server Table</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/05/22/sqlbulkcopy-any-dotnet-object.aspx</link>
            <description>In my &lt;a href="http://www.sqlteam.com/item.asp?ItemID=26941"&gt;SQLBulkCopy article&lt;/a&gt;, I mentioned that you can quickly copy data from anything that implements IDataReader to a SQL Server table using SQLBulkCopy (new in .NET 2.0).  In this &lt;a href="http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=83181"&gt;SQLTeam forum post&lt;/a&gt;, &lt;a href="http://www.elsasoft.org/"&gt;Jesse Hersch&lt;/a&gt; (jezemine) tells us that SQLBulkCopy only actually uses 3 methods of the interface.  This means that it is very easy to quickly create your own custom class which implements this interface to bulk copy pretty much any type of object collection or array to a SQL Server table.  He even provides code for a simple abstract  SqlBulkCopyReader class that you can inherit from to implement only the necessary parts of the interface.&lt;br /&gt;
&lt;br /&gt;
So, if you need to persist large amounts of data from your .net applications directly to SQL Server, and that data is not stored in DataTables, be sure to consider this option.  Thanks, Jesse !&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60214.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/05/22/sqlbulkcopy-any-dotnet-object.aspx</guid>
            <pubDate>Tue, 22 May 2007 18:40:10 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60214.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/05/22/sqlbulkcopy-any-dotnet-object.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60214.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60214.aspx</trackback:ping>
        </item>
        <item>
            <title>SQL Server 2005: Specifying Partitions for Aggregate Functions</title>
            <link>http://weblogs.sqlteam.com/jeffs/archive/2007/05/21/60211.aspx</link>
            <description>Did you know that a new feature in SQL Server 2005 allows you to specify an OVER partition for aggregate functions in your SELECT statements?  
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://weblogs.sqlteam.com/jeffs/archive/2007/05/21/60211.aspx"&gt;read more...&lt;/a&gt;&lt;img src="http://weblogs.sqlteam.com/jeffs/aggbug/60211.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Jeff Smith</dc:creator>
            <guid>http://weblogs.sqlteam.com/jeffs/archive/2007/05/21/60211.aspx</guid>
            <pubDate>Mon, 21 May 2007 18:52:05 GMT</pubDate>
            <wfw:comment>http://weblogs.sqlteam.com/jeffs/comments/60211.aspx</wfw:comment>
            <comments>http://weblogs.sqlteam.com/jeffs/archive/2007/05/21/60211.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://weblogs.sqlteam.com/jeffs/comments/commentRss/60211.aspx</wfw:commentRss>
            <trackback:ping>http://weblogs.sqlteam.com/jeffs/services/trackbacks/60211.aspx</trackback:ping>
        </item>
    </channel>
</rss>