473,513 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rows not importing through BCP

Hello,

I am importing a file using BCP, with a format file. It is a
fixed-width file, which I am importing into a table that has a column
for each field in the file. The columns in my import table are all
defined as CHAR. I use it as a staging area to check the data (are
dates formatted correctly, etc.) before moving it from there.

In one of my files I have six records that contain strange characters
(ascii codes of 03 and 02 if I am remembering correctly). When I
import the file, these six records do not get imported. Not only that,
but if I use the error file option with BCP, nothing is put in the
error file either. As far as I can tell, it is just skipping right
over the rows. If I import the file into a table with a single column
that holds the entire row of data, all rows get imported.

I've included a sample of the format file below (there are 106 fields
in the real one, so I've abbreviated it for space). I've also included
a table definition as well.

Has anyone seen this behavior before? Any ideas?

Thanks and Happy New Year!
-Tom.
Table Definition:
-----------------------------------------------------------
CREATE TABLE [dbo].[BIF_Pre_Staging] (
[dda_num] [char] (18) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[account_app_id] [char] (4) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[cust_num] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[CUST_ACT_OWNER_TYPE] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[do_not_mail] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[employee_code] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[ACCOUNT_TAX_NUM] [char] (9) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[CUS_PFS_FLAG] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SUB_TIER_VALUE] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

-----------------------------------------------------------
Sample Format File:
-----------------------------------------------------------
8.0
9
1 SQLCHAR 0 18 "" 1 dda_num ""
2 SQLCHAR 0 4 "" 2 account_app_id ""
3 SQLCHAR 0 10 "" 3 cust_num ""
4 SQLCHAR 0 1 "" 4 CUST_ACT_OWNER_TYPE ""
5 SQLCHAR 0 6 "" 5 do_not_mail ""
6 SQLCHAR 0 1 "" 6 employee_code ""
7 SQLCHAR 0 9 "" 7 ACCOUNT_TAX_NUM ""
8 SQLCHAR 0 1 "" 8 CUS_PFS_FLAG ""
9 SQLCHAR 0 5 "\r\n" 9 SUB_TIER_VALUE ""
-----------------------------------------------------------
Jul 20 '05 #1
1 4574
Thomas R. Hummel (to********@hotmail.com) writes:
In one of my files I have six records that contain strange characters
(ascii codes of 03 and 02 if I am remembering correctly). When I
import the file, these six records do not get imported. Not only that,
but if I use the error file option with BCP, nothing is put in the
error file either. As far as I can tell, it is just skipping right
over the rows. If I import the file into a table with a single column
that holds the entire row of data, all rows get imported.

I've included a sample of the format file below (there are 106 fields
in the real one, so I've abbreviated it for space). I've also included
a table definition as well.


I tried your table and format file, with this data:

123456789012345678ABCD1234567890|abcdefX123456789/12345
%%%456789012345678ABCD1234567890@abcdefX123456789/12345
¤¤¤456789012345678ABCD1234567890\abcdefX123456789/12345
"""456789012345678ABCD1234567890?abcdefX123456 789/12345

This loaded fine. I then replaced the "d" on the last two lines with
ASCII 2 & 3. The file still loaded fine.

Could you try to achieve a complete repro?
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2323
by: TonyB | last post by:
Hi, I've searched the group and need more information and guidance on this issue I need to resolve next week. I work for the local school system and I am working on a way to parse a CSV file of...
3
3653
by: Elaksomfan | last post by:
Hi, I am having trouble importing data from an excel spreadsheet into MS SQL Server 2000 using DTS Wizard. The DTS import process is successfull, no errors, but only 50 rows of approx. 1500 rows...
3
11511
by: Stephen Matthews | last post by:
Help please i have a file which im importing, however it is a single column, the data looks like C8517673505 N7062175 C8517673516 N7062178 C8517673527
4
1955
by: R Bolling | last post by:
I have a text file from a text document that has very long rows (two or three paragraphs from a text document for each row). Importing to text cuts it off at 255 characters, and importing to a...
0
1123
by: Andy | last post by:
Hello All: I am importing an Excel / CSV file. The problem I am having is: the columns are being defined for me as int32 (able to determine by using the ..GetFieldType method). As a result: ...
10
2013
by: el__marcin | last post by:
hi I am using MS office Access 2003. ANybody knows how to convert more than 300-400K rows from text into e.g. number ? I tried to do so a few times and access told me there aint enough memory or...
1
1281
by: ozzii | last post by:
Is there any way to retrieve the ids of all rows inserted after importing bulk data using the load infile technique? I need the ids of all rows that have been inserted so that they can be inserted...
4
20379
by: sudhaMurugesan | last post by:
Hi all, I am importing data from excel sheet. i get the data in a datatable. when there are empty rows in excel i am getting empty rows in datatable also. how to remove empty rows? help me...
4
5878
by: kageyone | last post by:
I have an access database with a table with two fields. They are 1. a GUID field and 2. a comma delimited set of values. I want to take this table and for each row I want to do the following: ...
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7099
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.