Roundup of T-SQL Tuesday #17 – APPLY Knowledge
Here’s our T-SQL Tuesday #17 Roundup! A big thank you to all participants. An even bigger thank you to Adam Machanic, first for allowing me to host this month, and second for providing perfect T-SQL topic fodder. Keep up the good work everyone, and please enjoy all our contibuters! (in order of when they hit my blog)
- Brad Schulz ( Blog ) has been a fan of APPLY since the beginning and shows the 3% usage cases that aren’t outlined in most books, including executing subqueries, shredding XML, calling new columns, performing calculations and much more. It’s a monster of a post!
- Robert Davis ( Blog | @SQLSoldier ) wrote on how he used APPLY when parsing deadlock information from trace files.
- Luke Hayler ( Blog | @LukeHayler ) avoids the common digs and shares a few ways to APPLY common sense and yourself to you work.
- Rob Farley ( Blog | @Rob_Farley ) shares his indepth knowledge of T-SQL by showing that, not only is the FROM clause unnecessary, but APPLY can be used instead of UNPIVOT. Rob wrote a second post because he’s awesome. In his two-fer, he simply shows how APPLY is a powerful way to do a JOIN.
- Amit Banerjee ( Blog | @banerjeeamit ) wrote about using APPLY when performance troubleshooting with DMVs, which is how I first used it as well.
- Pinal Dave ( Blog | @pinaldave ) also wrote on the usefulness of using APPLY with DMVs.
- Noel McKinney ( Blog | @NoelMcKinney ) wrote a little on formatting standards and mentioned that APPLY is useful to be able to consider in new projects.
- Bradley Ball ( Blog | @SQLBalls ) wrote a little on both performance and non-performance related APPLY usage.
- Ricardo Leka ( Blog | @bigleka ) shared a script to grab SQL text and query plans.
- Jim McLeod ( Blog ) shows that SQL Server can sometimes allow APPLY in Compatibility 80 mode.
- Bob Pusateri ( Blog | @SQLBob ) shared a small script that can help with delimiting a list of values.
- Robert Matthew Cook ( Blog | @sqlmashup ) shared a long list of reasons why you might consider using a UDF rather than writing code inline.
- Mike Fal ( Blog | @Mike_Fal ) also shared a DMV script.
- Jason Brimhall ( Blog | @sqlrnnr ) shared a slick script to find role membership of logins at the server level.
- Robert Pearl ( Blog | @PearlKnows ) contibuted a script that grabs the query text running on each CPU..
- Josh Feierman ( Blog | @awanderingmind ) shows how he troubleshoots performance issues in the query cache before the trouble gets too bad.
- Thomas Rushton ( Blog | @ThomasRushton ) shares a DMV script for grabbing queries that are causing locking issues.
- Carlos Bossy ( Blog ) shows how APPLY can elegantly replace layers of subqueries when querying for that “right” answer.
- Jason Strate ( Blog | @stratesql ) rewrites a query mutliple times to show when APPLY may come in handy rather than a SELECT subquery or a CTE.
- Joe Casella ( Blog ) shows how to list Primary Keys/Unique Constraints and Foreign Keys using APPLY and XML.
- Steve Jones ( Blog | @way0utwest ) shares how APPLY was a saving addition to SQL Server 2005, especially in querying DMVs for information that wasn’t easily available in SQL 7/2000.

Hey, Matt… somehow you left me out… I posted between Carlos and Jason.
–Brad
Sorry about that, Brad, I did miss your phenomenal post. I’ve included you right on top of the list.
Pingback: @mvelic closes T-SQL Tuesday #17 Roundup – APPLY Knowledge #tsql2sday | sqlmashup
Pingback: T-SQL Tuesday #18 – My CTE « Voice of the DBA
Pingback: Invitation to T-SQL Tuesday #17 - APPLY Knowledge | Matt Velic
Pingback: Wait: You’re still Here? | Matt Velic
Not sure if my comment got submitted the first time. I have two blogs on this topic
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/parsing-the-address-field-to-its-individ
and
http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/parsing-fullname-field-to-individual
Thanks, Naomi. Normally T-SQL Tuesday is timed for a specific 24 hour period, but those are some good blog posts you wrote!
Pingback: SQLSaturday #80 - Wheeling, West Virginia! - Robert Pearl's Blog
Pingback: T-SQL Tuesday Topics – Febuary 2012 « Voice of the DBA
Pingback: T-SQL Tuesday Topics – December 2012 Update « Voice of the DBA