SQL Server BI step with step SSIS 4

Source: Internet
Author: User
Tags ole ssis

This article supporting source code

The last time we did not implement the data in Excel and the data in the database to consolidate, there is an update, does not exist that is inserted. This is mainly about several methods to realize:

1. Using the Lookup

2. Use the Execute SQL task to invoke the stored procedure

3. Use script Component to implement

4. Use the merge statement (SQL SERVER 2008)

5. Use the last time we used the merge to achieve

6. Use third party component SCD Component

It seems that there are a lot of ways to do this, and we'll introduce and introduce the application of some components, and we can do the same with other functions.

Lookup

Create a new package mergedatalookup, we foreachinput in the copy over, we realize the traversal of Excel, while the data in Excel and the data in the database merge, in the data flow, under the Excel data source, delete the original components, Drag into the lookup component and select the settings for the lookup after OLE DB connection:

You can see that we are based on the ProductNumber field in the Excel data to find the corresponding data (column ProductID), that is, to find the corresponding data, ProductID will be added as a new column to our data flow, can not find the error, click on the The marked configuration error output,

So for the two output of lookup, the normal output is to find the productnumber corresponding data, at this time do the update operation. We have configured this in the figure above, and when a row is not found, we reset the row of data to the error output, and then insert the drill We add the OLE DB Command on the normal output to execute our UPDATE statement.

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.