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

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.

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: Logo

You are commenting using your 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


Get every new post delivered to your Inbox.

Join 63 other followers