title: TSQL Error: A RETURN statement with a return value cannot be used in this context
body: <p>I am just trying to create a function that returns a select statement, but it gives the error:</p>
  
  <blockquote>
    <p>A RETURN statement with a return value cannot be used in this context.</p>
  </blockquote>
  
  <p>This is my code:</p>
  
  <pre><code>CREATE FUNCTION [dbo].[Sample] (@SampleValue int)
  RETURNS TABLE
  AS
  BEGIN
  RETURN(
   SELECT * FROM View_sls
  )
  </code></pre>
  
  <p>Please let me know the solution</p>