---------------------------------------------------------------------------SQL事务BEGIN TRANSACTIONdeclare @MaxDelete int = 0 ; --最大可删除的行数 ---------------------------------------------------------------------------执行的SQL语句DELETE TableName Where FieldName = ''---------------------------------------------------------------------------判断影响的行数,超过限定就回滚if (@@rowcount > @MaxDelete ) begin print '删除行数过多,已经回滚' rollback transaction endelse begin print '操作成功' commit transaction end-------------------------------------------------------------------------