Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 date format using BCP

Author  Topic 

kidaduo
Starting Member

45 Posts

Posted - 2008-02-13 : 16:27:28
Help with date:

bcp mydatabase.dbo.mytable out mytable.txt -S server -U %userid% -P pass -c

date is coming as 2000-06-14 00:00:00.000 from the data file, but I need to be formatted as 2000-06-14 00:00:00--- how can I do that


Josephine

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-14 : 05:12:12
Did you try using the format file option?
Go to Top of Page

kidaduo
Starting Member

45 Posts

Posted - 2008-02-14 : 08:53:56
visakh16. How did u do that- I mean format file option.

Thk

quote:
Originally posted by visakh16

Did you try using the format file option?



Josephine
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-02-14 : 09:08:26
refer this & see if it helps:-

http://www.nigelrivett.net/SQLTsql/BCP_quoted_CSV_Format_file.html
http://doc.ddart.net/mssql/sql70/impt_bcp_16.htm
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-02-14 : 10:34:15
You can use the -R switch for that.Specify whatever date format you need in the local settings on the server.The same format is picked up while copying.
Go to Top of Page
   

- Advertisement -