Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old October 1st, 2002, 08:21 AM
ejprobs ejprobs is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 1 ejprobs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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
Attached Files
File Type: txt applstat.txt (57.2 KB, 585 views)

Reply With Quote
  #2  
Old October 11th, 2002, 10:32 AM
Dai Dai is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: UK
Posts: 3 Dai User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > BCP Erorr Help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway