Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bcp date format output/input differences

Status
Not open for further replies.

PROPAR

Programmer
Oct 25, 2001
51
FR
I'm using the BCP command in a BAT file to export one of my DB table in a text file (SQLServer 6.5).

Output includes a datetime column.

The BCP output file looks like :

sept./21/2002 10:40;Tom;London
sept./21/2002 10:44;Tina;Glasgow
.....

When I try to use BCP to input the file, I got an "invalid date format error message".

The valid date format accepted by BCP (in) is no more sept./21/2002 but 09/21/02 !

The input file must be then :

09/21/02 10:40;Tom;London
09/21/02 10:44;Tina;Glasgow
.....

The date fields must be translated in the file beetween out and in.

Where is the datetime format description ? Why is this description used differently between BCP (out) and BCP (in) ?

The date format used by BCP (out) is also the format in a select SQL request with SQL Enterprise Manager.

Thanks for any clue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top