Dirk Dastardly
Dirk Dastardly

Reputation: 1047

DTS cannot convert datetime2 to datetime

I need to make a DTS package to convert data from one database to another. The structures are essentially the same except that all datetime2 fields have been changed to datetime. When attempting to run the DTS package against the database, it fails every time it runs into a datetime2 field that can't be converted without truncation. I REALLY don't care about the precision, I just need the date and time to the nearest second. If I set DTS to ignore on truncation rather than fail, it ignores the entire row and I end up with no data. How can I tell DTS that this truncation is OK?

Upvotes: 1

Views: 428

Answers (1)

Dirk Dastardly
Dirk Dastardly

Reputation: 1047

Well, the best answer I've been able to come up with is to use a query for the DTS source rather than a table. Within that query, CONVERT all the datetime2 objects to datetime and check and truncate any invalid values.

Upvotes: 1

Related Questions