I have an SSIS package that runs an SQL query and exports it to a csv file via a Data Flow Task. After the csv is created, I have a \"Script Task\" set to connect to an SMTP ser
I faced a similar situation earlier, where everything works fine in SSDT(SQL Server Data Tools - which is Visual studio interface) and when my package is deployed in SSMS, just the script task was failing.
Using SSIS 2012, I was loading an excel sheet and then in the script task, I was calling an Excel macro to sort and highlight the differences in the sheet. Everything was working fine in the SSDT environment but when I ran in SSMS (as a Scheduled Job - 32 bit mode), The script task was not executing. However, I could see the Excel sheet loaded with raw data - without sorting and highlighting the differences.
No errors were captured in SSMS package execution logs. As highlighted by @Tab Alleman in the comments section, some of the errors were logged in the Event viewer. In my case, the error was logged under WindowsLogs > System
Which showed permission errors for SQLSERVERAGENT while accessing Microsoft SQL Server Integration Services 11.0.
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {FDC3723D-1588-4BA3-92D4-42C430735D7D} and APPID {83B33982-693D-4824-B42E-7196AE61BB05} to the user NT SERVICE\SQLSERVERAGENT
And then after granting appropriate access (Steps to grant access is described here), I received one more permission error while the account tried to access Excel
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {00024500-0000-0000-C000-000000000046} and APPID {00020812-0000-0000-C000-000000000046} to the user NT SERVICE\SQLSERVERAGENT
Even after resolving all the permission errors, I still couldn't see the expected output. So I increased the custom logging (refer here for steps) for the script task. Then I was able to see the exceptions raised in the script task. My catch block looks something like the one below:
catch (Exception ex)
{
Dts.Log(ex.ToString(), 0, emptyBytes);
}
Which will log the errors in the sysssislog table (which you must have configured while configuring custom logging)
select * from [*YourDatabaseName*].[dbo].[sysssislog]
Should list down your custom logs.