Sladescross's Blog

Blogging about Sharepoint related stuff

Cross Apply July 13, 2011

Filed under: Cross Apply,SQL,SQL Cross Apply — sladescross @ 2:26 pm

http://www.sqlteam.com/article/using-cross-apply-in-sql-server-2005

The real magic happens when you use SQL Server 2005′s new APPLY clause. The APPLY clause let’s you join a table to a table-valued-function.

http://weblogs.sqlteam.com/jeffs/archive/2007/10/18/sql-server-cross-apply.aspx

I think the easiest way to think of CROSS APPLY is that it is like doing a CROSS JOIN with a correlated sub-query instead of a derived table. 

CROSS APPLY, despite looking like a JOIN, actually is applying a correlated sub-query. This imposes both the advantages of a correlated sub-query but also the performance implications.

About these ads
 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.

Join 63 other followers