Skip to content

Instantly share code, notes, and snippets.

@MarshalOfficial
Created November 23, 2020 14:10
Show Gist options
  • Select an option

  • Save MarshalOfficial/5b901431aa129d9b2c59ef89f3fde673 to your computer and use it in GitHub Desktop.

Select an option

Save MarshalOfficial/5b901431aa129d9b2c59ef89f3fde673 to your computer and use it in GitHub Desktop.
call table value function with base table select statement
--The APPLY operator should do the trick:
SELECT *
from MarketDataMaster
cross apply dbo.fn_MarketDataDetails (MarketDataMasterID)
--This essentially calls the function once per row returned from MarketDataMaster. "cross apply" works like an inner join, in that only rows for which data is returned by the function will be returned; use "outer apply" for functionality similar to left outer joins.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment