Invallid character value for cast specification

  • Can someone explain what the massage above means and how i can avoid this. I am trying to copy an AS400 table into sqlserver with DTS. The package creates an new table for the AS400 tabel in SQL server. But the proces is stopped and the message above is being stated. Can someone please lent a hand. Many thanks in advance.

  • My guess is that SQL is performing an implicit conversion. This means that SQL will attempt to automatically convert a character to an integer if that is the destination field type. If the first few characters are integer, but then there is a char, you would get this message.

    Steve Jones

    steve@dkranch.net

  • Actually Steve I usually get the type mismatch statement. This I usually get when I do a query of the data to smooth the data out for import and if I get say a C where only number are expected this is what I get. Are you doing a query of the data to import or is a straight mapping?

  • Hello Guys, Thanks for replying. Im doing a straight mapping. I let SQL server copie the data. I dont want to transform the data yet. Just trying to get it from an AS400 environment into SQL. I am getting realy desperate now. Any ideas?

  • Ok when you execute and it gives the error does it tell you which column it was. If so look at the output data from AS400 as someone may have put a bad line in. If not then remove 1 column mapping at a time until the error doesn't occurr and whatever you removed last will be where the error is coming from.

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

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