Stored procedure returns int instead of result set

I got the same problem, and found solution here

  1. Move to your .edmx
  2. At Model Browser Window/Function Imports find your procedure then double click it
  3. Change the return type to you want
  4. Save .edmx and check the return type again.

Screenshot

It should be what you need now.


I get this when I have a stored procedure that includes an "exec" call into a temporary table, such as:

insert into #codes (Code, ActionCodes, Description)
exec TreatmentCodes_sps 0

It appears that Entity Framework gets confused as to what should be returned by the procedure. The solution I've come across is to add this at the top of the sproc:

SET FMTONLY OFF

After this, all is well.