ViewPostSQL: The updated or deleted row values cannot be used to make the row a unique row, or change multiple rows during SQL database maintenance, several lines of records are found to have obvious errors but cannot be deleted. When you execute the DELETE command, the system prompts that the row values that have been updated or deleted are either unable to make the row a unique row, or multiple rows (X rows) are changed ). Shown in: Database
View Post SQL: updated or deleted row values cannot be used to make the row a unique row or change multiple rows during SQL database maintenance, several lines of records are found to have obvious errors but cannot be deleted. When you execute the DELETE command, the system prompts that the row values that have been updated or deleted are either unable to make the row a unique row, or multiple rows (X rows) are changed ). Shown in: Database
View Post
SQL: updated or deleted row values cannot make the row unique or change multiple rows.
During SQL database maintenance, several lines of records are found to have errors but cannot be deleted in the server space, when the DELETE command is executed, the system prompts "the updated or deleted row values cannot make the row a unique row or change multiple rows (X rows )." The error message is displayed when duplicate key values or data appear in the database. The problem is that the created tables do not have keywords. The Hong Kong virtual host is configured with keywords to solve the problem.
Method 1: this problem is mostly caused by no primary key. You can add a primary key column to solve this problem.
1. Add a primary key
Alter table name
Add id int identity primary key (Note: you must add identity; otherwise, adding will fail)
2. Delete duplicate data
You can either manually or use a query statement to search for it and then delete it.
3. Delete the newly added primary key column and reset a column as the primary key in the original table.
Method 2:
Use insert into to perform some small transformations. The specific steps are as follows:
Back up the original table, export the data that meets the conditions to the new table, clear the original table, and select the data in the backup table.
Step 1: import the required data in the backup table
Insert into DataFile_backup
Select * from DataFile where year (consumedate) = Condition
Posted on