SSIS is changing the hour part of datetime returned from a stored procedure

  • I have a an ssis package where I am calling a stored proc from. When I run the stored proc in ssms the value returned is '2020-03-06 16:41:47.040'. When I run the sproc in an execute sql task and set the result to an ssis variable of type datetime it changes the value to 3/6/2020 4:41:47 PM inside the ssis package cutting off the milliseconds. I need the milliseconds to remain. Is there a way to stop ssis from dropping off the milliseconds?

  • Try using DT_DBTIMESTAMP as your SSIS datatype.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • I'm saving the value in an ssis variable and the only date datatype is Datetime. I tried setting it as string and have the same issue.

  • OK, it's not very elegant, but using this

    SELECT RightNow = convert(VARCHAR(30),GETDATE(),21)

    and saving to a string worked for me.

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

  • Thanks Phil, that Got'r Dun.

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

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