I have a Gridview in front end where Grid have two columns : ID and Order like this:
ID Order
1 1
2 2
3 3
4
You can use charindex like
DECLARE @id VARCHAR(MAX)
DECLARE @order VARCHAR(MAX)
SET @id='1,2,3,4,'
SET @order='2,4,1,3,'
WHILE CHARINDEX(',',@id) > 0
BEGIN
DECLARE @tmpid VARCHAR(50)
SET @tmpid=SUBSTRING(@id,1,(charindex(',',@id)-1))
DECLARE @tmporder VARCHAR(50)
SET @tmporder=SUBSTRING(@order,1,(charindex(',',@order)-1))
UPDATE dbo.Test SET
[Order]=@tmporder
WHERE ID=convert(int,@tmpid)
SET @id = SUBSTRING(@id,charindex(',',@id)+1,len(@id))
SET @order=SUBSTRING(@order,charindex(',',@order)+1,len(@order))
END