patternsqlMinor
SSIS - insert system date variable as a execute sql task parameter
Viewed 0 times
insertsqlssissystemdateparametervariabletaskexecute
Problem
I am trying to insert the
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
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?
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 errorunsupported data type on parameter binding 0So my question is how do I pass a SSIS date variable into an execute sql task so that SQL Server can interpret it correctly?
Solution
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."Context
StackExchange Database Administrators Q#81263, answer score: 3
Revisions (0)
No revisions yet.