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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • 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