Home All Groups Group Topic Archive Search About

BCP Invalid character value

Author
20 Nov 2006 5:53 PM
John Oberlin
I am getting a 'Invalid character value for cast specification' error when
trying to BCP data from a SQL 8.00.760 instance to a SQL 9.00.2047 instance.

BCP out syntax...
exec master..xp_cmdshell 'BCP database..table in D:\Temp\database\table.txt
-e D:\Temp\database\table.err -b 1000 -c -S server\instance -U sa -P password
-E'

BCP in syntax...
exec master..xp_cmdshell 'BCP database..table in D:\Temp\database\table.txt
-e D:\Temp\database\table.err -b 1000 -c -S server\instance -U sa -P password
-E'

BCP error...
SQLState = 22005, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Invalid character value for cast
specification

The data in the column it's giving the error on is:  0xFFFFFF7F

Author
20 Nov 2006 7:55 PM
Erland Sommarskog
John Oberlin (JohnOber***@discussions.microsoft.com) writes:
Show quote
> I am getting a 'Invalid character value for cast specification' error
> when trying to BCP data from a SQL 8.00.760 instance to a SQL 9.00.2047
> instance.
>
> BCP out syntax...
> exec master..xp_cmdshell 'BCP database..table in
> D:\Temp\database\table.txt
> -e D:\Temp\database\table.err -b 1000 -c -S server\instance -U sa -P
> password  -E'
>
> BCP in syntax...
> exec master..xp_cmdshell 'BCP database..table in
> D:\Temp\database\table.txt
> -e D:\Temp\database\table.err -b 1000 -c -S server\instance -U sa -P
> password  -E'
>
> BCP error...
> SQLState = 22005, NativeError = 0
> Error = [Microsoft][ODBC SQL Server Driver]Invalid character value for
> cast specification
>
> The data in the column it's giving the error on is:  0xFFFFFF7F

And the data type of the column is?

Even better, what is the definition of the two tables? Specifically,
are they identical? Please script both tables and post together with
some sample data that demonstrates the problem.



--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button