bcp - no data in error file 
Author Message
 bcp - no data in error file

Hello
i'm trying to copy data using a bcp tool from MFC program.
In bcp_init i've set the error file. Whenever any error
occure (Primary key validation in most cases) the file is
created but it is empty. Have U ever come accross this
problem. BCP_INT says that in error file should be all
errors with rows that cused them.
On the other hand I can fetch ODBC error like that:
Message text:
[Microsoft][ODBC SQL Server Driver][SQL Server]The
statement has been terminated.SQLReturn: SQL_ERROR
Records: 4

Datasource Database, Connection: NetConn: 0156c768
Native Error: -122,SQLState: 01000
Message text:
[Microsoft][ODBC SQL Server Driver][SQL Server]1000 rows
sent to SQL Server. Total sent: 1000

Datasource Database, Connection: NetConn: 0156c768
Native Error: -122,SQLState: 01000
Message text:
[Microsoft][ODBC SQL Server Driver][SQL Server]1000 rows
sent to SQL Server. Total sent: 2000

Datasource Database, Connection: NetConn: 0156c768
Native Error: 2627,SQLState: 23000
Message text:
[Microsoft][ODBC SQL Server Driver][SQL Server]Violation
of PRIMARY KEY constraint 'PK_FMSERNO'. Cannot insert
duplicate key in object 'FMSERNO'.

Datasource Database, Connection: NetConn: 0156c768
Native Error: 3621,SQLState: 01000
Message text:
[Microsoft][ODBC SQL Server Driver][SQL Server]The
statement has been terminated.

As can U see bcp has send whole file hance the PK
validation was in the first row.
Thenx
MyszOK



Tue, 24 Aug 2004 11:50:30 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Too much global data in file error...

2. BCP overrides foreign key constraint!

3. bcp

4. BCP code?

5. BCP API

6. Error: field data truncated during data fetch.

7. Error: field data truncated during data fetch.

8. System.Data.SqlClient.SqlException: Error converting data type varchar to numeric

9. Data Validation of data inside a text file

10. Q: FILE Data Structure / File Position Pointer?

11. Reading file..Saving data in new file...

12. Movie/Sound files, reading data embedded with another file

 

 
Powered by phpBB® Forum Software