数据库表大概都在2000w行以上,最大不超过3亿条,我想给他们每张表加个时间戳(timestamp),有没有效率高的方法。就一张表来说。

解决方案 »

  1.   

    显示数据时先取出timestamp到变量更新,删除操作时先比较变量和现在的timestamp, 一样则操作 转成byte[] 我就知道该怎么读
      

  2.   

    alter table tb add col2 timestamp
      

  3.   

    直接创建:
         创建一个表的时间戳。     create table InsertComputer
        (
         ComputerID int,
         ComputerName varchar(20),
         Optimist timestamp
        )      相表里表插入数据,会自动生成时间戳。你可以用SQL文查询一下     select Optimist from InsertComputer     这时对表进行更新操作     update InsertComputer set ComputerID = 10
         where ComputerID = 1
      

  4.   

    alter table tb add 字段名 timestamp
    --直接加
      

  5.   


    顶了呀~~~~小F的。。这个我收藏了。。希望对LZ也很有帮助