Today, the business unit gave me a demand. A local Excel table needs to be imported into SQL Server, and SQL Server T1 adds three columns of fields, which by default are null and no data. Update these columns of data from the locally imported Excel table T2 table to the original table T1.
The import method is now recorded to facilitate future use:
1. Import the Excel table into SQL Server. Slightly
2. View data content
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/85/A6/wKioL1erBLDQN8kZAAEjdQYmB8A253.png-wh_500x0-wm_3 -wmp_4-s_3964836194.png "title=" Table 1.png "alt=" Wkiol1erbldqn8kzaaejdqymb8a253.png-wh_50 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/85/A7/wKiom1erBMuyCjdBAADKw5L62sU878.png-wh_500x0-wm_3 -wmp_4-s_653058174.png "title=" table 2.png "alt=" Wkiom1erbmuycjdbaadkw5l62su878.png-wh_50 "/>
3. Updating data
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/85/A7/wKiom1erBOqAdrvBAAE1D_Qy_FA088.png-wh_500x0-wm_3 -wmp_4-s_1854198682.png "title=" updated. png "alt=" wkiom1erboqadrvbaae1d_qy_fa088.png-wh_50 "/>
4. Updated data Display results
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/85/A6/wKioL1erBP2QBz40AAHM2wFN7Cg170.png-wh_500x0-wm_3 -wmp_4-s_1108900548.png "Title=" after the updated display results. png "alt=" wkiol1erbp2qbz40aahm2wfn7cg170.png-wh_50 "/>
Since I have been maintaining MySQL for many years, I will now tidy up MySQL Update method:
1. View data content
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/85/A7/wKiom1erBfmCNyB5AACvLrhzRMk801.png-wh_500x0-wm_3 -wmp_4-s_278582756.png "style=" Float:none; "title=" M_table1.png "alt=" wkiom1erbfmcnyb5aacvlrhzrmk801.png-wh_50 "/ >
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/85/A7/wKiom1erBfuSpuRTAACYrpYi6ts712.png-wh_500x0-wm_3 -wmp_4-s_3786344280.png "style=" Float:none; "title=" M_table2.png "alt=" wkiom1erbfuspurtaacyrpyi6ts712.png-wh_50 "/ >
2. Updating data
650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/85/A6/wKioL1erBgzT8H4GAAC8JdMbuU0771.png-wh_500x0-wm_3 -wmp_4-s_3847187204.png "title=" M_update.png "alt=" Wkiol1erbgzt8h4gaac8jdmbuu0771.png-wh_50 "/>
3. Updated data Display results
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/85/A7/wKiom1erBh7Qrxh1AAC3eBb_MR8797.png-wh_500x0-wm_3 -wmp_4-s_541269786.png "title=" M_result.png "alt=" Wkiom1erbh7qrxh1aac3ebb_mr8797.png-wh_50 "/>
The result seems to be. The way SQL server is updated is different from how MySQL is updated. This should be noted.
This article from the "Flying Ants" blog, declined to reprint!
SQL requirements 1-Two Table Association update operation