Let's say I have to implement a piece of T-SQL code that must return a table as result. I can implement a table-valued function or else a stored procedure that returns a set of rows. What should I use?
In short, what I want to know is:
Which are the main differences between functions and stored procedures? What considerations do I have to take into account for using one or the other?
See Question&Answers more detail:os