改变*/ Рdeclare @balanceMoney numeric10,2/*账号余额*/ select @balanceMoney select userMoney from users where userId in select userId from card c,inserted i where c.cardId i.cardId update ATMOutIn set balanceMoney @balanceMoney where cardId in select cardId from inserted and atmtime in select atmtime from inserted/*完成了账号金额的修改,再将新的金额插入到信息表中,就是剩余的总余额了注意修改的只是一个账号此次的操作*/РendР--用户银行存取款信息信息表Рcreate table BankOutInРadminId varchar10 not null,/*操作员号码,外键,参照操作员表的adminId*/РcardId varchar20 not null, /*用户卡号,外键,参照用户信息表*/РBankTime DateTime, /*银行存款时间*/РBankCunQu numeric10,2,/*银行存款*/РBankSummary varchar30,РbalanceMoney numeric10,2 default 0, /*经过操作后账号中的金额*/Рforeign key adminId references adminadminId on delete cascade,Рforeign key cardId references cardcardId on delete cascadeР--创建一个触发器,当插入这条数据时会自动修改users表里的金额信息