Question: what is the difference between table valued and multi statement function?
Answer: An inline table valued function definition specifies only RETURNS TABLE and not the table definition. The entire query batch or code or select query inside the function is a single RETURN statement. Multi-statement table valued function definition specifies RETURNS along with the definition of TABLE VARIABLE.