BCP

  • Does anyone know how to remove double quotes from a text file when using bulkcopy

    to load a table.

    Regards

    Ray West

  • Can you post some sample data?

  • Test data

    rays,"test data",1,0

    rays,"test data",1,1

    rays,"test data",1,2

    rays,"test data",1,3

  • I hope you find an easier solution, but I've always run an update query that updated the value in question to

    SUBSTRING(expression, start, length).

    Peace Out!

    Regards,
    Matt

  • Another option is to specify the delimeter as ," in your format file.

  • If you are ALWAYS going to have the quotes and you input is comma delimitted use the following format file:

    8.0

    4

    1 SQLCHAR 0 4 ",\"" 1 COL1 SQL_Latin1_General_CP1_CI_AS

    2 SQLCHAR 0 12 "\"," 2 COL2 SQL_Latin1_General_CP1_CI_AS

    3 SQLINT 0 4 "," 3 COL3 SQL_Latin1_General_CP1_CI_AS

    4 SQLINT 0 10 "\r\n" 4 COL4 SQL_Latin1_General_CP1_CI_AS

    quote:


    Test data

    rays,"test data",1,0

    rays,"test data",1,1

    rays,"test data",1,2

    rays,"test data",1,3


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

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