Importing Oracle date type to SQL date type error

  • I am importing Oracle table with data using SSIS package and while preview the data I am getting following error.

    Year, Month, and Day parameters describe an un-representable DateTime. (mscorlib).

    Any suggestion?

    Thanks,

    Yash

  • How does the query look like? Do you use any parameters?

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

  • I am using default settings of the SSIS Package utility.

    Thanks,

    Yash

  • You are using the Import/Export wizard?

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

  • Yes.

  • yashuvp (1/16/2014)


    I am importing Oracle table with data using SSIS package and while preview the data I am getting following error.

    Year, Month, and Day parameters describe an un-representable DateTime. (mscorlib).

    Any suggestion?

    Thanks,

    Yash

    If these are separate columns that you are pulling together to form a date, sounds like that the data is bad.

  • I found couple of data that are in wrong format 1/1/0001 (old data) so I have modified the sql to look for the date that are good, but still I am getting the error.

    Here is the sql that I am using to pull the data.

    SELECT

    ID,

    CODE,

    CD,

    TYPE,

    PROJECTED_AMOUNT,

    PCS_ID,

    PROCESS_TIME_CODE,

    PROPOSAL_STATUS_CODE,

    BEGIN_DATE, TO_CHAR(BEGIN_DATE, 'MM/DD/YYYY')

    FROM TABLE_A

    WHERE > 70000

  • yashuvp (1/17/2014)


    I found couple of data that are in wrong format 1/1/0001 (old data) so I have modified the sql to look for the date that are good, but still I am getting the error.

    Here is the sql that I am using to pull the data.

    SELECT

    ID,

    CODE,

    CD,

    TYPE,

    PROJECTED_AMOUNT,

    PCS_ID,

    PROCESS_TIME_CODE,

    PROPOSAL_STATUS_CODE,

    BEGIN_DATE, TO_CHAR(BEGIN_DATE, 'MM/DD/YYYY')

    FROM TABLE_A

    WHERE > 70000

    Verify the dateformat setting for your SQL Server instance. If it is set to DMY, this could be the issue.

  • Could you please tell me where can I see for that setting?

    Thanks,

    Yash

  • Try this in SSMS:

    sp_helplanguage @@language

  • It's mdy for English. How can I change to mm/dd/yyyy? Where?

    Thanks,

  • yashuvp (1/17/2014)


    It's mdy for English. How can I change to mm/dd/yyyy? Where?

    Thanks,

    Actually, that is what you want.

    You will need to analyze the data to see if there are dates that aren't dates.

    Also, it may also help if you showed us how your transform is being accomplished. Since we can't see what you see it is hard to provide you much more than guesses.

  • Thanks for your input. I looked at the table and found few corrupted data in wrong format. I exclude those and now I am able to import data into the SQL server. Thanks for your guidance and input, much appreciated.

    Thanks,

    Yash

Viewing 13 posts - 1 through 12 (of 12 total)

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