SQL SERVER把某一列更新为行号

declare @i int
set @i=0
update tb set [ID]=@i,@i=@i+1

 

posted @ 2014-12-30 14:11  tohen  阅读(464)  评论(0编辑  收藏  举报