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.