SSIS Derived Column Transformation Date Time Expression

  • I'm using Derived Column Transformation and I'd like to create column with the current date/time with .000 milliseconds. Can anyone help with the expression I need to perform this please?

    Many thanks in advance. Damion

  • Pretty simple:

    (DT_DBTIMESTAMP2,3)GETDATE()

  • Thank you for the quick response.

    However, it's returning the actually milliseconds rather than zero (our client software doesn't anything other than zero milliseconds).

    2012-04-30 11:11:06.573

  • Sorry, misunderstood your requirement. If you set the derived column error output to "Ignore Failure" on truncation then you can use:

    (DT_DBTIMESTAMP2,3)(DT_DBTIMESTAMP2,0)GETDATE()

  • Thank you very much - worked perfectly!

  • Hey,

    Am trying to add an timestamp column by using derived column but i dont want to get the milliseconds. i tried using the expression which is mentioned above but am unable to ignore the failure, it again goes back to "fail component" . can u help me with the expression?

    Thanks,

Viewing 6 posts - 1 through 5 (of 5 total)

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