How to pass parameters to Table Valued Function

R.D picture R.D · Dec 3, 2008 · Viewed 55.8k times · Source

I want to do something like

select * from tvfHello(@param) where @param in (Select ID from Users)

Answer

kristof picture kristof · Dec 3, 2008

You need to use CROSS APPLY to achieve this

select 
    f.* 
from 
    users u
    cross apply dbo.tvfHello(u.ID) f