Something like this will work, though may not be practical depending on the size of transac_Sample table
SELECT count(S_Id) as COUNTA, S_Id, Effective_Start_Date, Inserted_Date, Updated_date
into #tmp
FROM transac_Sample
GROUP BY S_Id, Effective_Start_Date, Inserted_Date, Updated_date
HAVING count(S_Id) >1
select S_Id,Effective_Start_Date, Inserted_Date,Updated_date,
row_number()over(partition by S_Id order by Effective_Start_Date desc) as rn from
transac_Sample
where Deleted_Indicator <> 'Y' --
and S_Id in (SELECT S_Id from #tmp)
)