Consider as follow,1. Below is my running no tabledeclare @SysRunno table(Pref varchar(10), ryear char(4), rmoth char(2), runn int);/*ryear and rmonth is unique*/insert into @SysRunno values('TR','2010','05',1);insert into @SysRunno values('TR','2010','06',11);2. Now, i'm capable to built resultset as follow,declare @tInfo table(tid varchar(30), ddate datetime, rid varchar(30), posi tinyint);insert into @tInfo values('TR100600000012','2010-06-30 00:00:00','_R100400000001','1');insert into @tInfo values('TR100600000013','2010-06-30 00:00:00','_R100600000001','1');insert into @tInfo values('TR100700000001','2010-07-01 00:00:00','_R100400000001','1');insert into @tInfo values('TR100700000002','2010-07-01 00:00:00','_R100600000001','1');/*1. you'll see, my TID is generated based on @SysRunno2. TID format is TR<year(DDate)><month(DDate)><8 digit>*/My question is,1. How can i update/insert TID in resultset into @SysRunno?2. So, another proses to built the TID will clean from duplication of TID