Sunday, March 11, 2012

Cant delete records from DB .. says : Too many rows were affected by update.

Hi,

I've added multiple records with same info during practice. Now I"m trying to delete those records from SQL Server DB. but it says

"Key column information is insufficient or incorrect. To many rows were affected by update."

What to do, to delete these records?

Appreciated..if you post the code we can help you out but the error message you're getting means you're trying to update a row that has a duplicate. So, if your table had a primary key, you couldn't have a duplicate row and wouldn't have a problem.

hth|||Add a new column to your table and give each record a unique value for the column. Quickest way to do this is to add an Indentity column to the table (SQL Server will add the unique values). Delete the records you don't want and then you can remove the Indentity column if you want.

No comments:

Post a Comment