If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Bulk insert

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-27-03, 07:28
BEL BEL is offline
Registered User
 
Join Date: Feb 2003
Location: Denmark
Posts: 1
Bulk insert

My first try with Bulk insert has failed.

In MSDE 1.0 I have made a sp with the following command:
Bulk insert Rute2 From 'c:\Rute.txt' with (Fieldterminator=';', Keepnulls, Codepage='raw')

The error message is:
Bulk Insert: Unexpected end-of-file (EOF) encountered i data file.

The text file end with a: . If removed the insert succed.
But can I do without that will be nice.
How can I solve this problem?
Reply With Quote
  #2 (permalink)  
Old 02-27-03, 08:38
Paul Young Paul Young is offline
Registered User
 
Join Date: Feb 2002
Location: Houston, TX
Posts: 809
Ask the file provider to ommit the non printing character. If that is not an option, you might write a quick script to strip the last line of the file.

I don't know of a way to tell BCP or Bulk Insert how to deal with this record. Now if you can use DTS things look better.

I created the following table:
create table psy(f1 varchar(10),f2 varchar(10),f3 varchar(10))

I then created the following file:
ABC;;123
DEF;;456


I then selected the psy table in EM, selected All Tasks, Import Data, accepted all the defaults, and successfully imported the data.
__________________
Paul Young
(Knowledge is power! Get some!)

Last edited by Paul Young; 02-27-03 at 08:42.
Reply With Quote
  #3 (permalink)  
Old 02-27-03, 08:45
newbie03 newbie03 is offline
Registered User
 
Join Date: Feb 2003
Posts: 27
Did u set the bulkcopy option for the database?

sp_dboption 'databasename' 'select into/bulkcopy'
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On