title: The data reader has more than one field error while calling a procedure that returns an integer
body: <p>I was trying to get status code of a stored procedure execution when encountered this error:</p>
  
  <blockquote>
    <p>An exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll but was not handled in user code</p>
    
    <p>Additional information: The data reader has more than one field. Multiple fields are not valid for EDM primitive or enumeration types.</p>
  </blockquote>
  
  <p>I have rewritten the procedure to do absolutely nothing but to return an integer value, this is how it looks now:</p>
  
  <pre><code>ALTER Procedure [dbo].[test]
  (
      @i int,
      @a nvarchar(max),
      @b nvarchar(max),
      @c nvarchar(max),
      @d nvarchar(max)
  )
  As
  Begin
      SET NOCOUNT ON
  
      return 1
  End
  </code></pre>
  
  <p>But I still get the same error at run-time when reaching the procedure call at line:</p>
  
  <pre><code>this.Database.SqlQuery&lt;int&gt;("test @i, @a, @b, @c, @d", p_i, p_a, p_b, p_c, p_d).FirstOrDefault();
  </code></pre>
  
  <p>Is there anyway to figure out what these fields are, and where they are coming from? And how should I get the returned value?</p>
  
  <p>I've tried to specify a tuple of two strings as the <code>T</code> just to look into these values, but with no success...</p>
  
  <p><strong>Updates:</strong><br>
  <code>Select 1</code> instead of <code>return 1</code> makes the function usable, the only question remains what are these mysterious fields that are returned to the data reader?</p>