2012年3月19日星期一

BCP Invalid character value

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
John Oberlin (JohnOberlin@.discussions.microsoft.com) writes:
> 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, esquel@.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

没有评论:

发表评论