第一部分、SQL Server基础-事务
1.6 事务
1.6.1 事务的原子性
事务是关系数据库的核心概念,必须对事务的ACID(原子性、一致性、隔离性、持续性)属性透彻理解,才能在实际应用中正确的使用事务,事务的原子性是事务最基本的特征,也是事务一致性的保证,下面就事务的原子性举例说明。
1、首先建立两个表,t_Bank和t_Card,分别表示银行存款和信用卡金额,在表中分别插入一条数据,SQL语句如下所示:
create table t_Bank ( BankId int identity primary key, Balance int ) create table t_Card ( CardId int identity primary key, Balance int ) insert t_Bank values(100000) insert t_Card values(10000)

浙公网安备 33010602011771号