Link to home
Start Free TrialLog in
Avatar of Y I
Y I

asked on

BCP import fails

When I tried to import the attached csv file(items.csv) to SQL Server by using bcp utility from MS command prompt, bcp fails with the attached message.

bcp databasename.dbo.items in "C:\items.csv" -c -t -S servername\instance_name -d databasename

The following is the table I'm trying to insert csv data.

CREATE TABLE items (
  item_id int,
  year nchar(4),
  item_name nvarchar(20),
  price_tax_ex int,
  price_tax_in int
)

It's appreciate if I can know which syntax is not correct in bcp.

BCP version is 12.0.5000.0
items.csv
bcpfailed.JPG
SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Y I
Y I

ASKER

Thank you very much! I could import by bcp. Thank you very much
Avatar of Y I

ASKER

Thank you very much! I could import data with the below command!! Thank you

bcp databasename.dbo.items in "C:\items.csv" -c -t, -S servername\instance_name -T -F2