应为你有两条一模一样的记录,这是由你的表没有主键引起的。
删除重复的,只留一条:alter table 表 add newfield int identity(1,1)delete 表
where newfield not in(
select min(newfield) from 表 group by 除newfield外的所有字段
)alter table 表 drop column newfield
删除重复的,只留一条:alter table 表 add newfield int identity(1,1)delete 表
where newfield not in(
select min(newfield) from 表 group by 除newfield外的所有字段
)alter table 表 drop column newfield
企业管理器--右键你的表--设计表--增加字段--字段的类型设置为int--字段属性中,将标识设置为"是"
--或用SQL语句
alter table 表 add id int identity(1,1)--或创建表的时候直接加上:
create table 表(id int identity(1,1),其他字段)