0

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].

  1. create temp table
  2. query table using dedupe logic
  3. import query results into new temp table
  4. drop original [or delete contents?]
  5. recreate original[or repopulate?] import data from temp
  6. 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

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
d90
  • 767
  • 2
  • 10
  • 28

0 Answers0