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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 DateTime Import Problem

Author  Topic 

Friznost
Starting Member

20 Posts

Posted - 2007-12-06 : 14:24:41
I have a text file which contains a Datetime field in the following format:

JAN 1 3035 12:05:26:730AM
AUG 10 2007 8:24:29:876AM
NOV 6 2000 1:35:23:120PM



When importing this field into a table with a datetime field is errors out. However, I can import this field as a varchar and once it's in the database I can alter the field to datetime without any problems. How can I get this to import as datetime? Thanks in advance.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-06 : 15:23:46
Because SSIS assumes SMALLDATETIME as first choice, DATETIME as second choice.
Force the package to treat the datecolumn as DATETIME.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Friznost
Starting Member

20 Posts

Posted - 2007-12-06 : 16:19:38
Could you explain how to force the package to treat the datecolumn as DATETIME?
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2007-12-07 : 03:31:31
Load the data into a staging table and convert it there.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-12-07 : 03:40:24
I think you should edit the module where the import is done. Change the preferred datatype.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -