Home Forums SQL Server 2008 SQL Server 2008 - General BCP command to import data from txt file (Pipe as Field terminator)into SQL Table. RE: BCP command to import data from txt file (Pipe as Field terminator)into SQL Table.

  • my bcp OUt exampel shows the delimiter between dbl quotes, and not the sole char after the -t.

    try that...

    also check your row terminator; if it's not CrLf, you might need to change /add the -r command for the row terminator:

    -r"\r"

    EXECUTE master.dbo.xp_cmdshell 'bcp "SELECT * FROM ##PIPE_REPORT " queryout C:\Data\Objects.txt -t"|" -c -T '

    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!