SQL Agent could not set a Value for a Date Time variable
Hi, I'm trying to pass a Date as a parameter from SQL Server Job Agent (2008 R2) to an ETL. /SET "\Package.Variables[pPeriodoDesde].Value";"01/10/2012" And when I try to execute it, I get the error: DTExec: Could not set \Package.Variables[pPeriodoDesde].Value value to '01/10/2012'. The variable in the ETL is a Date Time and package scope is set. I already tried to set the value without "" ( /SET "\Package.Variables[pPeriodoDesde].Value";01/10/2012) but I get the same error. Any ideas? Thank you!
December 3rd, 2012 12:43pm

Hi, Maybe there is any other workaround, but i use 2 variables. 1st variable is data type string and this will be set from outside. 2nd variable is data type datetime and is evaluated as expression and expression is (DT_DATE)@1stVAriableName. Simply I set 1st variable as text and second variable automatically convert this text to date. Hope someone has better solution for this, but this works also. Zdenek Please mark as helpful and propose as answer if you find this as correct!!! nosekz.eu
Free Windows Admin Tool Kit Click here and download it now
December 3rd, 2012 1:14pm

Hi fabianae, Please refer to the following code to execute the SSIS package: dtexec /FILE "C:\Package.dtsx" /set \package.variables[User::pPeriodoDesde].Value;"01/10/2012" Details please see: http://consultingblogs.emc.com/jamiethomson/archive/2005/10/11/ssis_3a00_-how-to-pass-datetime-parameters-to-a-package-via-dtexec.aspx Thanks, Eileen If you have any feedback on our support, please click here Eileen Zhao TechNet Community Support
December 12th, 2012 2:22am

Hi fabianae, Please refer to the following code to execute the SSIS package: dtexec /FILE "C:\Package.dtsx" /set \package.variables[User::pPeriodoDesde].Value;"01/10/2012" Details please see: http://consultingblogs.emc.com/jamiethomson/archive/2005/10/11/ssis_3a00_-how-to-pass-datetime-parameters-to-a-package-via-dtexec.aspx Thanks, Eileen If you have any feedback on our support, please click here Eileen Zhao TechNet Community Support
Free Windows Admin Tool Kit Click here and download it now
December 12th, 2012 10:19am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics