• sql事务处理回滚及保留点transaction,ROLLBACK


     1BEGIN TRANSACTION
     2INSERT INTO Customers(cust_id,cust_name)
     3VALUES('100000010','Toys_Emporium');
     4SAVE TRANSACTION  StartOrder;
     5INSERT INTO Orders(order_num,order_date,cust_id)
     6VALUES(20100,'2001/12/1','100000010');
     7IF @@ERROR <> 0 ROLLBACK TRANSACTION StartOrder;
     8INSERT INTO OrderItems(order_num,order_item,prod_id,quantity,item_price)
     9VALUES(20010,1,'BR01',100,5.49);
    10if @@ERROR <> 0 ROLLBACK TRANSACTION StartOrder;
    11INSERT INTO OrderItems(order_num,order_item,prod_id,quantity,item_price)
    12VALUES(20010,2,'BR03',100,10.49);
    13IF @@ERROR <> 0 ROLLBACK TRANSACTION StartOrder;
    14COMMIT TRANSACTION
  • 相关阅读:
    k8s蓝绿
    nginx总结
    promethues监控 之 TCP连接数
    制作私有ssl证书
    redis命令
    zabbix主机自动发现
    Kubernetes各组件服务重启
    linxu下常用命令
    encodeURIComponent
    查询条件
  • 原文地址:https://www.cnblogs.com/zwl12549/p/867489.html
Copyright © 2020-2023  润新知