Hi friends i've a function that takes a parameter as input and returns a table if i call my function like below it works as expected
select * from dbo.myfunc(1) my question is can this input be SQL ? i mean i tried following but getting error "Incorrect syntax near the keyword 'select'."
select * from dbo.myfunc(select id from sometable) any ideas on this one please? Thanks
Michael actually we've a generic function that returns a table.i needed same functionality in a SQL am writing and thought i could use this function instead of duplicating same code. looks like i need to create a view here.
Could you concatenate all the ID values as a comma delimited list, and then pass that as a parameter to your function (and then have it split the list and JOIN that to whatever it is doing with the IDs)?