;WITH a AS(
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) as RowNumber, SortOrder
FROM tblProductType
WHERE StoreId = 1001
)
UPDATE a SET SortOrder = RowNumber
;WITH a AS(
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) as RowNumber, SortOrder
FROM tblProductType
WHERE StoreId = 1001
)
UPDATE a SET SortOrder = RowNumber
Comments