--1:利用临时表,删除重复数据
select distinct * into # from 表
delete 表
insert into 表 select * from #
drop table #--2:利用DTS可以是数据过虑后,导入数据库

解决方案 »

  1.   

    zlp321002(永远泡不到妞):
    怎么过虑啊,因为数据库是在不同的机子上的?
      

  2.   

    用SQL,你写过滤SQL语句啊.
    --如:
    select * from 表 where id not in
    (select id from 服务器.数据库.dbo.表) 
      

  3.   

    insert into 表 
    select * from 表 where id not in
    (select id from 服务器.数据库.dbo.表) .......
      

  4.   

    --如果数据还没开始导则用下面这个
    select distinct * into #1 from 表
    delete 表
    insert into 表 select * from #1
    drop table #1--如果数据已经导好,而现在想过滤掉重复的记录
    --用zlp321002(永远泡不到妞) 的
    insert into 表 
    select * from 表 where id not in
    (select id from 服务器.数据库.dbo.表) .......
      

  5.   

    和尚兄弟:
    你说反了吧,数据已经导了应该用这个吧?
    select distinct * into #1 from 表
    delete 表
    insert into 表 select * from #1
    drop table #1不过谢谢两位了,我去试试!zlp321002(永远泡不到妞):
     你真强,人家信誉往下降,你是往上升的,哈哈,厉害!
      

  6.   

    确实可以除去重复的,不过有点模糊,他临时表建在哪里啊?
    用DROP时说系统目录中没有那个临时表,所有也就删不了了,我是在企业管理器中处理的!在查询分析器中就可以删除临时表!望告知,THANK YOU!
      

  7.   

    现在知道了,临时表建在tempdb数据库中哦!像以上两位说的,在导入数据时是不是只能一个表一个表的导入啊?能有比较快的方法吗?
      

  8.   

    --如果是DTS导的,可以定义多个表,定义多个字段,很方便.....