326
Views
5
Comments
Solved
Duplicate data
Service Studio Version
11.53.6 (Build 60879)

I am having issue in deleting duplicate records I want one record and I want to delete rest of the duplicate data

suppose in my customer entity I have duplicate customers I want to delete it ,  can someone help?

2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello @John Doe 

It is a best practice to use the relevant keys, constrains to eliminate the possibility of duplicate rows however if we have duplicate rows already in the table. We have some methods by which we can delete duplicate records
we have to use advance SQL for this  - 

We use a SQL ROW_NUMBER function, and it adds a unique sequential row number for the row. 

Hope it helps,

There are some others ways as well but I usually follow this way.

Check - https://www.outsystems.com/forums/discussion/53954/how-to-remove-duplicated-records-displayed-on-screen/

Thanks

Tousif Khan

2026-03-12 06-20-48
KUNDAN CHAUHAN
Champion

Hi Duplicate data,

we can use SQL for delete Duplicate data ,

visit link there are many method for this : 

https://www.c-sharpcorner.com/article/5-quick-ways-to-delete-duplicate-records-from-database-which-every-developer-mus/

Let me know if  it was helpful.

Thanks

2021-09-06 15-09-53
Dorine Boudry
 
MVP

Above is only true in the simple situation that these duplicates are not yet used in your system for some purpose !  The real work will lie in first undoing everything that has already been done for these customers, and in identifying which one to keep.

I'm thinking specifically about things like 

  • references from other entities will have to be rewired (maybe several of your duplicate customers have placed an order)
  • Detail information : if each of these customer records have different phone number or delivery address, or banking information, or special discount code, ..., which one will you retain
  • Any customer statistics gathered for marketing : how will you fix/merge that
  • Any customer information already used by other systems (maybe you have sent customer key to external invoicing system, creating an external reference that will need to be fixed)

So, as @Tousif Khan said, your system should avoid getting duplicates in the first place. 

once you have them, I think, in a production setting, more will be involved than simply deleting all records except the one with the lowest id, and part of that will probably be human judgement / intervention.

Dorine

UserImage.jpg
Alinah Hansen

Use the duplicate file fixer tool.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.