dbTalk Databases Forums  

unespected eof

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss unespected eof in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Patrick Sullivan
 
Posts: n/a

Default unespected eof - 09-11-2003 , 10:07 PM






I know this isn't a bcp group, but figured people using
dts would know something about bcp.

Ok, I learned how to use trusted login, LOL (see my isql
login problem, newbie in the connect newsgroup). Now I
have been working on this bcp import for 2 days (well,
counting not being able to get started because of
untrusted connections). The file is wierd because it uses
hex 0D0A (crlf) for field and row terminations. I
get "unexpected EOF" errors no matter what options I put
in the command line.

the table structure is like this now:

artist_ID int
pname varchar(50)
aname varchar (50)
medium varchar (50)
artdate char (4)
dimension varchar (50)

I was using char fields with shorter lengths, except for
the ID. But Books Online said field mismatches could be a
problem, so I made them bigger... here are 2 rows of data:

1
Untitled
Mark Rothko
Oil
1961
5'9"x4'2"

2
The Letter
Jan Vermeer
Oil
1666
1'5.25"x1'3.75"

Here is the latest thing I tried:

Data>bcp painters..art IN ff3.txt -T -E -c -t'\r' -r '\r' -
L 10

I have tried using -t and -r = '\n', -r = '\n\r', -L = 10
(there are 10 rows), and edited it into a CSV file and
used DTS to import it and export it again using bcp, and
then import with bcp, and sometimes this works, but cannot
get bcp to work the original, which is necessary. TIA



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: unespected eof - 09-12-2003 , 04:40 AM






In article <092101c378da$ff5db200$a101280a (AT) phx (DOT) gbl>, Patrick Sullivan
<psully (AT) eatel (DOT) net> writes
Quote:
I know this isn't a bcp group, but figured people using
dts would know something about bcp.

Ok, I learned how to use trusted login, LOL (see my isql
login problem, newbie in the connect newsgroup). Now I
have been working on this bcp import for 2 days (well,
counting not being able to get started because of
untrusted connections). The file is wierd because it uses
hex 0D0A (crlf) for field and row terminations. I
get "unexpected EOF" errors no matter what options I put
in the command line.

the table structure is like this now:

artist_ID int
pname varchar(50)
aname varchar (50)
medium varchar (50)
artdate char (4)
dimension varchar (50)

I was using char fields with shorter lengths, except for
the ID. But Books Online said field mismatches could be a
problem, so I made them bigger... here are 2 rows of data:

1
Untitled
Mark Rothko
Oil
1961
5'9"x4'2"

2
The Letter
Jan Vermeer
Oil
1666
1'5.25"x1'3.75"

Here is the latest thing I tried:

Data>bcp painters..art IN ff3.txt -T -E -c -t'\r' -r '\r' -
L 10

I have tried using -t and -r = '\n', -r = '\n\r', -L = 10
(there are 10 rows), and edited it into a CSV file and
used DTS to import it and export it again using bcp, and
then import with bcp, and sometimes this works, but cannot
get bcp to work the original, which is necessary. TIA


try -T -E -r\r\n -t,

for CSV. You don't say what the column delimiter of the original file
is.

\r\n is the row term, CR then LF
, is field separator.

Just for testing you might like to try the Bulk Insert task as this
offers a nice GUI around the same core functionality as BCP. Another
nice feature of the Bulk Insert Task is that it can be used to generate
a format file, which can then be used with the task or BCP.
--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.