Is it possible to Resort the steps column int value by update queries based on activityId(unique column), which is part of workflow activities, these steps order are read identified based on modid and modtype: ActivityID is unique primary key column:Declare @Sample table (ActivityID int, step int, ModId int, ModType Varchar(2))insert @Sampleselect 125, 1, 143, 'BP' union allselect 144, 2, 143, 'BP' union allselect 152, 3, 143, 'BP' union allselect 161, 4, 143, 'BP' union allselect 177, 6, 143, 'BP' union allselect 181, 6, 143, 'BP' union allselect 191, 7, 143, 'BP'
Result should be these 7 activity rows sorting the step int value for all activities:there could be multiple steps with same step number like two activites above with step 6 should become 5. resorting of numbering of steps using update query. 125 1 143 'BP' 144 2 143 'BP' 152 3 143 'BP' 161 4 143 'BP' 177 5 143 'BP'181 5 143 'BP'191 6 143 'BP'
Thank you very much for the helpful info.