• Jeff Moden (4/30/2016)


    Grant Fritchey (4/28/2016)


    Technical question:

    I want to export large amounts of data. However, I don't want to use SSIS. I'm going to use SQLCMD.EXE. I need to be able to script these exports so that I do, let's say, 10,000 rows at a time, in chunks. I'm doing this so that I have the ability to easily restart, and, allow for starting to migrate or move the exported files as each chunk finishes.

    What's the best way to, in a relatively generic fashion, efficiently divide a table into these 10,000 row chunks?

    Articles, blog posts, some documentation to get this going in the right direction. Please!

    Oh, and, what the heck... URGENT!

    Ha!

    Ok, so based on some of the problems folks think you might have with chunking data, I'm curious. How many columns and how many rows do you want to export? And will they be delimited or fixed field?

    It's going to be anything and everything. We're working on some automation for a tool at Redgate.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning