1

I am trying to insert the system:starttime variable into a table by passing a parameter into an execute sql task.

I dont have much knowledge of SSIS data types, and I am currently having trouble making this functionality work. When I set the parameters datatype to nvarchar, the date is always inserted as 1/1/1900. When I use the DBDATE type, the insert fails with the following error

unsupported data type on parameter binding 0

So my question is how do I pass a SSIS date variable into an execute sql task so that SQL Server can interpret it correctly?

  • Perfect answer here blog.hoegaerden.be/2011/06/11/… – aasim.abdullah Oct 28 '14 at 10:01
  • @aasim.abdullah: It would be a good idea to summarize the content of that link in an answer, that way if the link dies at a later date (and StackExchange doesn't) the information is still available here. Include the link in the answer of course for people who want more detail and for giving credit to the source. – David Spillett Oct 28 '14 at 10:16
  • @aasim.abdullah - Thanks for the link, as recommended I tried using the "DATE" datatype (not "DBDATE") and it worked like a charm! – Neil P Oct 28 '14 at 10:18
  • @David sure buddy – aasim.abdullah Oct 28 '14 at 10:24
1

According to BOL DT_DBDATE is "A date structure that consists of year, month, and day". Which can't be used to store System::StartTime output as its DATETIME by data type, so try to use datatype DT_DATE instead of DBDATE. As datatype DT_DATE "A date structure that consists of year, month, day, hour, minute, seconds, and fractional seconds. The fractional seconds have a fixed scale of 7 digits."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.