• Sean Lange (1/7/2014)


    I am guessing that what you really want is all the rows from the function and values from the table if there is a match?

    This is where you can turn your join around to a right join.

    select *

    From mytable a

    RIGHT JOIN dbo.udf_Myfunction(a.col1) udf on udf.col = a.col1

    Hey Sean,

    The parameter from the udf is a column from the table (I guess you didn't notice), so he would need to use APPLY. Even if a JOIN would be possible, RIGHT JOIN would make no sense as it shouldn't return any values not present on the table.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2