View Single Post
  #1   IP: 117.95.89.4
Old 2010-07-03, 06:36 PM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default 用sql语句更改自动编号的字段重新重'1'开始编号

tableName(id,clcode,cloth) id字段为identity(int,1,1) 重建id
select * into #aa from tableName
truncate table tableName
dbcc checkident(tableName,reseed,0)
set IDENTITY_INSERT ON
insert tableName(clcode,clname) select clcode,clname from #aa
//注意不能选择id列
drop table #aa
Reply With Quote