作业调度DTS追加数据,可是碰到一个问题,假设A有2000条数据追加到B.那么B也同样有了2000条数据.如果再次执行的时候,B就变成4000条.也就是说,追加的数据重复了,我想把A最近添加进去的新数据追加到B,不想把之前已经追加过的数据重复追加.十分后可以达到追加数据的时候进行判断,如果有重复的数据就不进行追加,只把最新的数据追加进去!
分数只有这么点了.不好意思!

解决方案 »

  1.   

    DTS没用过.没经历过那个年代.我直接上SSIS的.
      

  2.   

    1. 如果B的数据能清空,就清空直接用DTS导入咯
    2. 如果B不能清空,可以建立个linked server,然后insert .... select ... from A.table where a.table.data not in B.table.data;
    3. DTS导的时候可以用SQL 导入的,你可以试下
      

  3.   

    SSIS 2005+以后可以实现.用LOOKUP组件,非存在的INSERT,
    DTS没有用过,如果不能更改。楼上是个好主意!
      

  4.   

    将tab1插入tab2:@p1是列,也就是判读有无重复值的:
    begin tran
    declare  @p1 varchar(10)declare tmp cursor scroll for
    select  列1  from tab1 
    open tmp 
    fetch first from tmp into @p1
    while @@fetch_status=0
    begin
    if exists(select * from tab2 where 列2=@p1) 
    begin
    fetch next from tmp into @p1
    end
    else
    begin
    insert 句子
    fetch next from tmp into @p1
    end
    end
    大概就是这样。
    不好意意思现在才回,不知道来得及不?