求一存储过程,用来检索一段时间内对某一表所做更改的次数

解决方案 »

  1.   

    做个LOG表,
    tb_Log
    id,table_id,oper_time,oper_type
    1  userTable 2006-7-1 .. Update
    2  CompInfo  2006-7-1 .. INSERT
    然后用触发器来记录不好吗当要查某段数据时间里对表操作的情况时从这个LOG表里找.
      

  2.   

    替一楼的朋友把话说完:
    建立了tb_Log表后可以这样统计
    select count(*) from tb_Log where table_id = '要统计的表名' and oper_type = '要统计的更新类型' and oper_time between '起始日期' and '截止日期'