0

I'm importing the following data into a sql server database:

enter image description here

For the dates I'm using this type:

enter image description here

(I've also tried DBTIMESTAMP). The same information can be seen in the data conversion properties:

enter image description here

When the data is actually imported, in the database it cuts the time component off:

enter image description here

How do I retain the time component?

What type should I be storing in the database? datetimeoffset or datetime?

When using it:

DECLARE @MyDatetimeoffset datetimeoffset(7)

What is the purpose of explicitly defining the length (7) ?

Alex Gordon
  • 57,446
  • 287
  • 670
  • 1,062

1 Answers1

0

Try setting the datatype to DBTYPE_DBTIMESTAMP

HoneyBadger
  • 14,750
  • 3
  • 34
  • 48
  • What sort of type errors? Also, did you check this question? http://stackoverflow.com/questions/11899343/ssis-importing-datetime-column-into-sql-server-2008 – HoneyBadger Sep 01 '14 at 13:16
  • im sorry i might be misunderstanding you. when you suggest to set the datatype you are saying in both the settings of the connection and the transformation? – Alex Gordon Sep 01 '14 at 19:24
  • i did try to play with all of those settings, and right now the records are just coming in with NULL for the datetime. – Alex Gordon Sep 01 '14 at 19:25
  • Do you actually need datetimeOffset, or do just want to import the data as datetime? I see you have other attributes defined as datetime, so I presume you know the difference... What is the datatype for these fields in the actual database? – HoneyBadger Sep 02 '14 at 07:29
  • in the target database, i've tried both offset and regular datetime, it only worked when i was reading in as datetimeoffset and having the target defined as datetimeoffset. i want to import the data as DATETIME – Alex Gordon Sep 02 '14 at 15:10