Dates and Times via SSIS

  • I do apolagise for all these questions.

    I have a staging database. This database has a table - "table1". I have a few columns but two that I want to transfer.

    ID = int

    planned_start_date = datetime.

    Sample of the data is -

    id - 1875

    planned_start_date - 2012-06-13 12:00:00.000

    What I want to do is transfer it to the datawarehouse database as the following -

    "table2"

    id - 1875

    planned_date -2012-06-13

    planned_time - 12:00:00.000

    So keep the date and time seperate?

    Any ideas please are welcome.

    Thanks

  • I think I have worked it out.

    Created a table in my datawarehouse called 'table2', with columns -

    id - int

    date - datetime

    time - time(7)

    The in my SSIS Data Flow Task I have a "Data Conversion" task inbetween my source and destination.

    I've then added the input colum of "planned_start_date" twice, one with an output alias of "date" and one of "time" with the datatype of database date and database timestamp respectively and it appears to do what I want it to.

    Thanks

  • The only change I still would made is change the data type of the first column from datetime to date.

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

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

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