Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

passare il parametro nella funzione con valori di tabella utilizzando l'istruzione select

usa outer/cross apply :

select *
from Employee as E
    cross apply dbo.[StateFixedTaxesCalculation](3020, E.EmployeeId, 1, 1006) as TC

se devi ancora filtrare per TC.EmployeeId = E.EmployeeId , puoi farlo con subquery:

select *
from Employee as E
    cross apply (
        select TT.*
        from dbo.[StateFixedTaxesCalculation](3020, E.EmployeeId, 1, 1006) as TT
        where TT.EmployeeId = E.EmployeeId
    ) as TC