all groups > sql server programming > october 2005 >
You're in the

sql server programming

group:

Unable to open bcp host file or Can't the path of data file.


Unable to open bcp host file or Can't the path of data file. Naana via SQLMonster.com
10/7/2005 9:16:20 PM
sql server programming: Hi,

I'm trying to Bulk copy a dat file into my SQL table through a BCP or Bulk
Copy and I get the error messages above, but when I use DTS and points it to
the same path it works. Why isn't BCP and BULK Copy working for me.

e.g.1:

BULK INSERT DBA..publisher FROM 'c:\newpubs.dat'
WITH (
DATAFILETYPE = 'char',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)

e.g.2:

C:\>bcp DBA.dbo.Publisher In 'c:\newpubs.dat -c -t, -r\n -Sserver -Uuserid
-Ppassword


--
Message posted via SQLMonster.com
Re: Unable to open bcp host file or Can't the path of data file. Nils Wolf
10/7/2005 11:24:30 PM
try

C:\>bcp DBA..Publisher In
c:\newpubs.dat -c -t',' -r\n -Sserver -Uuserid -Ppassword


Nisse





"Naana via SQLMonster.com" <u14055@uwe> schrieb im Newsbeitrag
news:557fe8fea1c19@uwe...
[quoted text, click to view]
Re: Unable to open bcp host file or Can't the path of data file. Naana via SQLMonster.com
10/11/2005 7:13:05 PM
Hi Nil,

The BCP is still not working it gives me an error message "Unable to open BCP
host data file".

I used Bulk Insert and I get a "Bulk insert data conversion error (type
mismatch) for row 1, column 7 (EventDate). The trigger at the end of the
statement is suppose to change the data type, but doesn't work when Bulk
Insert .

e.g:
BULK INSERT PUBS.dbo.[Eventheader]
FROM 'c:\abc.txt'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = ':\n',
FIRE_TRIGGERS
)




[quoted text, click to view]


--
Message posted via SQLMonster.com
Re: Unable to open bcp host file or Can't the path of data file. Nils Wolf
10/12/2005 12:00:00 AM
can you post some lines of your abc.txt (inkl. Line 1)


Nils


"Naana via SQLMonster.com" <u14055@uwe> schrieb im Newsbeitrag
news:55b1205d87cfa@uwe...
[quoted text, click to view]
Re: Unable to open bcp host file or Can't the path of data file. Naana via SQLMonster.com
10/17/2005 12:00:00 AM
Hi Nil,

It works now, because I had to clean the code's on the txt file.

Thanks.

[quoted text, click to view]


--
AddThis Social Bookmark Button