SQL - questions on bcp .

i;m trying to use bcp to import a csv file into an existing table.
i have taken care of the data type of the existing table and the number of fields by using the format file .

now i have minimised the entry to only one line in the csv file.
I still got the following error.

Starting copy....
SQLState=S1000, NativeError=0
Error=[Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file.
0 rows copied

i really cannot find out what is wrong with the csv file.
Any hint or pointer will be much appreciated


Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

check for nulls or tabs in the source file

(i mean an ascii null rather than a database null)
Anthony PerkinsCommented:
Try posting a sample of the file that is giving you problems and indicate which line is causing the error.
Anthony PerkinsCommented:
If I was to guess I suspect one of the fields contains double quotes.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

justsradAuthor Commented:
Thanks for everyone's feedback and advise.

I have attached two files:

1. meunitem10.csv ( this file's content to be imported to SQL's table)
2. Add-Jade-Menuitem.xls  (The header column is obtained by using the DTS wizard to export out the table. )

justsradAuthor Commented:
To Lowfatspread: i will try to search for the Ascii null, could it be seen using the linux command "cat -v " Thanks.

To acperkins:: i have just double checked it, none exists. Thanks
justsradAuthor Commented:
almost forget , the command that i typed as below:

bcp pos.dbo.menudef in menuitem10.csv -c -t, -r\n -f mytable.fmt -P pass
Anthony PerkinsCommented:
You have a discrepancy between the number of column defined in the header (66) and the actual values in the data (29).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
justsradAuthor Commented:
Great help indeed!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.