title: Calling an in-line TVF with named parameters, what is the proper syntax?
body: <p>I tried calling an in-line TVF with positional parameters and it works fine:</p>
  <pre><code>SELECT MyTable.Col1,
         (SELECT TvfColumn FROM ufnGetData(MyTable.Col1, MyTable.Col2)),
         MyTable.Col2
  FROM MyTable
  </code></pre>
  <p>Then I tried to name the parameters to the TVF and it does not parse:</p>
  <pre><code>SELECT MyTable.Col1,
         (SELECT TvfColumn FROM ufnGetData(@Param1=MyTable.Col1, @Param2=MyTable.Col2)),
         MyTable.Col2
  FROM MyTable
  </code></pre>
  <p>The function looks something like:</p>
  <pre><code>CREATE FUNCTION dbo.ufnGetData
  (   
      @Param1 INT,
      @Param2 INT
  )
  RETURNS TABLE 
  AS
  RETURN 
  (
  SELECT 
         blah blah blah AS TvfColumn
  )
  GO
  </code></pre>
  <p>Giving an error similar to:</p>
  <blockquote>
  <p>Msg 137, Level 15, State 2, Line 23 Must declare the scalar variable
  &quot;@Param2&quot;.</p>
  <p>Msg 102, Level 15, State 1, Line 24 Incorrect syntax near ','.</p>
  </blockquote>
  <p>What am I doing wrong?</p>