Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2003
    San Jose, CA

    Question Unanswered: Importing Errors when using BCP

    Alright, I've been getting an interesting error when using BCP between two databases on the same MSSQL Server 2000. I am bulk copying data from an older version of a database into a newer one, which includes new tables and columns. When bcp gets to a certain table, I get this error

    SQLState = 22005, NativeError = 0
    Error = [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification
    If anyone would happen to know exactly what SQL is executed by BCP or where to find such information, that would be great. None of the columns' data types have been changes in the newer version of the database.

  2. #2
    Join Date
    Feb 2002
    Houston, TX
    You migt try running profiler while using BCP but I don't think you will find much. The error seems to indicate a problem converting data.

    Could you post the table structures, BCP command(s) and any BCP format files?
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Mar 2003
    DTS might give you more of a clue to where the actual error is.

    I had a problem like this once that turned out to be typos in date fields that were before 1/1/1753 or whatever the magic "start date" in SQL server is (like '12/31/0999' instead of '12/31/1999').

  4. #4
    Join Date
    Jan 2003
    Provided Answers: 11
    You should get a nice picture of the problem with the -o(filename) switch on BCP. The output file will just contain the rows that are causing the errors. I had a similar problem with "Right string truncation" errors in BCP, and the -o spotlighted the problem immediately.

Posting Permissions

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