How to import the data of the Identity field in SSIS

Source: Internet
Author: User
Tags ssis

In SSIS, a field with Identity is often introduced. The Identity field cannot be inserted. There is a stupid way to achieve this. First set the Identity field of the target data table to No, and then set it back after the data is imported. Of course, this is troublesome and error-prone. In fact, it can be done through settings.

Setting Method (here, the ole db method is used as an example ):

1) double-click ole db Destination. In the pop-up window, select Table or view-fast load in Data access mode in the Connection Manager tab, and then select the following check boxes for Keep identity, as shown in.

2) switch to the Mapping tab. Note that the IDs in both the source and target tables are Identity, but we can Map them because we have selected Keep identity. Otherwise, the system will prompt that the ID of the target table cannot be inserted, as shown in.

 

In this way, the data can be smoothly imported. After completion, the ID of the target table is the same as that of the source table.

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.