|
-Dman100-
Posting Yak Master
210 Posts |
Posted - 2009-01-04 : 13:59:54
|
| I'm trying to copy a csv file using bcp into table, but I'm getting errors.The first error I got was:Unexpected EOF encountered in BCP data-fileI think this is because I didn't specify the field and row terminator correctly.Then I think I fixed the problem with the field and row terminators, but then when I ran the bcp insert, I was prompted for the file storage type, prefix-length (not sure what to enter for this) and field terminator.I got the following error:Numeric value out of rangeHere is a sample of rows from the csv file I'm trying to import:Acct#,Contract#,StartDate,EndDate,ProductCode,PricebookEntryId,Quantity,TotalPrice,Category,SubCategory,Description13112,JDE Contract Number 202159-00-2007,10/1/2006,9/30/2007, Exclude,,1,0,,,Compass Station Access BaseCnt 1513112,JDE Contract Number 202159-00-2007,10/1/2006,9/30/2007, SWCLASSIC,,1,0,,,C-PAS K-813112,JDE Contract Number 202159-00-2007,10/1/2006,9/30/2007, SWCLASSIC,,1,0,,,Golden Book Encyclopedia (WIN)13112,JDE Contract Number 202159-00-2007,10/1/2006,9/30/2007, SWCLASSIC,,1,0,,,Integrated Lang. Arts: Primary13112,JDE Contract Number 202159-00-2007,10/1/2006,9/30/2007, SWCLASSIC,,1,0,,,Language Arts Level 3The first row is the headers, which I can remove, but I included to help show all the fields. Each field is terminated by a comma and the row is terminated by a line-break.The datatypes for all the columns are nvarchar except for the quantity, which is a float and the amount, which is currency.This was what I tried:bcp <databasename>.dbo.<tablename> in c:\<filename.csv> -t , -r \n -S ServerName -U username -P passwordThanks for any help. |
|