BCP command line / error capturing / bulk insert bugs

BCP command line / error capturing / bulk insert bugs

Post by frederickfl.. » Wed, 31 May 2000 04:00:00



I am attemtping to use bcp to load a file from the command line.  I
originally used the Bulk Insert statement -- using the same parameters -
- which loaded the file successfully (except for some bugs, described
below).  When I use the command line, I get

bcp tgitest.dbo.DWLStaging in
ItemMasterDetail.txt /SDelta /Usa /Pourpassword /c /F2

Starting copy...
SQLState = 37000, NativeError = 170
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:
Incorrect syntax near 'varchar'.

What's wrong?

The reason I want to know is I want to capture errors.  The bcp command
line has the /e flag to capture errors to a file.  The Bulk Insert
documentation does not have a simillar option.  If I put "errorfile
= 'whatever'", SQL server does not parse it as an error, but I don't
get a file either (I can put garbage in the filename without it
complaining).  Does anyone know if it can be used?

When I used Bulk Insert, if there is a truncation error on one row,
that row AND the row after don't get loaded.  Is there a fix for that?
We have SP2 already.

If a Batch_size limit is set, the insert mis-counts the number of rows
by 1 for each batch.  Like, if the batch size is 1000, it will insert
1000 rows, but read 1001.  It will display "1001 rows inserted", and
the 1001st row will be missing from the load.  So if there are 10,000
total rows, it will drop 9 of them.  Any fix?

--
Yabba Dabba Doo
--
Yabba Dabba Doo

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. BCP command line / error capturing / bulk insert bugs

I am attemtping to use bcp to load a file from the command line.  I
originally used the Bulk Insert statement -- using the same parameters -
- which loaded the file successfully (except for some bugs, described
below).  When I use the command line, I get

bcp tgitest.dbo.DWLStaging in
ItemMasterDetail.txt /SDelta /Usa /Pourpassword /c /F2

Starting copy...
SQLState = 37000, NativeError = 170
Error = [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1:
Incorrect syntax near 'varchar'.

What's wrong?

The reason I want to know is I want to capture errors.  The bcp command
line has the /e flag to capture errors to a file.  The Bulk Insert
documentation does not have a simillar option.  If I put "errorfile
= 'whatever'", SQL server does not parse it as an error, but I don't
get a file either (I can put garbage in the filename without it
complaining).  Does anyone know if it can be used?

When I used Bulk Insert, if there is a truncation error on one row,
that row AND the row after don't get loaded.  Is there a fix for that?
We have SP2 already.

If a Batch_size limit is set, the insert mis-counts the number of rows
by 1 for each batch.  Like, if the batch size is 1000, it will insert
1000 rows, but read 1001.  It will display "1001 rows inserted", and
the 1001st row will be missing from the load.  So if there are 10,000
total rows, it will drop 9 of them.  Any fix?

--
Yabba Dabba Doo

Sent via Deja.com http://www.deja.com/
Before you buy.

2. translating multiple rows into multiple columns

3. Error when bulk insert follows another large bulk insert

4. Logon Oracle server with dialog box

5. BCP Command Line Help Needed (End of File Error)

6. Performance problem

7. BCP and BULK INSERT Error

8. An unfindable set?

9. Capture result of BULK INSERT

10. SQL from command line capturing screen display.

11. Length of BCP command-line from DTS Execute Process Task (RE: DTS: length of BCP command-line in Win32 Process Task -SQL Server 7)

12. Copying bulk data in a command line

13. BCP, BULK command, package & JOB