Try Catch SQL

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

BEGIN TRY UPDATE tb_almacen SET esta_alma = 0 WHERE id_tien = @id_tien AND id_prod = @id_prod COMMIT TRANSACTION END

TRY BEGIN CATCH ROLLBACK TRANSACTION END CATCH en el catch pones tus mensajes de error aca ay otro ya implementado COMMIT TRANSACTION END TRY BEGIN CATCH if ERROR_NUMBER()=2627 begin Select 'Error Registro duplicado' end ROLLBACK TRANSACTION END CATCH END asi seria la parte del cathc

You might also like