Reputation: 1
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?
Upvotes: 0
Views: 79
Reputation: 2013
See this answer
Get return value from stored procedure
You can achieve this using an output parameter
Upvotes: 1