• Grant Fritchey (5/1/2016)


    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.

    How will the exported data be used? That's important because it will help define what the best tool is. For example, if it's for SQL Server to SQL Server, a "Native" format BCP would probably be the best way to go no matter what vehicle you fire it from.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)