I have a simple package that flows data from point A to point B - in the middle is a row count transformation that populates a variable of type Int32
.
After the Data Flow Task, I have a simple Execute SQL Task with an update statement:
UPDATE [SAP].[SAPCopyInfo]
SET [endtime] = GETDATE(),
[MSEGCnt] = ?
WHERE [BegTime] = CAST(GETDATE() AS DATE)
I have mapped my variable as a parameter like so:
When I execute the package, the Execute SQL Task (named 'Update Log') shows success:
The variable watch shows that intMSEGCnt
is populated correctly:
Yet the table doesn't update - and there are no errors in the output window:
Manually executing the UPDATE
SQL in SSMS works fine (replacing ? with the correct value), so it doesn't appear to be a permissions issue.
I've tried various iterations of the 'Data Type' for the Parameter Mapping, yet nothing works.
I've even de-parameterized the UPDATE
statement and run it directly in the Execute SQL Task with hardcoded values and it still doesn't work.
What am I missing?
Sometimes you just need another set of eyes - thanks to @GSerg & @T N
The answer was to simply change the UPDATE
query to this:
UPDATE [SAP].[SAPCopyInfo]
SET [endtime] = GETDATE(),
[MSEGCnt] = ?
WHERE CAST([BegTime] AS DATE) = CAST(GETDATE() AS DATE)