If tag write error then rollback sql


I currently run a script where I have and sqlserver Store procedure. this procedure gives me an output parameter. I then use this parameter to set a PLC tag and run a PLC sequence. my question is. is there a way to tied the PLC tags that i’m trying to write to the Store Procedure, meaning that if the SP is a success but then the Tag write fails then rollback everything? like if it was for example multiple SP in one transaction, if one fail then they all rollback together