SQL query to update serial number of consecutive values

I am looking for the support to find the sequence number based on the employee, effective date and the order which the data received in the file.
Same employee, effective date combination can come any row. same serial number needs to allocate for the consecutive rows. And the serial number should be continuous

create table hrcmn_emp_full_table
(
employee_code           varchar(Max),
movement_code           varchar(Max),
effective_date          varchar(10),
filename                varchar(Max),
file_sequence           int identity(1,1),
process_sequence        int,
effective_date_sequence int,
final_process_sequence  int,`
MyGroup int
)

insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('1001','NEWHR','2020-02-01','XXX.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('1001','NEWHR','2020-01-01','XXX.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('1001','NEWHR','2020-01-01','XXX.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('1001','NEWHR','2020-02-01','XXX.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('1001','NEWHR','2020-01-01','XXX.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2001','NEWHR','2020-02-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2001','NEWHR','2020-01-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2001','NEWHR','2020-01-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2001','NEWHR','2020-02-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2002','NEWHR','2020-02-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('2001','NEWHR','2020-01-01','YYY.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('3001','NEWHR','2020-01-01','ZZZ.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('3001','NEWHR','2020-02-01','ZZZ.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('3002','NEWHR','2020-02-01','ZZZ.txt')
insert into hrcmn_emp_full_table(employee_code,movement_code,effective_date,filename) values ('3001','NEWHR','2020-02-01','ZZZ.txt')

;with processnum as (select filename,[file_sequence],[employee_code],[effective_date],
     ROW_NUMBER() OVER (partition BY filename,[employee_code] ORDER BY [file_sequence],[effective_date]) as processnum      
     from hrcmn_emp_full_table with (nolock))  
      
 update tmp  
 set    process_sequence            = num.processnum
 from   hrcmn_emp_full_table tmp,
        processnum num
 where  tmp.filename        = num.filename
 and    tmp.[file_sequence]         = num.[file_sequence]
 and    tmp.[employee_code] = num.[employee_code]
 and    tmp.[effective_date]        = num.[effective_date]
 and    tmp.process_sequence is null


 ;with processnum as (select filename,employee_code,file_sequence,a.[movement_code],[effective_date],
     dense_rank() OVER (ORDER BY [effective_date],a.movement_code) as rank_function_mov
     from hrcmn_emp_full_table a with (nolock))
   
 update tmp  
 set    effective_date_sequence     = num.rank_function_mov
 from   hrcmn_emp_full_table tmp,
        processnum num
 where  tmp.filename        = num.filename
 and    tmp.[movement_code]         = num.[movement_code] 
 and    tmp.[effective_date]        = num.[effective_date]
 and    tmp.employee_code           = num.employee_code
 and    tmp.file_sequence           = num.file_sequence
 and    tmp.effective_date_sequence is null

  
DECLARE @MyGroup INT
    SET @MyGroup = 0
DECLARE @LastProcess_Sequence DECIMAL(6,2)
    SET @LastProcess_Sequence = -1
    
    --updating consecutive group
    UPDATE a
    SET @MyGroup = MyGroup = CASE
                               WHEN a.Process_Sequence = @LastProcess_Sequence + 1
                               THEN @MyGroup
                               ELSE @MyGroup+1
                             END,
        @LastProcess_Sequence = a.Process_Sequence
   FROM hrcmn_emp_full_table a,
        ( SELECT DISTINCT t1.filename,t1.file_sequence,
        t1.Effective_date_sequence,t1.Process_Sequence
        FROM hrcmn_emp_full_table t1,
        hrcmn_emp_full_table t2
        WHERE (t1.Process_Sequence+1 = t2.Process_Sequence)
        AND t1.Effective_date_sequence   = t2.Effective_date_sequence
        AND t1.filename = t2.filename
        UNION 
        SELECT DISTINCT t1.filename,t1.file_sequence,
        t1.Effective_date_sequence,t1.Process_Sequence
        FROM hrcmn_emp_full_table t1,
        hrcmn_emp_full_table t2
        WHERE (t1.Process_Sequence-1 = t2.Process_Sequence)
        AND t1.Effective_date_sequence   = t2.Effective_date_sequence
        AND t1.filename = t2.filename) w
  where a.file_sequence = w.file_sequence
   and a.Effective_date_sequence = w.Effective_date_sequence
   and a.Process_Sequence = w.Process_Sequence
   AND a.filename = w.filename


 update a
 set final_process_sequence = T.final
 from hrcmn_emp_full_table a , 
             (select min(process_sequence) 'final',effective_date_sequence,filename
             from hrcmn_emp_full_table
             where MyGroup is null
             group by effective_date_sequence,filename) T
 where a.effective_date_sequence = T.effective_date_sequence
 and a.filename = T.filename
 and a.MyGroup is null


 update a
 set    final_process_sequence = T.final
 from   hrcmn_emp_full_table a , 
     (select min(process_sequence) 'final',effective_date_sequence,MyGroup,filename
     from   hrcmn_emp_full_table with (nolock)
      where MyGroup is not null
     group by effective_date_sequence,MyGroup,filename) T
 where a.effective_date_sequence = T.effective_date_sequence
 and a.MyGroup is not null
 and a.MyGroup = T.MyGroup
 and a.filename = T.filename

I am getting the below output,
enter image description here

However, expecting the below output.
enter image description here

Could anyone support in this?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật