title: Functions vs Stored Procedures
body: <p>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?</p>
  
  <p>In short, what I want to know is: </p>
  
  <p><strong>Which are the main differences between functions and stored procedures?</strong> What considerations do I have to take into account for using one or the other?</p>