|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Renaming Duplicate Row Data To Be Unique?
I just converted an old non-relational database into something that MS SQL likes. The old primary keys were broken up into two columns, one being useful. The column I need to use has some rows with the same values in them.
I am looking for some way in a SQL script to look for the duplicate rows and add "_X" to the data where X is a value incremented by 1 for each duplicate row found. For example, 3 duplicate rows with "5443aa" would return "5443aa", "5443aa_1","5443aa_2". Any ideas? --MartinZ |
|
#2
|
||||
|
||||
|
this would be extremely difficult to do in sql
why not write an application program to read the sorted table and do the update? |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Renaming Duplicate Row Data To Be Unique? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|