Not sure if this is what you mean.create table #yak ([Name] varchar(10), [action] varchar(10), batch varchar(2), refnum int, seq int, refcol int)insert into #yak ([Name],[action],batch,refnum,seq,refcol)values ('C','Y','01',1,12,3) ,('A','Y','06',2,3,2) ,('A','X','01',1,55,1) ,('A','X','03',1,0,1)select * from #yak update yset seq = x.Seq from #yak yINNER JOIN (select Name,action,batch,refnum,refcol ,ROW_NUMBER()over(order by Name,action,batch,refnum,refcol ) as Seq from #yak ) xON y.Name = x.Name AND y.action = x.actionAND y.batch = x.batchAND y.refcol = x.refcolAND y.refnum = x.refnum select * from #yak order by seq drop table #yakhttp://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp