Sql server 将参数传递给顶级CTE的内联函数

Sql server 将参数传递给顶级CTE的内联函数,sql-server,sql-server-2008-r2,common-table-expression,Sql Server,Sql Server 2008 R2,Common Table Expression,我需要将参数传递给顶级CTE的内联函数。有可能吗 这是我需要的东西 with a ( select * from table1 ), b as ( select * from ( select * from inline_function(a.parameter1) ) as c ) 您可能想为CTEa返回的每一行调用函数一次 要做到这一点,你应该使用 with a ( select * from dbo.table1 ), b as ( se

我需要将参数传递给顶级CTE的内联函数。有可能吗

这是我需要的东西

with a
(
 select * from table1
),
b as
(
   select * from
   (
      select * from inline_function(a.parameter1)
   )
   as c
)

您可能想为CTE
a
返回的每一行调用函数一次

要做到这一点,你应该使用

with a
(
  select *
  from dbo.table1
),
b as
(
  select c.*
  from a
    cross apply dbo.inline_function(a.parameter1) as c
)