日期:2014-05-18 浏览次数:20577 次
SELECT IDENTITY (int, 1005, 1) AS ID, nh, swh, wh, zrz, tm, rq, ztc, dah, zj_id, mj, swrq, files, bz, ys, pt INTO #temp WHERE nh = '2008' [color=#FF0000]---这句要写在下面的那个from语句下面[/color] FROM wj1 DELETE FROM wj1 WHERE ID = '9999' SELECT * INTO wj1 FROM #temp SELECT * FROM wj1 --------------------试试下面的------------------------- SELECT IDENTITY (int, 1005, 1) AS ID, nh, swh, wh, zrz, tm, rq, ztc, dah, zj_id, mj, swrq, files, bz, ys, pt INTO #temp FROM wj1 WHERE nh = '2008' DELETE FROM wj1 WHERE ID = '9999' SELECT * INTO wj1 FROM #temp SELECT * FROM wj1
------解决方案--------------------
是这样吗
declare @t table(id int ) insert into @t select 1 insert into @t select 2 insert into @t select 3 insert into @t select 2008 insert into @t select 2009 insert into @t select 2010 insert into @t select 2011 declare @i int set @i =3 update @t set id = @i ,@i=@i+1 where id>2007 select * from @t ----------- 1 2 3 4 5 6 7 (7 row(s) affected)