473,394 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Datetime import/export issue

I am migrating data from one database to another. The process
requires that I significantly modify the table and data structure.
Therefore, I am exporting the data to a csv, making the adjustments
and then importing it to the new table.

One of the fields being migrated is a datetime field. When I export
the data to a csv the seconds portion of the datatime entries revert
to zero. For example, 1/18/2008 4:19:00 PM. What it needs to be is
1/18/2008 4:19:31 PM.
Please advise how I can extract the data and maintain the seconds.


Jul 2 '08 #1
3 5584
How do you export the data? I have used both BCP and the Import/Export
wizard and they both export DATETIME values with milliseconds.

Also, make sure to view the result CSV file in a text editor. If you open in
Excel the default date format trims to the minute and you need to create
custom formatting to see the seconds.

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jul 2 '08 #2
On Jul 2, 10:27*am, "Plamen Ratchev" <Pla...@SQLStudio.comwrote:
How do you export the data? I have used both BCP and the Import/Export
wizard and they both export DATETIME values with milliseconds.

Also, make sure to view the result CSV file in a text editor. If you open in
Excel the default date format trims to the minute and you need to create
custom formatting to see the seconds.

HTH,

Plamen Ratchevhttp://www.SQLStudio.com
I am using the express version and exporting with a third part package
(Teratrax). Suggestions for a better way with express?
Jul 2 '08 #3
I am not familiar with Teratrax. Since the BCP utility comes with SQL Server
Express I would suggest to use it:
http://msdn.microsoft.com/en-us/library/ms162802.aspx

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jul 2 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dave Irick | last post by:
We are looking for assistance in setting up export/import jobs that will use DLT tapes managed by Netbackup. The issue seems to be how to specify the "file" parameter of export/import so that it is...
4
by: news | last post by:
Our production database in an exported textfil runs about 60 MB. Compressed that's about 9 MB. I'm trying to import the export into another machine running FC3 and mySQL 11.18, and it appears as...
2
by: Alok | last post by:
Hi, I recently upsized my access database to an ADP project with SQL backend. However when I did it the import/export specs were not ported to the new database. Also in the ADP files I am unable...
4
by: Steve Jorgensen | last post by:
I'm restarting this thread with a different focus. The project I'm working on now id coming along and will be made to work, and it's too late to start over with a new strategy. Still, I'm not...
4
by: N. Graves | last post by:
Thanks for taking the time to read this note. I have a Access inventory collection tool that I have automated to build and Export to a CSV file. In the database I have several fields that are...
4
by: shaboo | last post by:
Hi Guys, I have just installed Python2.4.2 on our HP-UX system. But when I try to import datetime modlue I get the following error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> from datetime import...
3
by: Robert Bogue [MVP] | last post by:
I've got a test harness I've been building and playing with to manage ASP.NET web parts. One thing I've noticed is that I do not seem to be able to reimport the webparts I've exported back on to...
1
by: Wandering | last post by:
I know you guys are heavy duty coders, while I do ad-hoc analysis, and rarely write code. And, I may be in the wrong groups because this is about an install issue, and I don't think it's a code...
2
by: Piero 'Giops' Giorgi | last post by:
Hi, all! The Criminal DB is going strong (as of today: 50 Tables, on 3077 Filegroups) Right now I stuffed in it about 2 million records (About 7% of total), but I'm constantly having an issue...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.