views:

488

answers:

1

Is it possible to use SQL Server 2008 CROSS APPLY with LINQ-2-SQL?

Example SQL:

select d.dateCol, tvf.descr, tvf.value
from dateTable d
cross apply tvFunction(d.dt, 'anotherParam') tvf
where d.category='someCat'

CROSS APPLY enables using values from a table (dateTable in the example) as parameters to a tablevalue function. This is very usefull if you need do do a complex calculation (encapsulated in a table value function) for a range of inputs.

+5  A: 

The only way to use it would be to wrap the above code in a stored procedure and wrap it with LINQ to SQL.

[)amien

DamienG
Of course that is a way to do it, or resort to a DbDataReader (which is what I did)
vzczc