Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2003

    Red face Unanswered: Bulk Insert does not handle text qualifier

    I'm trying to use Bulk Insert to upload a flat file.
    The file is comma delimited but contains one field that has quotation marks around it. That field typically contains a comma (which of course, I don't want to consider as a field delimeter)
    here is an example of the layout.

    1,test,D,"OCB, England",450727,8575

    I use the DTS Bulk Insert task to help me generate a format file to use with the bulk insert statement. I tell the wizard that the file is comma delimited with a text qualifer and it's fine with that. But when I run the bulk insert, it bombs with a "String or Binary data would be trunctated error.
    So, any idea's on how to bulk insert to be smart enough to deal with this situation?

  2. #2
    Join Date
    Jun 2003
    Provided Answers: 1
    "String or Binary data would be trunctated" usually means that the string you are trying to insert is longer than that allowed by the field in your destination table. If, for instance, your table's field is defined as 50 characters (the default) and one of your quoted strings is longer than 50 characters, you will get this error.

    Either increase the size of your destination field, or cast your string as a field of the proper width before attempting to insert it.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts