Control Batch size on INSERT INTO

  • Hello,

    I am routinely performing SELECT INTO/INSERT INTO statements that perform scoring on 100-200mln rows. These procedures can create big logs files and take 10-20hrs. Network errors and out of disk space are risks that I like to mitigate.

    Is there some way to have batch size control and commit at intermediate intervals of say every 10000 rows?

    Thanks a bunch!

  • Not natively in SQL.

    Simplest way would be to have a loop, set rowcount 100000 and insert them like that. You would have to have some logic to work out which you have already taken.

    Alternatively you can use SSIS to batch them as that is supported.

    Look at Bulk insert but it is for loading from file.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply