Reputation: 65
I'm getting different date formats in my destination date column 'creation_date' when running my ssis packages in visual studio vs running them in ssms.
select record_id, to_char(to_date(creation_Date, 'MM-DD-YYYY HH24:MI:SS'), 'DD-MM-YYYY HH24:MI:SS') creation_date
Upvotes: 0
Views: 624
Reputation: 168440
Don't use strings to store date values.
Currently, you are having to convert from string-to-date-to-string at the source and then string-to-datetime at the destination.
Since you cannot change your VARCHAR2
data type in the source, don't pass your date data as strings between databases; use a DATE
data type:
SELECT record_id,
to_date(creation_Date, 'MM-DD-YYYY HH24:MI:SS') AS creation_date
FROM your_table
Then you can handle the value as a DATETIME
data type in the destination without having an intermediate string format to manage.
Upvotes: 1