I am sorry, but I have a BCP issue. Reading various forums, I have tried a large number of things, but still I cannot seem to be able to figure out why this is failing. I am sorry, but I appreciate if any of you might be able to see what I am missing. I am betting it's pretty simple. So, I have a simple table:
create table dbo.PRICE_ZONE_GROUP (Id INT NOT NULL PRIMARY KEY,
ZoneGroup INT NOT NULL,
PricingLevel nVarchar(10) NOT NULL,
Description nVarchar(200) NOT NULL)
I have called on bcp with a number of command lines such as: bcp dbo.PRICE_ZONE_GROUP IN in.csv -f joe.fmt -r "\r\n" -e error.log -S <server> -d <db> -U <userName> -P <Password>
The format file is:
1 SQLINT 0 4 "," 1 ZoneGroup ""
2 SQLNCHAR 2 20 "," 2 PricingLevel SQL_Latin1_General_CP1_CI_AS
3 SQLNCHAR 2 400 "\r\r\n" 3 Description SQL_Latin1_General_CP1_CI_AS.
(I am skipping the first (Id) field for the import. They should autonumber.
Here is a small sample of the input file:
7770,Z,ALL OTHER DAIRY
5801,Z,Dummy for training
5550,Z,AVAILABLE - 3 ZONES
8000,Z,MILK AND EGG PRICING
Also - I have used Notepad++ on each of the files. There were missing <CR><LF> at the end of each row (in all the files). But they have them now.
When I run the import I see:
SQLState = S1000, NativeError = 0
Error = [Microsoft][ODBC Driver 17 for SQL Server]Unexpected EOF encountered in BCP data-file
0 rows copied.
Network packet size (bytes): 4096
Clock Time (ms.) Total : 1
I cannot, for the life of me, see what I am missing. But I'm sure it's pretty simple. Anyone have an idea what I've missed???
Thank you in advance.