This article is a mirror article of machine translation, please click here to jump to the original article.

View: 33961|Reply: 2

[Source] SSIS Tutorial 4 Synchronize MySQL Data to a SQL Server Database

[Copy link]
Posted on 2020-8-1 21:47:39 | | | |
SSIS Tutorial 1 Introduction to SQL Server Integration Services
https://www.itsvse.com/thread-9257-1-1.html

SSIS Tutorial (2) Visual Studio 2019 (VS2019) Install SSIS
https://www.itsvse.com/thread-9331-1-1.html

SSIS Tutorial (3) Add a MySQL data source
https://www.itsvse.com/thread-9338-1-1.html

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:

SSIS Tutorial (3) Add a MySQL data source
https://www.itsvse.com/thread-9338-1-1.html



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, pleaseReply


(End)





Previous:Field description pre_forum_thread the discuzx3.4 post table
Next:Database Access Methods (ODBC OLEDB ADO ADO.NET)
Posted on 2020-10-2 18:44:34 |
The tutorial is good。。。。。。
Posted on 2022-6-23 08:46:09 |
Thanks for sharing!
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com