Page 1 of 1

Duplicate Rows

Posted: Wed Aug 06, 2003 11:37 am
by murad
I have duplicate rows in my table. What would be the best way to remove them?

Duplicate Rows

Posted: Wed Aug 06, 2003 12:03 pm
by mark
sql "delete".

If you want to just remove one and leave the other use tsql -l 1 "delete ..."

Duplicate Rows

Posted: Thu Aug 07, 2003 12:28 pm
by Kai
If there are one or two columns that must never be duplicated across rows, especially a small type like an int, counter or short (<~100 bytes) varchar, you could create a unique index on the column to prevent duplicate insertions in the future.

Duplicate Rows

Posted: Thu Aug 07, 2003 12:38 pm
by murad
Thanks for the help