fool5683
asked on
Importing data from a flat file into SQL Server DB using BCP utility
I am attempting to import data from a flat file into SQL Server DB using BCP utility. they both the file is on the same machine as the DB here is:
BCP WrongWrench.dbo.Art IN "D:\My Documents\filelib\Informat ion 410\ Data.txt" -S LAPTOP\ITD410 -U Gregory -P -t "," -C
and I am getting:
Error = [Microsoft][ODBC SQL Server Driver] Unable to open BCP host data-file
Please advise on what could be the problem
BCP WrongWrench.dbo.Art IN "D:\My Documents\filelib\Informat
and I am getting:
Error = [Microsoft][ODBC SQL Server Driver] Unable to open BCP host data-file
Please advise on what could be the problem
U can also m Use BULK INSERT instead of using that BCP utility..
Example
======
BULK INSERT Northwind.dbo.[Order Details]
FROM 'f:\orders\lineitem.tbl'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '|\n'
)
Example
======
BULK INSERT Northwind.dbo.[Order Details]
FROM 'f:\orders\lineitem.tbl'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '|\n'
)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
make sure "Data.txt" is not in use\opened preor Bulk insert
try dts this file in database - makle sure the file is here:
BTW:
DTS is not bad solution for you....
BTW:
DTS is not bad solution for you....
Sounds like the account you're logged in to the machine where you're running
the bcp command doesn't have access to the network drive you're trying to
use. Is LAPTOP\ITD410... a valid UNC path? Can you do a dir on it from
the command prompt?
OR,
instead of giving Server Name , Map the Server Into Some Drive and Put it Drive Letter there and try..
Hope this helps u