Cross Apply and Outer Apply Operators

Elevate your SQL game (a little bit) with Cross Apply and Outer Apply. SQL Server 2005 came out with the Cross Apply and Outer Apply operators.

Introduction



Part of my self-imposed job has always been to learn and adopt new technologies. As part of that process, I share what I learn by writing about it. The amount of information and content that is produced each year is much, much than anyone person can master, so I choose. Generally, I focus on OO technologies and languages, UML, design patterns, refactoring, and SQL. As a general rule, these areas have worked out pretty well for me. Unfortunately, the trade offs are that I may never master Ruby or really understand the difference between Ruby and Ruby on Rails. I am at peace with this decision.

That said, even though my personal focus is pretty much OO, I still miss stuff. SQL Server 2005 came out with the CROSS APPLY and OUTER APPLY operators and I have just started learning how to use APPLY in the last month or so. When I think I have it figured out, I am fortunate enough that some of you are interested in reading about my understanding of the technology.

From the MSDN help "the APPLY operator allows you to invoke a table-valued function for each row returned by an outer table expression of a query. The table-valued function acts as the right input and the outer table acts as the left input." Hunh?! Technically, I understand table-valued function, left and right input, but this explanation doesn't really tell me about why I need this or when it's needed. The help documentation doesn't tell me what to do with APPLY. So, this article represents me processing and compartmentalizing APPLY, which will help me know when it should be pulled out of my toolbox and used.

Read the Rest of this Article at Developer.com

Related Article
- What Is a Database Administrator?
There is a lot more to being a DBA than just being responsible for the data!
Regional Articles
- Cross Apply and Outer Apply Operators Alabama
- Cross Apply and Outer Apply Operators Alaska
- Cross Apply and Outer Apply Operators Arizona
- Cross Apply and Outer Apply Operators Arkansas
- Cross Apply and Outer Apply Operators California
- Cross Apply and Outer Apply Operators Colorado
- Cross Apply and Outer Apply Operators Connecticut
- Cross Apply and Outer Apply Operators DC
- Cross Apply and Outer Apply Operators Delaware
- Cross Apply and Outer Apply Operators Florida
- Cross Apply and Outer Apply Operators Georgia
- Cross Apply and Outer Apply Operators Hawaii
- Cross Apply and Outer Apply Operators Idaho
- Cross Apply and Outer Apply Operators Illinois
- Cross Apply and Outer Apply Operators Indiana
- Cross Apply and Outer Apply Operators Iowa
- Cross Apply and Outer Apply Operators Kansas
- Cross Apply and Outer Apply Operators Kentucky
- Cross Apply and Outer Apply Operators Louisiana
- Cross Apply and Outer Apply Operators Maine
- Cross Apply and Outer Apply Operators Maryland
- Cross Apply and Outer Apply Operators Massachusetts
- Cross Apply and Outer Apply Operators Michigan
- Cross Apply and Outer Apply Operators Minnesota
- Cross Apply and Outer Apply Operators Mississippi
- Cross Apply and Outer Apply Operators Missouri
- Cross Apply and Outer Apply Operators Montana
- Cross Apply and Outer Apply Operators Nebraska
- Cross Apply and Outer Apply Operators Nevada
- Cross Apply and Outer Apply Operators New Hampshire
- Cross Apply and Outer Apply Operators New Jersey
- Cross Apply and Outer Apply Operators New Mexico
- Cross Apply and Outer Apply Operators New York
- Cross Apply and Outer Apply Operators North Carolina
- Cross Apply and Outer Apply Operators North Dakota
- Cross Apply and Outer Apply Operators Ohio
- Cross Apply and Outer Apply Operators Oklahoma
- Cross Apply and Outer Apply Operators Oregon
- Cross Apply and Outer Apply Operators Pennsylvania
- Cross Apply and Outer Apply Operators Rhode Island
- Cross Apply and Outer Apply Operators South Carolina
- Cross Apply and Outer Apply Operators South Dakota
- Cross Apply and Outer Apply Operators Tennessee
- Cross Apply and Outer Apply Operators Texas
- Cross Apply and Outer Apply Operators Utah
- Cross Apply and Outer Apply Operators Vermont
- Cross Apply and Outer Apply Operators Virginia
- Cross Apply and Outer Apply Operators Washington
- Cross Apply and Outer Apply Operators West Virginia
- Cross Apply and Outer Apply Operators Wisconsin
- Cross Apply and Outer Apply Operators Wyoming
Related Article
- What Is a Database Administrator?
There is a lot more to being a DBA than just being responsible for the data!

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML