I'm using EF 4.3 to execute a stored procedure which just deletes some records and returns 0 when successfull else 1. When i execute the sp (using this.DbContext.Database.ExecuteSqlCommand(sql, id)) i'm getting -1 which is not what i'm expecting.
Can someone tell me what's wrong?
Basically the stored procedure is very simple:
BEGIN TRY
-- Delete records here
END TRY
BEGIN CATCH
IF @@TRANCOUNT > @BeginTranCount
ROLLBACK TRANSACTION
RETURN 1
END CATCH
IF @@TRANCOUNT > @BeginTranCount
COMMIT TRANSACTION
RETURN 0
Also the sp doesn't return value with out variable.