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 @Sample
select 125, 1, 143, 'BP' union all
select 144, 2, 143, 'BP' union all
select 152, 3, 143, 'BP' union all
select 161, 4, 143, 'BP' union all
select 177, 6, 143, 'BP' union all
select 181, 6, 143, 'BP' union all
select 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.