是否可以将SQL Server 2008 CROSS APPLY与LINQ-2-SQL一起使用?

示例SQL:

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

CROSS APPLY允许使用表中的值(示例中的dateTable)作为tablevalue函数的参数。如果您需要对一系列输入执行复杂计算(封装在表值函数中),这非常有用。

有帮助吗?

解决方案

使用它的唯一方法是将上面的代码包装在一个存储过程中,并用LINQ to SQL包装它。

其他提示

试试这个:

from d in dateTable
from tvf in tvFunction(d.dt, 'anotherProgram')
where d.category = 'someCat'
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top