格式化批量更新编号

update [dbo].[Supplier] set SysCode=b.SysCode from (select 'GYS'+right(1000000+ROW_NUMBER() over(order by id),6) SysCode,ID from [dbo].[Supplier])b
where [dbo].[Supplier].ID=b.ID

posted @ 2017-12-14 16:16  xjt360  阅读(147)  评论(0编辑  收藏  举报