Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing duplicate records
Message
From
14/04/1999 09:59:42
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Removing duplicate records
Miscellaneous
Thread ID:
00208167
Message ID:
00208167
Views:
66
Hello:
I'm trying to write a program to remove duplicate records from my
database table. I need to remove the index first, scan for duplicates, delete all and then recall the first record of each duplicate and then add the regular index back. CAn I do this
without having to resetting the relationships up in the database?

THis is my rough code. Any help would be appreciated.

close all
set defa to \wincats\data

use act_plan
delete tag sincase of act_plan


set order to sin
go top
dsin = sin
dadddate = add_date
daddtime = add_time

Scan
locate for sin = dsin, add_date = dadddate, add_time = daddtime
Do while found()
delete
go top
recall
pack
Endscan

ALTER TABLE Act_plan ADD PRIMARY KEY Sin + Caseno TAG Sincase
Next
Reply
Map
View

Click here to load this message in the networking platform