• ChrisM@Work (7/4/2012)


    dwain.c (7/4/2012)


    I just made the most awesome discovery while using cascading CROSS APPLYs so I thought I'd post it here.

    Did you know that inside the CROSS APPLY if you refer to a name that's ambiguous in the left table, that the CROSS APPLY assumes that it is from the inner table? To use the column from the left table (if ambiguous) you must then qualify it with the table alias.

    That is awesome cool and very handy to make the code concise!

    All right, everybody already knew that so I'll shut up now. :blush: Just had to tell somebody.

    Might be something worth mentioning in your article though Chris.

    Have you got an example, Dwain?

    I think Dwain might be referrring to the issue raised in these links:

    http://www.sqlservercentral.com/Forums/Topic890645-338-1.aspx#bm891174

    http://www.sqlservercentral.com/blogs/dave_ballantynes_blog/2010/03/26/cross-apply-ambiguity/