In my project EF calls a stored procedure which is shown below. It returns either 1 or scope identity.
On EF function imports, the stored procedure is listed with a return type of decimal.
When the stored procedure returns scope identity, everything is ok.
But when if condition of sp satisfies, ef throws error as
The data reader returned by the store data provider does not have enough columns for the query requested.
Pls help..
This is my stored procedure:
@VendorId int,
@ueeareaCode varchar(3),
@TuPrfxNo varchar(3),
@jeeSfxNo varchar(4),
@Tjode varchar(3),
@uxNo varchar(3),
@TyufxNo varchar(4),
@Iyuy bit
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
SET NOCOUNT ON;
IF EXISTS (Select dfen_id
from dbo.efe_phfedwn_eflwn
where
[yu] = @Tyuode and
[uy] = @TuyxNo and
[yuno] = @Tuo)
return 1
ELSE
Begin
INSERT INTO dbo.yu
....................
Select Scope_Identity()
End
END