The conventional wisdom seems to be that you use stored procedure to do something in a database, but when you need to return a dataset that involves procedural logic, then you should use a table value function, and that a stored proc should not be used for returning a dataset.
First of all, would you agree with this convention?
Second, despite this convention, I find that I still tend to use a stored procedure to return a dataset because
(1) A table function does not allow a temp table, only a table variable. Not a major limitation, more of a inconvenience because I can't do things like select * into #table to create tables on the fly.
(2) I haven't dug into this that deeply so this maybe case to case, but I found the time it takes to return the data is slower with table function vs a stored proc. Now this could have been because the kind of dataset I want to return used a lot of temp tables in the stored proc and when I tried to convert that logic to a table function which only allows a table variable, I wasn't able to create indexes on a table variable, making the performance slow.
Do my reasons (1) and (2) make sense and have others found themselves in this situation of reverting to just using a stored proc to return a dataset rather than using a table value function?