I'm looking to dedupe a table using a stored procedure. There is no 1 column that is unique, so I'd have to combine 2 or more columns to get a unique identifier. ID column is identity int, but is generated by sql automatically at the time data is imported. I need to somehow combine 2 or more columns excluding ID column to get a unique identifier so I can strip out anything that's duplicated.
From there I figured it would make the most sense to do the following [correct me if my approach is wrong].
- create temp table
- query table using dedupe logic
- import query results into new temp table
- drop original [or delete contents?]
- recreate original[or repopulate?] import data from temp
- drop temp table
I have the following columns. I think sessionid+callflow is unique.
sessionid, legid, dialednumber, callerid, calldatetime, dayofweek, hourofday, end_type, callduration, callorder, callflow, ID, [pk] origin