【问】自编码为空或为0的,修改为自动生成(当前类别编码+6位自增序号) | ||
【适用版本】专卖店8 | 【模块】基本档案 | 【点击数】124 |
【知识编号】Z2012111900006 | ||
【问题描述】自编码为空或为0的,修改为自动生成的(当前类别编码+6位自增序号) |
use isszmv8 –数据库名
go
alter table t_bd_item_info add id int identity(100000,1)
go
update t_bd_item_info set item_subno=rtrim(ltrim(item_clsno))+convert(varchar(30),id) where item_subno=’0′ or item_subno is null
go
alter table t_bd_item_info drop column id
go