Update associate other tables to Update data in batches-Cross-database-Cross-Server update

Source: Internet
Author: User
1. Sometimes there will be some initial data updates during the project, from the old system to the new system. If the application is cyclically paid from the old system to the new system. 2. The following method may be used when a synchronization program is required in a project or when a large amount of data is updated automatically. 3. for analysis, you need to integrate some data into a table, which involves associating with the primary key.

1. Sometimes there will be some initial data updates during the project, from the old system to the new system. If the application is cyclically paid from the old system to the new system. 2. The following method may be used when a synchronization program is required in a project or when a large amount of data is updated automatically. 3. for analysis, you need to integrate some data into a table, which involves associating with the primary key.

1. Sometimes there will be some initial data updates during the project, from the old system to the new system. If the application is cyclically paid from the old system to the new system.

2. The following method may be used when a synchronization program is required in a project or when a large amount of data is updated automatically.

3. for analysis, we need to integrate some data into a table, which involves associating multiple tables with the primary key to obtain the values of some of the fields. We can simply implement it through update. I found an article, pretty good:

When updating tables in batches, when updating columns in a table, you must depend on another table. This dependency can be a where Condition Clause or the field value to be updated depends on another table.
There are usually two methods
1. Use stored procedures
2. Execute them one by one in the program code
3. There is a more efficient and concise way to update SQL statements in batches. One SQL statement can replace the troublesome cycle process, which can be written in MS SQLServer, Oracle, and DB2.

UPDATE kcm02 SET kcjhcb = V_U8_Inventory.iInvRCost, kccbhs = 1_v_u8_inventory WHERE V_U8_Inventory.cInvCode = kcm02.kcwpdm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.