Reputation: 2434
I have an SSIS package that runs without errors locally. It is then deployed to the catalog and run in a SQL Agent job. Functionally, the job runs correctly and all data is where it should be, but it always kicks out this error:
The expression for variable "TextMaxDate" failed evaluation. There was an error in the expression.
I have not been able to find a more meaningful message. The SSIS package has three variables...
TextMaxDate
DateTime
@[User::TextMaxDate]
TextSQL_Content
String
"SELECT CREATED_DATE, ID, TEXT FROM SRC_SCHEMA.SRC_TABLE_1
WHERE CREATED_DATE BETWEEN '" + (DT_STR, 12, 1252)(DT_DBDATE) DATEADD("day",1,(DT_DBDATE)@[User::TextMaxDate]) + "' AND '" + (DT_STR, 25, 1252) (DT_DBDATE) DATEADD( "day", - 1 , (DT_DBDATE) GETDATE() ) + "'"
TextSQL_NoContent
String
"SELECT ID, CREATED, CREATED_BY, TEXT FROM SRC_SCHEMA.SRC_TABLE_1
WHERE CREATED_DATE BETWEEN '" + (DT_STR, 12, 1252)(DT_DBDATE) DATEADD("day",1,(DT_DBDATE)@[User::TextMaxDate]) + "' AND '" + (DT_STR, 25, 1252) (DT_DBDATE) DATEADD( "day", - 1 , (DT_DBDATE) GETDATE() ) + "'"
and follows this flow...
Execute SQL Task
select max(cast(created_date as date)) MaxDate from DEST_SCHEMA.table_1
. MaxDate
and Variable Name to User::TextMaxDate
Data Flow Task (Oracle Attunity Driver)
@[User::TextSQL_NoContent]
TEXT
column so that it is null for each inserted record.Data Flow Task (OLE DB Source Editor)
SQL command from variable
User::TextSQL_Content
Execute SQL Task
UPDATE DEST_SCHEMA.TABLE_1 SET DEST_SCHEMA.TABLE_1.TEXT b.TEXT from DEST_SCHEMA.TABLE_1 a join DEST_SCHEMA.TABLE_2 b on a.id = b.id where a.TEXT IS NULL
Why is this error occurring?
Upvotes: 2
Views: 703
Reputation: 37348
Why writing an expression to set @[User::TextMaxDate]
= @[User::TextMaxDate]
!!
Just remove the expression and set EvaluateAsExpression to False
. Also make sure that
select max(cast(created_date as date)) MaxDate from DEST_SCHEMA.table_1
is returning a value.
Upvotes: 1