当我有一个执行SQL任务,我有日期时间变量和日期列的空白或空值
Select '' AS [CancelledDate] from TableX
我映射此列称为CancelledDate
数据随时间变化的,但是当我运行在Execute Sql Task
我得到这个错误:
Error: 0xC002F309 at Sp Get Parameter for SP2, Execute SQL Task: An error occurred while assigning a value to variable "CancelledDate": "String was not recognized as a valid DateTime.". Task failed: Sp Get Parameter for SP2
如果我更换''
与'01-JAN-1978'
它的工作原理。这在列中必须有Null
和''
的问题。
我试图把NULL(DT_DATE)
放在变量中,并将表达式评估为True,但这也不起作用!
另外,如果你映射此为.NET DateTime的结构,你可能需要使用的DateTime?类型。 – yelxe