--1:利用临时表,删除重复数据
select distinct * into # from 表
delete 表
insert into 表 select * from #
drop table #--2:利用DTS可以是数据过虑后,导入数据库
select distinct * into # from 表
delete 表
insert into 表 select * from #
drop table #--2:利用DTS可以是数据过虑后,导入数据库
怎么过虑啊,因为数据库是在不同的机子上的?
--如:
select * from 表 where id not in
(select id from 服务器.数据库.dbo.表)
select * from 表 where id not in
(select id from 服务器.数据库.dbo.表) .......
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.表) .......
你说反了吧,数据已经导了应该用这个吧?
select distinct * into #1 from 表
delete 表
insert into 表 select * from #1
drop table #1不过谢谢两位了,我去试试!zlp321002(永远泡不到妞):
你真强,人家信誉往下降,你是往上升的,哈哈,厉害!
用DROP时说系统目录中没有那个临时表,所有也就删不了了,我是在企业管理器中处理的!在查询分析器中就可以删除临时表!望告知,THANK YOU!