Stored procedure returns int instead of result set
I got the same problem, and found solution here
- Move to your .edmx
- At Model Browser Window/Function Imports find your procedure then double click it
- Change the return type to you want
- Save .edmx and check the return type again.
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.