Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
akaninakai
Starting Member
2 Posts |
Posted - 2009-05-12 : 11:38:51
|
I received the following errors using BCP in Windows 2003: SQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationAnd SQLState = 22005, NativeError = 0Error = [Microsoft][SQL Native Client]Invalid character value for cast specificationAnd this is causing to stop the load process.The same load works in Windows XP. MDAC versions:Windows 2003 is 2.82.3959.0Windows XP is 2.81.1117.0 Any Ideas? I didn't find any paper from MS with this problem. bcp command:bcp <schema>..<table> in F:\part.DAT -c -r\n -t"|" -b30000 -U<User> -P<Password> -S<Server> |
|
krharm
Starting Member
1 Post |
Posted - 2009-05-12 : 15:14:18
|
It appears that you may have 2 issues. The first issue with the right truncation means that a field in the flat file exceeds the field length of the corresponding SQL column. The invalid character issue sounds like a flat file field contains a value inconsistent with the SQL column type.What I would suggest is creating a staging table in SQL with all columns being a VARCHAR(MAX). If the BCP completes without error, then I would start looking at the data in the flat file for field lengths and data inconsitency.http://www.perptech.com |
 |
|
akaninakai
Starting Member
2 Posts |
Posted - 2009-05-12 : 15:52:44
|
Yes that will resolve the issue temporally , but why it's works using the SQL server Client in Windows XP ? But in Windows 2003 brings this error, I executed the same process in others Windows 2003 and the problem persists.Also the same Load process in Production runs in SQL server 2000 fine we are trying to migrate to 2005.Log from executed from a OS ( Windows XP)Starting copy...30000 rows sent to SQL Server. Total sent: 3000030000 rows sent to SQL Server. Total sent: 60000SQLState = 22005, NativeError = 0Error = [Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification30000 rows sent to SQL Server. Total sent: 9000030000 rows sent to SQL Server. Total sent: 12000030000 rows sent to SQL Server. Total sent: 15000030000 rows sent to SQL Server. Total sent: 18000030000 rows sent to SQL Server. Total sent: 21000030000 rows sent to SQL Server. Total sent: 24000030000 rows sent to SQL Server. Total sent: 27000030000 rows sent to SQL Server. Total sent: 30000030000 rows sent to SQL Server. Total sent: 33000030000 rows sent to SQL Server. Total sent: 36000030000 rows sent to SQL Server. Total sent: 39000030000 rows sent to SQL Server. Total sent: 42000030000 rows sent to SQL Server. Total sent: 45000030000 rows sent to SQL Server. Total sent: 48000030000 rows sent to SQL Server. Total sent: 51000030000 rows sent to SQL Server. Total sent: 54000030000 rows sent to SQL Server. Total sent: 57000030000 rows sent to SQL Server. Total sent: 60000030000 rows sent to SQL Server. Total sent: 63000030000 rows sent to SQL Server. Total sent: 66000030000 rows sent to SQL Server. Total sent: 69000030000 rows sent to SQL Server. Total sent: 720000749656 rows copied.Network packet size (bytes): 4096Clock Time (ms.): total 2763605Log from Windows Server 2003:Starting copy...30000 rows sent to SQL Server. Total sent: 3000030000 rows sent to SQL Server. Total sent: 60000SQLState = 22005, NativeError = 0Error = [Microsoft][SQL Native Client]Invalid character value for cast specification30000 rows sent to SQL Server. Total sent: 90000SQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncationSQLState = 22001, NativeError = 0Error = [Microsoft][SQL Native Client]String data, right truncation110124 rows copied.Network packet size (bytes): 4096Clock Time (ms.) Total : 2875 Average : (38304.00 rows per sec.)*******The Load stop at the 110124 row of 749656 rows. Any CLUE? it's the server or any missing dll or dependencies. |
 |
|
|
|
|
|
|