--更新序号,最大值+1的方式自增
DECLARE @maxvalue INT
SELECT @maxvalue=ISNULL(MAX(SEQUENCE),0) FROM TBL_MMDM WHERE TYPE='Product Category'
UPDATE TBL_MMDM
SET
@maxvalue=@maxvalue+1,
SEQUENCE=@maxvalue
WHERE TYPE='Product Category' AND SEQUENCE IS NULL
转载于:https://www.cnblogs.com/smilekiss/p/4195945.html