none
Convert SQL datetime to DB2/iseries Timestamp

    Question

  • I am using SSIS to move data from SQL Server 2000 to DB2 on the Iseries. I am using DB2OLEDB provider to connect to the DB2 database. The problem I am running into is the DB2 Timestamp format is 'yyyy-mm-dd-hh.mi.ss' and I am unable to get my Date format correct.

     

    Inside SSIS I have created a custom script to and parse the SQL date to this format using a string but I can cast the string back to date format.

     

    Any help would be Great.

     

    Alan

     

    Wednesday, April 25, 2007 7:45 PM

All replies

  • i know this post is pretty old, but i experienced the same problem and my solution was using a derived column with the following expression:

    REPLACE(REPLACE((DT_WSTR,26)column,":",".")," ","-")
    Friday, February 22, 2008 11:15 AM
  • I had the same problem and I tried the expression 

    REPLACE(REPLACE((DT_WSTR,26)column,":",".")," ","-")

    But it doesn't work, I still receive an error !

    So I tried the following expression:

    SUBSTRING(REPLACE(REPLACE((DT_WSTR,40)GETDATE(),":",".")," ","-"),1,26) 

    And it works perfectly 

    Thanks goes to ALLAH then to roakin

    Salam

    • Proposed as answer by Ali Ben Tahar Thursday, March 15, 2012 2:36 PM
    Thursday, March 15, 2012 2:36 PM