• Lynn Pettis - Thursday, February 8, 2018 4:51 PM

    You should look at using a stored procedure instead of a function as you are going to need to use dynamic SQL to accomplish this task.  You can't use dynamic SQL in a function.

    If I am not mistaken this won’t allow me to get a result in a table styled object like a function will it?

    I think I need a function/view so it can be joined against/selected from. Without it being in that format the developers tooling will not accept the data