Bulk Insert RRS feed

  • Question

  • Hello everyone

         I am executing one Data Migration Project. I am supposed to transfer records of source database table to target database table. Schema and collation of both the tables are different. I have written scripts for that and also created .NET assemblies for some operations. But is there any efficient way? I have heard of Bulk insert in Sql Server but it seems like it takes data only from data file. So I am confused.

    Further, for some manipulation and reformation of legacy data at record level i am using cursor. But seeing at the number of record (that is 2 billion) i break it up into two phase, First i paste all into temp DB and then execute cursor batch of 500 records. Is this really the right way to do it?

    - Regards,
    Bhagyesh Joshi, India.
    Tuesday, August 9, 2011 1:51 PM



    Hi Joshi, 

    Maybe you should use SSIS for data transfer. 

    With integration services you can perform bulk insert from one table to another. 

    Maybe this can help: http://www.sql-server-performance.com/2009/execute-sql-bulk-insert-tasks-ssis/


    Slaven Sola MCITP DBA,MCT ------------------------------ Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Proposed as answer by Peja Tao Thursday, August 11, 2011 6:12 AM
    • Marked as answer by bhagyesh joshi Thursday, August 11, 2011 8:50 AM
    Tuesday, August 9, 2011 9:07 PM