0

I have the following Store Procedure:

CREATE PROCEDURE [SP_DELETE_ASSEMBLY] 
@FullAssemblyName nvarchar(300)
AS 
SET NOCOUNT ON;

IF (@FullAssemblyName IS NULL) OR (LEN(@FullAssemblyName) = 0)
    RETURN -10

IF EXISTS (SELECT 1 FROM [TB_DYNAMICASSEMBLIES] WHERE [FullAssemblyName] = @FullAssemblyName)
BEGIN

    DELETE FROM [TB_DYNAMICASSEMBLIES]
    WHERE [FullAssemblyName] = @FullAssemblyName
END
ELSE
BEGIN
    RETURN -10
END

RETURN 10

GO

I'm using EF 6.1 by using this call to the store procedure:

return entities.SP_DELETE_ASSEMBLY(assemblyName);

However I call the store procedure I always get -1 as return.

What is wrong?

JamieA
  • 1,984
  • 4
  • 27
  • 38

1 Answers1

1

See this answer

Get return value from stored procedure

You can achieve this using an output parameter

Community
  • 1
  • 1
JamieA
  • 1,984
  • 4
  • 27
  • 38