string to date conversion using script component/data conversion transformation

  • Hi All,

    I am in need of converting string( Eg: "Jun 20 2005 4.00 PM" --- this string is strored in my stage tables as nvarchar datatype.) to datetime datatype of sql server.( I need to do either using script component(using c#) or data conversion transformation).

    I tried it.but could not solve. Plz any ideas.

    Thanks alot

    Ramya

  • Try the following statement when you select your data:

    select convert(datetime,replace(myColumn,'.',':')) from myTable

    It works for the example that you provided.

    Do this in the OLE DB Source, not in a derived column transformation, as the SQL Datetime data type is much easier to handle than the [DT_DBTIMESTAMP] data type from SSIS.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thanks da-zero

    I will try with that.

    ramya

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply