September 12, 2005 at 10:25 pm
I have a flat file which i need to bcp to SQL 2000 Server. The file has a date value whose format is defined as "YYYY/MM/DD". I have created a format file and when i try to BCP it gives me an error "invalid date format".
But when i change the data in input file to match formate "mm/dd/yyyy" then the BCP works perfectly.
Is there any way to BCP the data to SQL 2000 without changing the date formate in input file?
Thanks
September 12, 2005 at 10:37 pm
Suggestion - you could try configuring ODBC to "Use regional settings when outputting currency, numbers, dates and times"....and see if that fixes it!
**ASCII stupid question, get a stupid ANSI !!!**
September 13, 2005 at 2:40 am
hi,
use DTS Bulk insert task there u can define ur format
from
doller
September 13, 2005 at 1:03 pm
Thanks! BCP using DTS Package is working fine.
September 14, 2005 at 3:40 am
Try -R as a switch on your BCP to pick up client regional settings, no need to change anything else
September 14, 2005 at 4:45 pm
-R option gives me the following error:
SQLState = 22008, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]Invalid date format
BCP command I used was:
bcp dbN..TabName in d:\1.dat -m1 -fd:1.fmt -SSRVR -T -R
-Thanks
September 14, 2005 at 8:22 pm
Hi Santosh,
If u really wanted to know how DTS package worked as what is the real syntex used to load the data.
Run Sql Profiler and run ur DTS package SQL Profiler will tell u every thing except those things which are hidden by MSC.
Hope this help
from
Kiler
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply