Reputation: 59
I am trying to use a global variable value as the message source for a Send Mail Task in SSIS.
I am using some of the system variables like @[System::PackageName] and @[System::TaskName] to build a message when the task succeeds or fails, but unfortunately, the message source value doesn't get populated with anything when I execute the task.
Can someone please tell me how I can get this to work?
Sample code below
"Package: " + (DT_WSTR, 50) @[System::PackageName] + " executed at " + (DT_WSTR, 30) @[System::StartTime] + " on " + "Task: "+ (DT_WSTR, 60) @[System::TaskName]
Thanks
Upvotes: 0
Views: 2498
Reputation: 448
I've simulated your process, and if I understand you correctly, then the problem is that you try to add "system variable" (@[System::TaskName]) that cannot be added on the variable expression and the reason is that the variable is not a task and it couldn't tell which task to refer to.
when I delete the @[System::TaskName] its work perfectly
Upvotes: 1