Hey everyone. Complicated reason why we're wanting this, so I won't go there... I leave it at there are Hardware servers with some VMs on them, each therefore having the same Serial Number.
Basically, I have a field (Serial Number) that contains some duplicate values. I want to delete the duplicate values but keep all records, leaving the value intact only for the first record it occurs in.
I'm planning to automate this in VBA so I can do it in a series of SQL operations, use temporary tables whatever. Any ideas on the most efficient way?
I'm thinking of selecting the Primary Key (Hardware ID) along with the serial number into a new table with primary key set on Serial Number to eliminate duplicate records. Then run another query to delete Serial Number from the original table if it's Hardware ID doesn't exist in the second table.
Sound right? Can anyone think of a better way?
Thanks,
David
Basically, I have a field (Serial Number) that contains some duplicate values. I want to delete the duplicate values but keep all records, leaving the value intact only for the first record it occurs in.
I'm planning to automate this in VBA so I can do it in a series of SQL operations, use temporary tables whatever. Any ideas on the most efficient way?
I'm thinking of selecting the Primary Key (Hardware ID) along with the serial number into a new table with primary key set on Serial Number to eliminate duplicate records. Then run another query to delete Serial Number from the original table if it's Hardware ID doesn't exist in the second table.
Sound right? Can anyone think of a better way?
Thanks,
David