Hi , i am invoking it through the SQLCMD command
sqlcmd -S [MyserverName] -E -Q "DECLARE @return_value INT; EXEC @return_value = [My Stored Proc]; SELECT 'Return Code' = @return_value;"
This is the output from Automic:

-------------------------------------------
Original Message:
Sent: Aug 14, 2025 11:12 AM
From: Daryl Brown
Subject: Require help for Automic automation
How are you invoking the stored proc, exactly? Are you sure you're capturing the return code properly?
You may find this link helpful: https://stackoverflow.com/questions/4158796/how-do-i-capture-a-returned-value-from-a-stored-procedure-using-windows-command
Original Message:
Sent: Aug 14, 2025 04:29 AM
From: Chua Ricky
Subject: Require help for Automic automation
Hi , i need some help please.
I am running a stored procedure from my server and executing it via Automic. Basically this stored procedure checks for certain validations and it will return 1 if there is error and 0 if it is successful.
However, when i trigger it in Automic, it is always showing success in Automic. Is there a way i can programme it to be ENDED_NOT_OK if the stored procedure returns 1?

-------------------------------------------