I have a TVF that takes a userID parameter.
I have another table that contains a list of these userIDs.
I want to pass all these userID values into the TVF.
I have tried this code...
FROM [dbo].[UserData](u.UserID) data
JOIN dbo.Users u ON u.DetailID = data.DetailID
but get the error...
The multi-part identifier "u.UserID" could not be bound.
What am I missing?
FROM dbo.Users AS u CROSS APPLY dbo.UserData(u.UserID) AS data. You cannot referenceu.UserIDbefore joining to the table. – Mark Sinkinson Mar 31 '15 at 09:17