cross apply

  • where do we use cross apply ?

    please expline about cross apply with simple example

  • Did you consider BOL (BokksOnLine, the SQL Server help file) as a source?

    Please see chapter "cross apply" for details. There is an example as well.

    Even though the example shows the usage of a function, a query can also be used instead.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • A CROSS APPLY will be applied against each row in the table/view it is joined to. For example this query returns a row for each record in sys.sysprocesses. It includes the result of the sys.dm_exec_sql_text DMF for each of those rows, passing in the sql_handle from SSP for the parameter:

    SELECT SSP.*, DEST.text

    FROM sys.sysprocesses SSP CROSS APPLY sys.dm_exec_sql_text(SSP.sql_handle) DEST

    Help?

    - Tim Ford, SQL Server MVPhttp://www.sqlcruise.comhttp://www.thesqlagentman.com http://www.linkedin.com/in/timothyford

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply