title: Error SQL Server 2012: Parameters were not supplied for the function X
body: <p>I have defined a table-valued function <code>X</code> with 11 parameters. Their types are <code>nvarchar(30)</code>, <code>nvarchar(30)</code>, <code>datetime</code>, <code>datetime</code>, <code>nvarchar(15)</code>, <code>nvarchar(4)</code>, <code>xml</code>, <code>nvarchar(8)</code>, <code>nvarchar(80)</code>, <code>bit</code>, and <code>bit</code> respectively. This is for Microsoft SQL Server 2012. When I call the function with </p>
  
  <pre><code>select * from 
  X('A','B','2014-01-01','2014-12-31',null,null,'&lt;C&gt;&lt;D&gt;E&lt;/D&gt;&lt;/C&gt;',null,null,1,0)
  </code></pre>
  
  <p>I run into this error:</p>
  
  <pre><code>Parameters were not supplied for the function X
  </code></pre>
  
  <p>It is apparently different from the following two:</p>
  
  <pre><code>An insufficient number of arguments were supplied for the procedure or function X
  Procedure or function X has too many arguments specified.
  </code></pre>
  
  <p>Is this related to two of the intended parameter values being <code>null</code>? How can I overcome the problem and define/call a table-valued function such as this one with 11 parameters, some of which may carry <code>null</code>?</p>
  
  <p><strong>UPDATE</strong> The problem remains if I pass in arbitrary strings instead of <code>null</code>. So there must be another (perhaps stupid) mistake.</p>