|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
BCP Erorr Help
i am getting this error when i try to take a txt file and use bcp to move it into sql 2000.
C:\stats>bcp.exe stats..applstat in "c:\stats\applstat.txt" -c -t Password: Starting copy... SQLState = 22008, NativeError = 0 Error = [Microsoft][ODBC SQL Server Driver]Invalid date format If I put the / inside of the date, the error that i get then is: C:\stats>bcp.exe stats..applstat in "c:\stats\applstat.txt" -c -t Password: Starting copy... SQLState = S1000, NativeError = 0 Error = [Microsoft][ODBC SQL Server Driver]Unexpected EOF encountered in BCP data-file 0 rows copied. Network packet size (bytes): 4096 Clock Time (ms.): total 16 Attached is the txt file that i am using along and below is a description of fields inside the table. If anyone can help me with this I would really appreciate it! bank_number_id char 2 stats_date datetime 8 run_id char 1 application_id char 2 bank_status_id char 1 accounts decimal 9 market_value decimal 9 asset_value decimal 9 mtd21x_value decimal 9 ytd21x_value decimal 9 mcsf_value decimal 5 ycsf_value decimal 5 mtd_online_value decimal 5 0 ytd_online_value decimal 5 1 |
|
#2
|
|||
|
|||
|
What are you trying to use as your field seperator?
The file appears to have no seperation at all and you have -t with no visible character, but I do not think that will work without a format file as bcp will not know where one field ends and the next one starts. The best bet to start with is tab seperated fields (i.e. have a tab between each field in each line of the file as this is the default for -c as I recall. Then remove the -t from your call to bcp and see how you get on. After all of that you may well find that bcp still does not like the date format at which point you can try it with / or try something closer to the usual sql server date format like 2002-09-30. HTH, Dai |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > BCP Erorr Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|