最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Insert into DB2 database from SQL server using SSIS - Stack Overflow

programmeradmin2浏览0评论

I want to insert into DB2 Database from SQL server using SSIS. The insert should happen multiple times in a day. Approximately need to insert 1 million records and needs to inserted short span. Tried using conditional split but need to find is it possible to have dynamic split based on the row count. for example if there are 50000 records there should be split of 10 with each batch size of 5000. Is there any possible bulk import into DB2 tables

I want to insert into DB2 Database from SQL server using SSIS. The insert should happen multiple times in a day. Approximately need to insert 1 million records and needs to inserted short span. Tried using conditional split but need to find is it possible to have dynamic split based on the row count. for example if there are 50000 records there should be split of 10 with each batch size of 5000. Is there any possible bulk import into DB2 tables

Share Improve this question asked Feb 6 at 4:48 MaevrickMaevrick 12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

If you would like me to expand on my answer, please feel free to ask for more technical details. Here is the initial idea:

Add a Execute SQL Command component is SSIS which get the min(Id) and max(id) or row count of the the data you want to insert into DB2.

  1. Save the min and max values in two Variables.
  2. Define another variable as you Pointer.
  3. Create an If Loop in SSIS which the looping condition is when @pointer < @max
  4. Get Top n of the records you want to insert and update the @pointer to the latest ID --> @pointer+n

This idea is suitable for situations where your IDs are consecutive and there are no missing or deleted numbers in between.
However, it can also be adapted for situations where the IDs are not in a consecutive order with using ROW_NUMBER() which in your case might reduces the performance a little bit while we are loading the data. But after loading the data into RAM, the rest will be fine.

发布评论

评论列表(0)

  1. 暂无评论