BCP

  • Hi,

    I need some guidance with respect to BCP utility.

    I have data in a global temporary table and want this to be bcp'ed into the local table. The reason for storing the data in a global temporary table is that i am selecting only 1000 rows out of lakhs of rows existing in a different server. Based on this data i need to join other set of tables and flush out the data of other tables.

    Outline of the requirement:

    1. Data is existing in Server A.

    2. Tables are created in Server B.

    3. Selected top 1000 rows from the parent table in Server A into global temporary table in Server B.

    4. Now I want to bcp these rows into the original table in Server B.

    5. Based on the 1000 rows in point 3, i need to join another table in Server A flush the data into another global temporary table in Server B.

    Hope i am clear in my requirement.

     


    Lucky

  • bcp only does two things:

    1) takes data from table(s) to a flat file

    2) takes a file and loads it into a table

    It doesn't seem like bcp fits anywhere in your description. bcp is a loader/unloader utility only. You want to use Transact SQL to do your work with data in tables.

    /Kenneth

  • You can BCP out views, and BCP out using query with the QUERYOUT option. You can do quite a few things with BCP with a combination of views, functions, queries, etc...

  • It sounds like Data Transformation Services would be a far greater solution than BCP for you. Check DTS out in BOL.

  • You still can only use bcp for

    table => file or file => table - you cannot use bcp for table => table

    /Kenneth

  • If both servers are SQL use linked server??

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

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