Reputation: 12498
Why can't I do this?
SELECT
*
FROM
mtFirstTable t LEFT OUTER JOIN
myUDF(t.somesolumn, t.someothercolumn) u
ON t.somecolumn = u.somecolumn AND
t.someothercolumn = u.someothercolumn
I get this error:
The multi-part identifier "t.somecolumn" could not be bound.
The multi-part identifier "t.someothercolumn" could not be bound.
Upvotes: 0
Views: 228
Reputation: 24498
Try this:
SELECT
*
FROM
mtFirstTable t CROSS APPLY
myUDF(t.somesolumn, t.someothercolumn) u
WHERE
t.somecolumn = u.somecolumn AND
t.someothercolumn = u.someothercolumn
I hope you realize that joining a table to a function like this may cause performance problems. The performance may be acceptable though.
Upvotes: 1