I am trying to insert a date value in the format of mm\dd\yyyy
to SQL Server.
In my source .csv file its in the format dd\mm\YYYY
. Is it possible to insert a datefield to SQL Server in this format?
Thanks...
I am trying to insert a date value in the format of mm\dd\yyyy
to SQL Server.
In my source .csv file its in the format dd\mm\YYYY
. Is it possible to insert a datefield to SQL Server in this format?
Thanks...
In the dataflow add a derived column transformation. Create a new derived column and change its expression to
(DT_DBTIMESTAMP)(SUBSTRING(TextDate,7,4) + "-" +
SUBSTRING(TextDate,1,2) + "-" + SUBSTRING(TextDate,4,2))
You can then map this column to your sql server destination column
Use a dataflow transformation Data conversion
and choose DT_DATE
as output type.
The string in input (from your Excel file) will be convert to date object (if your table column is not typed as date).
Otherwise, you can add a dataflow transformation script component
to parse your string and transform it as demanded using C#...