bulk export table to csv files

  • I need to join 2 tables, each has about 70,000,000 rows. These two tables are not on local server.

    When I run the join, the sql server 2008 gives error message: "...out of memory"

    Therefore, I try to bulk export the tables to csv files on my local machine, and import them to database my local sql server, then do the join.

    However, the 'bcp' command is not recoganized on my sql server.

    I'd appreciate for any good ideas. 🙂

  • bcp is a command line utility...not a TSQL command.

    if you get the error in a command window, it's because bcp is not in the path...so you need to use the full path to the file instead, like "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\bcp.exe"

    if you are doing the work in TSQL, you can use BULK INSERT instead, otherwise you have to call xp_cmdshell to call bcp within a command window.

    if you show us how you are doing it, and the exact error message, we can help you better.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 2 (of 2 total)

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