Duplicate Rows

Post Reply
murad
Posts: 13
Joined: Thu Feb 20, 2003 3:19 pm

Duplicate Rows

Post by murad »

I have duplicate rows in my table. What would be the best way to remove them?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Duplicate Rows

Post by mark »

sql "delete".

If you want to just remove one and leave the other use tsql -l 1 "delete ..."
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

Duplicate Rows

Post 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.
murad
Posts: 13
Joined: Thu Feb 20, 2003 3:19 pm

Duplicate Rows

Post by murad »

Thanks for the help
Post Reply