tags:

views:

148

answers:

1

Hello,

i have a table valued function that does a complex query and returns a table (UDF1), and then I have another table that has a bunch of rows that can be used to reduce the output from this UDF

Is it possible to join these two and pass columns from the table as arguments to the UDF ?

like

SELECT * FROM UDF1(TBL1.Column1, TBL1.Column2) INNER JOIN TBL1 ON ( TBL1.Column3 = UDF1.Col3)

many thanks

+3  A: 

You need to use the CROSS APPLY syntax here.

For reasonable performance, the UDF should be an inline one rather than a multistatement one if at all possible.

mwigdahl