开发者社区 问答 正文

问大家关于一个多表更新的事务问题

if not exists(select top 1 * from uSignin where uid='{0}' and cid='{1}' and DATEDIFF(MINUTE,sdate,getdate())=0) begin insert into uSignin(uid,cid,sdate,sremark,stype) values('{0}','{1}',getdate(),'','{3}'); update [contract] set lastcount=lastcount-1 where cid={1}; update [dUser] set point=point+2 where uid={0}; insert into pointlog(uid,rinfo,getpoint) values('{0}','{2}','10') end

我有多条sql语句,在程序中合并成了一条去执行,这样还需要用事务吗?

展开
收起
laozamao 2022-02-06 13:06:44 522 分享 版权
1 条回答
写回答
取消 提交回答
  • 今天也要加油吖~

    可以不用。

    2022-05-18 19:53:43
    赞同 展开评论
问答地址: