This article uses SSIS to synchronize a table from MySQL to a new table in SQL Server. Open VS 2019 and create a new ssis project with the name ITSVSE.ForumThreadSynchronization
The following controls are supported:
Data source
To create two new data sources, first add the target source, that is, the SQL Server database, as follows:
MySQL data sources, reference:
Create a new data flow
The data flow task is to import MySQL data into the SQL Server table and drag the data flow control, as shown in the figure below:
Target table
We create a new table in SQL Server and create a script as follows:
Source table
mysql source table pre_forum_thread, query sql statement as:
Since the target source has a column that is the creation time, we need to insert it, and it cannot be NULL, so the corrected sql statement is:
The results after preview are as follows:
Dataflow tasks
The structure diagram is as follows:
The MySQL ADO NET source target screenshot is as follows:
The following screenshot of the SQL Server target data is as follows:
The mapping relationship is as follows:
Try to run the SSIS package package and successfully import MySQL data into SQL Server as shown in the following figure:
Source code download:
Tourists, if you want to see the hidden content of this post, please Reply
(End)
|