I am calling a stored procedure via Entity Framework and returning a string as my output parameter. I am testing the rollback portion of the code and the rollback is occurring, but it is not returning my output parameter to my C# code so I can log it in
my database. Can anyone see where I am making a mistake?
If I execute the stored procedure from SQL server, then I do get the full error message and the rollback.
ALTER PROCEDURE [dbo].[sp_Test]
(
@MessageId as uniqueidentifier,-- Guid of the Message Id
@Output varchar(4000) output -- The Final result
)
AS
BEGIN Try
/* START Begin the Transaction */
Begin Transaction
/* END Begin the Transaction */
DECLARE
@ErrorStep varchar(255)
,@FinalErrorMessage varchar(4000)
/* START - Test Code to cause error */
SELECT 1/0
/* END - Test Code */
/* START - Commit the Transaction sin ...
Go to the complete details ...