I thought that must be obvious but I can't figure it out.
Say there is a table tblData
with a column ID
and a table-valued-function (_tvf
) that takes an ID
as parameter. I need the results for all ID's in tblData
.
But:
SELECT * FROM tblData data
INNER JOIN dbo._tvf(data.ID) AS tvfData
ON data.ID = tvfData.ID
gives me an error: The multi-part identifier "data.ID" could not be bound
What is the correct way to pass all ID's to this TVF and concat the results?
Thanks