有一基础数据表,在DBGrideh做成的界面中维护,有多个角色维护多个字段,我现在的做法是每个角色更改一个字段后将整条记录追加到另外的表中,便于查询什么角色,什么时间更改的,但这样只能查到更改的是哪条记录,无法查到更改的是哪个字段,请问在这方面有没有什么更好的方法?

解决方案 »

  1.   

    我想你应该可以知道DBGrideh正在编辑的列,也应该可以获得该列对应的字段,这些DBGrideh的属性应该提供的
      

  2.   

    sql7,触发器怎么用法,能说的详细点吗,可以加分。
      

  3.   

    可用触发器解決(或用日誌性記錄表)create table tb_a([id] int identity(1,1), a1 varchar(10))
    go 
    insert tb_a 
    select 'a'
    union  
    select 'b'
    --try 
    create trigger t_a on tb_a 
    after insert
    as 
      if (select count(*) from tb_a where a1 in (select a1 from inserted))>1 
    begin 
    delete from tb_a where [id] in (select min([id]) from tb_a where a1 in (select a1 from inserted))
    end 
      

  4.   

    CSDN搜搜create table tb_a([id] int identity(1,1), a1 varchar(10))
    go 
    insert tb_a 
    select 'a'
    union  
    select 'b'
    --try 
    create trigger t_a on tb_a 
    after insert
    as 
      if (select count(*) from tb_a where a1 in (select a1 from inserted))>1 
    begin 
    delete from tb_a where [id] in (select min([id]) from tb_a where a1 in (select a1 from inserted))
    end 
      

  5.   

    sql server 7
    是支持触发器的,具体用法可直接参考自带的样例
    其实楼上已经贴出来一些了