September 18, 2009 at 9:24 am
A glitch in my GUI Interface inserted multiple lines into a warehouse table in my database. is there a script I can run to eliminate the duplicate information? I cannot delete this information because it shows history where there is none.
September 18, 2009 at 10:53 am
There a quite a number of articles and scripts dealing with this issue like:
http://www.sqlservercentral.com/articles/Miscellaneous/findinganddeletingduplicatedata/1075/
or
http://www.sqlservercentral.com/articles/duplicates/65916/
Type 'Duplicate data' in the search field too find the complete list
Francis
September 18, 2009 at 12:03 pm
Add to the above suggestion, I think I just saw one more discussion related to the duplicate entries just today,
http://www.sqlservercentral.com/Forums/Topic790009-338-1.aspx
---------------------------------------------------------------------------------
September 18, 2009 at 12:21 pm
These are all very helpful. However what happened was parts were being removed from a component electronically. Each part was removed once, this will store automatically in the warehouse. The application gives each part 2 unique identifiers (Logno and SSN). Even though the parts were only removed from the component once there are 2, 3, or 4 of these individual parts listed in the warehouse. All of them have been given the 2 unique identifiers. So even though it is duplicate information the database does not see it as being duplicated.
September 18, 2009 at 12:25 pm
Can you provide some test data please?
---------------------------------------------------------------------------------
September 18, 2009 at 12:32 pm
cindy.hutchins (9/18/2009)
These are all very helpful. However what happened was parts were being removed from a component electronically. Each part was removed once, this will store automatically in the warehouse. The application gives each part 2 unique identifiers (Logno and SSN). Even though the parts were only removed from the component once there are 2, 3, or 4 of these individual parts listed in the warehouse. All of them have been given the 2 unique identifiers. So even though it is duplicate information the database does not see it as being duplicated.
oh I see... u mean to say the unique identifiers are different but rest all columns have the same value?
Then you have to do 'groupby' for all the rest of the columns ( or Partition by on the rest of the columns). Let us know if this is the case and if you need some more help. Thanks.
---------------------------------------------------------------------------------
September 18, 2009 at 12:39 pm
PARTNUMBER LOGNO WH LOCATION
047749 485238 12 1
047749 485443 12 1
This part was removed from a component one time but shows in the same location with two different system generated LOGNO's (Unique Identifier)
September 18, 2009 at 12:40 pm
Exactly right
September 18, 2009 at 12:50 pm
cindy.hutchins (9/18/2009)
Exactly right
You got your solution? its very straightforward you should be able to do that. If not just give the table structure.
---------------------------------------------------------------------------------
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply