Apr 292011

This month marks the 18th installment of T-SQL Tuesday. T-SQL Tuesday was started in December 2009 by Adam Machanic (blog | @AdamMachanic) and is defined as “a recurring, revolving blog party”. Any blogger wishing to participate is invited to write about the given topic, chosen by whoever is hosting that particular month. I’m very pleased to be hosting this time around for the T-SQL Tuesday taking place on May 10, 2011!

The Topic

This month’s topic is CTEs, or Common Table Expressions. Had you asked me 10 years ago what CTE meant, I would have replied “coefficient of thermal expansion” but that was back in my semiconductor & electronic materials phase. I like the database version much better :)

Have you ever solved or created a problem by using CTEs? Got a tip, trick, or something nifty to share? I’d love to see your posts about any of the above. Also don’t forget that T-SQL Tuesday is not limited to only T-SQL:

“Any post that is related to both SQL Server and the theme is fair game. So feel free to post about SSIS, SSRS, Java integration, or whatever other technologies you’re working with in conjunction with SQL Server. Even if your post includes no T-SQL we still want to see it.”

The Rules

– Your post must be published between 00:00 GMT Tuesday May 10, 2011, and 00:00 GMT Wednesday May 11, 2011.
– Your post must contain the T-SQL Tuesday logo (see above) and the image must link back to this blog post.
– Trackbacks should work, but if not please put a link to your post in the comments section so everyone can see your contribution!

Bonus Points

– Include “T-SQL Tuesday #18” in your blog post’s title.
– Mention “coefficient of thermal expansion” in your post.
– Tweet about your post and include the #tsql2sday hashtag.
Contact Adam Machanic and tell him you’d like to host!

I’ll be reading through all the posts and publishing a summary shortly thereafter. I can’t wait to see what everyone has to say!

Edit: I originally posted this a little too early and also with incorrect dates. Everything has now been corrected, and my apologies for any confusion.

  40 Responses to “Invitation to T-SQL Tuesday #18 – CTEs”

  1. […] @SQLBob opens Invitation to T-SQL Tuesday #18 – CTEs #tsql2sday Posted on May 2, 2011 by sqlmashup https://www.bobpusateri.com/archive/2011/04/invitation-to-t-sql-tuesday-18-ctes/ […]

  2. […] guard by T-SQL Tuesday most months. This time I caught Bob’s Twitter announcement about #18. The topic this month is CTEs, so you have a week to get things […]

  3. T-SQL Tuesday #18 – CTEs – The permission hierarchy problem – a look at solving a recursive permission definition problem with CTEs – http://www.atlantis-interactive.co.uk/blog/post/2011/05/10/T-SQL-Tuesday-18-CTEs-The-permission-hierarchy-problem.aspx – enjoy!

  4. […] is hosted by Bob Pusateri (@SQLBob). For a bunch more posts on the topic, follow the link to his Invitation Post, and you’ll see a pile of them, all about CTEs. If you’re reading this and it’s still May […]

  5. If the trackback worked properly, you should be able to ignore this comment:

    Thanks for hosting, of course. :)

  6. I have a CTE blog written a while ago
    CTE and hierarchical queries

  7. […] blog post is written in response to the T-SQL Tuesday hosted by Bob Pusateri. He has picked very interesting topic which is related to APPLY clause of the T-SQL. When I read […]

  8. This is great subject – it brought back all the memories when I was beginning with CTE.


  9. Hi Bob,
    Thanks for hosting! Here’s my contribution to T-SQL Tuesday.


  10. […] is true: they’re really just a way to simplify and encapsulate your code. For this month’s TSQL-Tuesday, focused on CTEs, I want to illustrate this difference with an example of how a (non-recursive) CTE […]

  11. […] month’s TSQL-Tuesday topic is so much fun to write about that I’ve decided to create a second […]

  12. Thanks for hosting, Bob! This was so interesting to write about that I posted twice:

    Using a Recursive CTE to Create a Calendar Table

    What a CTE is Not

    (Apologies if this is a duplicate, trackback doesn’t seem to be working)

  13. […] and it’s something I look forward to each month. This month Bob Pusateri hosts the party with the theme of CTEs. No, it’s not thermal unit of expansion, and I hated […]

  14. Here is my submission for TSQL Tuesday #18 – CTEs: http://bit.ly/iyDAP6

  15. […] month’s recurring SQL blog party a.k.a. T-SQL Tuesday started by Adam Machanic (blog | @AdamMachanic) is being hosted by Bob […]

  16. Thanks for the topic. Had been meaning to publish this for a long time. Needed the push :)

  17. […] Edit: This post was originally published on August 26, 2010. This reprint is for T-SQL Tuesday #18! […]

  18. Bob, thanks for hosting! My contribution:

    T-SQL Tuesday #18: A Recursive CTE Is: A Recursive CTE Is http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/MSSQLServer/t-sql-tuesday-18-a

  19. […] another reason for posting this is Bob Pusateri’s request for interesting CTE usages for T-SQL Tuesday. Hopefully he will find this […]

  20. http://www.sqlstash.com/?p=38

    Hi Bob – my post looks at using CTE’s to aggregate data and return the top item within a group. It’s nothing particulary complicated, but is something that using sub queries had terrible performance on large datasets.


  21. […] I read Bob Pusateri invite to this month’s T-SQL Tuesday, it brought me back to my college days where I actually […]

  22. Thanks Bob, here’s mine since the trackback didn’t work:

    The Missing UNGROUP BY Clause (T-SQL Tuesday #18)


  23. bob, thanks for hosting and all your other volunteering in the sql community. you can find my LITTLE contribution here: http://www.sqlmashup.com/t-sql-tuesday-18-ctes-tsql2sday

  24. […] Invitation to T-SQL Tuesday #18 – CTEs […]

  25. Bob, SQLWorld…Apologies for my late entry. (I had my blog ready to go Tuesday 6AM, but faced a myriad of technical difficulties :-{

    My entry is “Using CTE to Analyze Disk IO”

    I figure better late than never. Happy Tuesday, er Wednesday :-O

  26. […] in T-SQL Tuesday #18, hosted this month by Bob Pusateri (Blog|@SQLBob). You are invited to visit his blog to join the blog party. You are welcome to write your own participating blog post for the party or […]

  27. […] Or maybe you weren’t quite happy with the CTE post you came up with when Bob Pusateri hosted.  Or maybe you have a ton to say about IO, but like me, you didn’t know anything about T-SQL […]

  28. […] T-SQL Tuesday #018 –  CTEs (wrapup) […]

  29. […] T-SQL Tuesday #018 – CTEs (wrapup) […]

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>