Are the posted questions getting worse?

  • 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

  • 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)

  • 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.

    Can I take a moment to be a naysayer here?

    "Anything and everything" is the quickest way to defeat. If a company tries to do too much at the same time on a project, the project is automatically doomed to failure either before or right after release time.

    It's not that I want to sound pessimistic. It's just that from my perspective, the best way to start this tool is to define a specific start and end point for a specific line of data. Then once the first goal is met and validated, expand it to the other paths one at a time. I know that sounds annoying and like a lot of work, but if you narrow down the expectations for the first bit of work, you'll save yourself a lot of frustration and a possible giant failure at the starting sprint.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Anyone have experience loading ASCII flat files into tables where the files may contain some extended ASCII characters? Any special tricks involved to accomplish this load?

    Thanks,

    Wayne
    Microsoft Certified Master: SQL Server 2008
    Author - SQL Server T-SQL Recipes


    If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
    Links:
    For better assistance in answering your questions
    Performance Problems
    Common date/time routines
    Understanding and Using APPLY Part 1 & Part 2

  • FYI

    https://blogs.technet.microsoft.com/dataplatforminsider/2016/05/02/get-ready-sql-server-2016-coming-on-june-1st/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • YAY! And we're just now upgrading to 2012!

    I feel so far behind the curve... sigh.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (5/2/2016)


    YAY! And we're just now upgrading to 2012!

    I feel so far behind the curve... sigh.

    If you're so far behind the curve, you aren't alone. We're migrating databases from SQL 2005 to SQL 2012.

  • That date pretty much means we were both right on the release date. Now to try and convince some vendor to support it. For us that is the single biggest obstacle to upgrading. Most of our vendors still don't support SQL 2014, much less 2016.

  • TomThomson (4/30/2016)


    Serializable is probably OTT since repeatable read may be adequate (maybe that depends on what sort of updating is going on, I haven't thought it through) but I suspect it isn't going to deliver high performance; nor is snapshot isolation, the temp database is probably going to grow too much when a vast collection of export chunks have to be mutually compatible and snapshot isolation is used to ensure that by building them all in one enormous transaction.

    Repeatable Read would have less overhead, but it would still have problems with Phantom Reads which could occur if the database is not quiesced and more than one table is read. For example, you could catch a row in table B that is paired with a row in table A that you didnโ€™t pick up during its export. You could ignore any rows that are newer than the time you started the export, but you would need some way of identifying which rows those are โ€“ if Grant needs a truly generic solution and canโ€™t enforce any schema, that would be challenging.

    Edit: Ah - I just realized that I made an assumption that Grant never stated. I assumed this was for multiple tables, not just a single one. You're right - I think I did make it overly complicated.

  • Ed Wagner (5/2/2016)


    Brandie Tarvin (5/2/2016)


    YAY! And we're just now upgrading to 2012!

    I feel so far behind the curve... sigh.

    If you're so far behind the curve, you aren't alone. We're migrating databases from SQL 2005 to SQL 2012.

    Ditto that. Going through that right now except they tried to give me a decade old box for my staging server. It didn't survive. Now I know why we had problems with DR... the hard disk would drop transfer rates to just 3-7MB per second after 12 minutes, which is when cache filled and it went totally synchronous on some drives that are actually slower than USB 2.0 flash drives. I guess they never checked for things like that. Trying to restore 1.5TB of files certainly does. ๐Ÿ˜› All the while, they thought it was the DR software. :hehe:

    --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)

  • Jeff Moden (5/2/2016)


    Ed Wagner (5/2/2016)


    Brandie Tarvin (5/2/2016)


    YAY! And we're just now upgrading to 2012!

    I feel so far behind the curve... sigh.

    If you're so far behind the curve, you aren't alone. We're migrating databases from SQL 2005 to SQL 2012.

    Ditto that. Going through that right now except they tried to give me a decade old box for my staging server. It didn't survive. Now I know why we had problems with DR... the hard disk would drop transfer rates to just 3-7MB per second after 12 minutes, which is when cache filled and it went totally synchronous on some drives that are actually slower than USB 2.0 flash drives. I guess they never checked for things like that. Trying to restore 1.5TB of files certainly does. ๐Ÿ˜› All the while, they thought it was the DR software. :hehe:

    p.s. We've had the 2012 boxes stood up for almost 2 years just sitting there burning trons. It took that long for management to finally agree as to an implementation test period and date. It's a classic Catch-22 where they insisted that we were too busy to test the systems that would make all of us... less busy. ๐Ÿ˜›

    --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)

  • WayneS (5/2/2016)


    Anyone have experience loading ASCII flat files into tables where the files may contain some extended ASCII characters? Any special tricks involved to accomplish this load?

    Most likely an issue with how the encoding/Code Page is being specified, but it depends a lot on the source file, the datatype and Collation of the destination field, and how you are doing the import.

    Can you perhaps post this as a question in whatever forum is appropriate here and then reply to this post with the link to that thread? Thanks :-).

    SQL#https://SQLsharp.com/ ( SQLCLR library ofover 340 Functions and Procedures)
    Sql Quantum Lifthttps://SqlQuantumLift.com/ ( company )
    Sql Quantum Leaphttps://SqlQuantumLeap.com/ ( blog )
    Info sitesCollations     •     Module Signing     •     SQLCLR

  • We're still on 2008 here ๐Ÿ˜‰

  • jeff.mason (5/2/2016)


    That date pretty much means we were both right on the release date. Now to try and convince some vendor to support it. For us that is the single biggest obstacle to upgrading. Most of our vendors still don't support SQL 2014, much less 2016.

    We have some vendors that won't support us past SQL 2008 R2... ๐Ÿ™

    Thomas Rushton
    blog: https://thelonedba.wordpress.com

  • Chad Crawford (5/2/2016)


    TomThomson (4/30/2016)


    Serializable is probably OTT since repeatable read may be adequate (maybe that depends on what sort of updating is going on, I haven't thought it through) but I suspect it isn't going to deliver high performance; nor is snapshot isolation, the temp database is probably going to grow too much when a vast collection of export chunks have to be mutually compatible and snapshot isolation is used to ensure that by building them all in one enormous transaction.

    Repeatable Read would have less overhead, but it would still have problems with Phantom Reads which could occur if the database is not quiesced and more than one table is read. For example, you could catch a row in table B that is paired with a row in table A that you didnโ€™t pick up during its export. You could ignore any rows that are newer than the time you started the export, but you would need some way of identifying which rows those are โ€“ if Grant needs a truly generic solution and canโ€™t enforce any schema, that would be challenging.

    Edit: Ah - I just realized that I made an assumption that Grant never stated. I assumed this was for multiple tables, not just a single one. You're right - I think I did make it overly complicated.

    It is multiple tables.

    "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

Viewing 15 posts - 53,881 through 53,895 (of 66,549 total)

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