Home > database >  Turn to a table field content updates to another table content problem
Turn to a table field content updates to another table content problem

Time:11-08

Essentially a database

The update Basic_Agencies set Basic_Agencies. AgencyType=A.A gencyType_new FROM Basic_Agencies,
(SELECT SUBSTRING (SlaveRelationName, 1, CHARINDEX (' - 'SlaveRelationName) - 1) as AgencyType_new, Basic_Agencies_Relation. MasterCode
The FROM Basic_Agencies_Relation, Basic_Agencies
WHERE Basic_Agencies. Code=Basic_Agencies_Relation. MasterCode) as A WHERE clause Basic_Agencies. Code=arjun asterCode

Above is the update statement only 1532 is modified

The actual
Select count (*) from Basic_Agencies, Basic_Agencies_Relation where Basic_Agencies. Code=Basic_Agencies_Relation. MasterCode
There are more than thirty thousand data need to modify the


Why want to ask next UPDATE statement didn't UPDATE more than thirty thousand, but only have updated the article 1532, such as only updated Basic_Agencies. The Code to a after the heavy, such as Basic_Agencies. Code=100, 1000 in the actual UPDATE only 1000 a
Basic_Agencies. Code: Basic_Agencies_Relation. MasterCode is 1 to many

CodePudding user response:

Since is a one-to-many relationship, that is more than thirty thousand data set, after more than a pair of records, but the actual Basic_Agencies meet the condition is more than 1000 records,
  • Related