Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Easy way to clean up table prior to new UNIQUE CONSTRAINT
Fri, Jul 20 2012 8:47 AMPermanent Link

Adam Brett

Orixa Systems

I want to add a unique constraint to a table I am inheriting. The existing table includes duplicates which break the constraint.

I can write SQL to extract the correct data, then save this as a table, then alter the resulting simple table to add constraints, indexes etc. which exist on the existing table ... but that is quite a long process.

Is there an easier way?

Thanks in advance.
Fri, Jul 20 2012 10:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam


There's not really enough information there. At some point you have to dedup the database. If you can come up with SQL to delete the duplicates then apply the unique constraint it should be faster but that's where the information is lacking.

Roy Lambert [Team Elevate]
Image