datetime2 data type in ssis

  • hello,

    so i have a query that selects a min date in my sql 2008 database that resulted to 1750-01-01 00:00:00.0000000 (datetime2 data type). This query is being executed in the SSIS execute sql task as select min(date) then the result will be saved in a variable.

    Problem is, i'm getting an error that says the value being inserted to the variable doesn't match the data type of that variable. the name of my SSIS variable is startdatetime and is in datetime data type. Please help.

    thanks!

  • quasar_phoenicis (2/9/2011)


    hello,

    so i have a query that selects a min date in my sql 2008 database that resulted to 1750-01-01 00:00:00.0000000 (datetime2 data type). This query is being executed in the SSIS execute sql task as select min(date) then the result will be saved in a variable.

    Problem is, i'm getting an error that says the value being inserted to the variable doesn't match the data type of that variable. the name of my SSIS variable is startdatetime and is in datetime data type. Please help.

    Unfortunately, for the time being, there is no equivalent for datatime2 in SSIS.

    You can store it in a string in SSIS and convert it back to a datetime2 when you write to a database.

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

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

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