Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot delete or change duplicate rows in table

Status
Not open for further replies.

elallred

IS-IT--Management
Jul 10, 2001
4
US
I have a sql server table (PAF6) with about 10 duplicate rows out of 940. (This table has 540 columns -- although I do not think this relevant). I can delete or modify the data in every row except these 10. I get the error message "key column information is insufficient or incorrect. Too many rows affected by update".

There no fields designated a key fields in the table and there are no dependencies that I can find.

I have made a copy of the table under another name and still have the same problem.

Can anyone help?

Thanks


 
Exactly, you have no key information. Therefore say you have row A with the exact same data as Row B. Well when you highlight ROw A (or slect it with a query) SQL cannot make any distinction to know you want to delete Row A and NOT Row B.

Workaround - Add an autoincrement identity field to the table, this will provide Key information, delete your Dups, and then remove the identity field (or keep it if you expect this to happen every now and then).

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top