Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Bulk insert

Author  Topic 

ikeguluo
Starting Member

15 Posts

Posted - 2008-10-23 : 12:46:35

I have a text file that im trying to import into a sql server 2005 table using bulk insert
The text file called bulk.txt contains just one column seperated by double quotes eg
"Business Services"
"Central"
"Central Area"
"Central Environment Management"
"CentralEFAS"
"CIS"

and the table data with columns
id
name
geograhical
active

I am trying to insert this data into the geograhical column within the data table but keep getting errors.

I am running the query
BULK INSERT data
FROM 'c:\bulk.txt'
WITH
(
FIELDTERMINATOR = '""'

)
but keep getting the error Bulk load: An unexpected end of file was encountered in the data file.
Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.
Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".


Can someone please help me PLEASE

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 12:53:22
is path given server path?
Go to Top of Page

ikeguluo
Starting Member

15 Posts

Posted - 2008-10-23 : 12:55:49
no the path is 'c:\bulk.txt' and this is where I kept the text file
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 12:59:03
quote:
Originally posted by ikeguluo

no the path is 'c:\bulk.txt' and this is where I kept the text file


you mean in yourr server or your local machine?
Go to Top of Page

ikeguluo
Starting Member

15 Posts

Posted - 2008-10-23 : 13:00:09
yes thats what i mean
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 13:06:55
quote:
Originally posted by ikeguluo

yes thats what i mean


what you meant?
1.your server
or
2.your local machine??

It should be server path. so it wont work if file is in c:\ of your machine
Go to Top of Page

ikeguluo
Starting Member

15 Posts

Posted - 2008-10-23 : 13:08:31
I meant my local machine ..my server is 10.4.121.52 ao how should I write the query
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 13:21:07
see this

http://www.bokebb.com/dev/english/2011/posts/2011122639.shtml

Go to Top of Page
   

- Advertisement -