|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Unable to open bcp host file or Can't the path of data file.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 http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200510/1 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...Show quoteHide quote > 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 > http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200510/1 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 ) Nils Wolf wrote: >try > >C:\>bcp DBA..Publisher In >c:\newpubs.dat -c -t',' -r\n -Sserver -Uuserid -Ppassword > >Nisse > >> Hi, >> >[quoted text clipped - 16 lines] >> C:\>bcp DBA.dbo.Publisher In 'c:\newpubs.dat -c -t, -r\n -Sserver -Uuserid >> -Ppassword -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200510/1 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...Show quoteHide quote > 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 > ) > > > > > Nils Wolf wrote: >>try >> >>C:\>bcp DBA..Publisher In >>c:\newpubs.dat -c -t',' -r\n -Sserver -Uuserid -Ppassword >> >>Nisse >> >>> Hi, >>> >>[quoted text clipped - 16 lines] >>> C:\>bcp DBA.dbo.Publisher In >>> 'c:\newpubs.dat -c -t, -r\n -Sserver -Uuserid >>> -Ppassword > > > -- > Message posted via SQLMonster.com > http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-programming/200510/1 Hi Nil,
It works now, because I had to clean the code's on the txt file. Thanks. Nils Wolf wrote: Show quoteHide quote >can you post some lines of your abc.txt (inkl. Line 1) > >Nils > >> Hi Nil, >> >[quoted text clipped - 30 lines] >>>> 'c:\newpubs.dat -c -t, -r\n -Sserver -Uuserid >>>> -Ppassword
deleting but like truncating?
Merge/Hash/Nested Loop join question Finding rows with duplicate column values Temp Table on Linked Server Right join not working when joining 3 tables Create table not working...? Execute Stored Procedure from User Defined Function Extreamly slow performance on a view Is there a way to "select" from the results of a stored procedure? Delete where 2 fields do not match |
|||||||||||||||||||||||