November 25, 2013 at 5:20 am
I want to know when you have different types of joins available in which scenario cross or outer apply is useful then the joins in sql 2008.how it is better then joins.
November 25, 2013 at 5:33 am
They aren't better or worse than joins, but they are different. Paul White has a good article posted at http://www.sqlservercentral.com/articles/APPLY/69953/ and part 2 is at http://www.sqlservercentral.com/articles/APPLY/69954/.
November 25, 2013 at 6:34 am
Ed Wagner (11/25/2013)
They aren't better or worse than joins, but they are different. Paul White has a good article posted at http://www.sqlservercentral.com/articles/APPLY/69953/ and part 2 is at http://www.sqlservercentral.com/articles/APPLY/69954/.
To supplement those very fine articles, there was a talk on APPLY at SQLBits --> Why APPLY? - Christina E. Leo: Download link "http://sqlbits.com/Sessions/Event11/Why_APPLY_3"
November 28, 2013 at 5:43 pm
You can also combine CROSS APPLY with Table Row Constructors to do cool things like an UNPIVOT.
Refer to the first article in my signature links for more information.
My thought question: Have you ever been told that your query runs too fast?
My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.
Need to UNPIVOT? Why not CROSS APPLY VALUES instead?[/url]
Since random numbers are too important to be left to chance, let's generate some![/url]
Learn to understand recursive CTEs by example.[/url]
[url url=http://www.sqlservercentral.com/articles/St
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply