Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Data Cleanup
Message
De
25/01/2012 10:18:42
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Scripting
Titre:
Divers
Thread ID:
01533668
Message ID:
01533687
Vues:
27
>>I've got one for the SQL people.
>>
>>I've got a database in SQL Server with a table called Providers with prv_PK the primary key. There is another table called ClaimItems that stores the Provider Key in its cit_prvFK field.
>>
>>The data was imported from a spreadsheet, so you know there are lots of spelling mistakes so the same provider might have ended up in the Providers table twice (or more) if there was a slight misspelling.
>>
>>So for example I have these as separate Providers:
>>
>>Superpharm
>>Superpharm Limited
>>Superpharm Limted
>>
>>and these:
>>
>>Tropical Pharmacy
>>Tropical Pharmcay
>>
>>Now, I need to clean up the data which means switching the cit_prvfk value to the prv_pk value of the Provider I want to keep and then deleting the other providers.
>>
>>This list of duplicates has about 100 providers. I can do this one by one, but it'll take ages. How would you suggest approaching this?
>
>You may try identifying duplicates by using SOUNDEX function. However, it may give you false positives, so you need to review the list it finds.

Thanks, but identifying them is not the problem. I was just looking for a quick way to fix them and Sergey's answer got my brain working, Although I did have to manually build the table using copy and paste so it still took some time.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform