BCP from one table to another

  • have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

  • Yes, although you may have to play with the format file, depending upon the differences.

    Have a look at this article on using the format file - http://qa.sqlservercentral.com/articles/BCP+(Bulk+Copy+Program)/105867/

    Steve Hall
    Linkedin
    Blog Site

  • Gregg Dave (5/15/2015)


    have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

    Quick question, why would you want to do that?

    😎

  • Eirikur Eiriksson (5/15/2015)


    Gregg Dave (5/15/2015)


    have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

    Quick question, why would you want to do that?

    😎

    Requirement to insert 5 million rows from one table to another. Now doing INSERT INTO and its taking sometime.

  • Gregg Dave (5/15/2015)


    Eirikur Eiriksson (5/15/2015)


    Gregg Dave (5/15/2015)


    have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

    Quick question, why would you want to do that?

    😎

    Requirement to insert 5 million rows from one table to another. Now doing INSERT INTO and its taking sometime.

    Did you have a look at the article mentioned in this post?

    😎

    What you need to do is a minimally logged insert and this article is a very good reference! 5M rows isn't particularly large, in fact it is almost to small for performance testing. This brings up the question of what else is involved, i.e. triggers, indices etc.

  • Gregg Dave (5/15/2015)


    Eirikur Eiriksson (5/15/2015)


    Gregg Dave (5/15/2015)


    have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

    Quick question, why would you want to do that?

    😎

    Requirement to insert 5 million rows from one table to another. Now doing INSERT INTO and its taking sometime.

    How much time and how many columns, Gregg? Also, is this across servers by any chance?

    --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)
    Intro to Tally Tables and Functions

  • Gregg Dave (5/15/2015)


    have done inserting into files using BCP ,but is it really possible to bcp data from one table to another?

    No... not directly. You would have to BCP out to a file from the source table and then BCP from that file to the destination table.

    --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)
    Intro to Tally Tables and Functions

Viewing 7 posts - 1 through 6 (of 6 total)

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