Updated or deleted row value either can not make the line a single row or multiple rows changed, how to solve

Often encountered when operating the database "has been updated, or deleted row value either can not make the line a single row or multiple rows changed, as follows:

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Analysis: prompt is not the only row is deleted, then checked again and found that:

 

The database appear in the duplicate key values ​​or data, when you try to delete, an error message appears.

Solution:
Method One: Add a primary key value of the row to be the only value,

SQL statement: ALTER TABLE table name
add ID int identity primary key (Note: You must add identity, otherwise it will fail to add)

Or by DBMS graphical interface to add, click on the small key under the map, according to the instructions step by step:

 

 

 

 

 

 

 

 


Method two: simple and crude. DBMS comes through Query Analyzer, a new query directly to delete, fast and simple. as follows:

Deleted successfully, you will be prompted a few lines affected.
----------------
Disclaimer: This article is the original article CSDN bloggers, "Hu was the root", and follow CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source and link this statement.
Original link: https: //blog.csdn.net/fightfaith/article/details/47067951

Guess you like

Origin www.cnblogs.com/net-sky/p/11714991.html