I'd like to track which procedures are failing in my database using extended events. Procedures are being executed like that from an application:
EXEC sp_executesql 'exec dbo.GetData';
And when that fails, I expect to capture XE event of rpc_completed
with result = 1
(failure) but it comes with result = 0
My procedures look like that:
CREATE PROCEDURE dbo.GetData
BEGIN
SET NOCOUNT ON;
BEGIN TRY
SELECT 1/0 AS DivisionByZero;
END TRY
BEGIN CATCH
EXECUTE dbo.LogError;
THROW;
END CATCH
END
Is there some sort of configuration that needs to happen to track failed rpc_completed
events or I do something wrong?
result=1
which is supposed to mean failure