I am zipping a file using an Execute Process Task and sending an email with the attachment using an Execute SQL Task (using sp_send_dbmail).
If I do not zip the file, the email works correctly and the attachment (an .xls file) is sent with no problems. However if I zip the file and run the Execute SQL Task, I get the following error:
[Execute SQL Task] Error: Executing the query "EXEC [msdb].[dbo].[sp_send_dbmail] @profile_name ..." failed with the following error: "Failed to open attachment file 'C:\SQLServer2008…\TheFile.zip'. Access denied.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Both .xls and .zip files reside in the same location and have the same permissions. I have confirmed that .zip files are not included in the “Prohibited Attachments” in the Database Mail config. And of course, the zip file is much smaller than the .xls file, so it’s not a file size issue.
I have looked at the Database Mail log, but it does not record the unsuccessful attempts with the zip file.
I still claim ‘newbie status’ and am not sure where to look to see why it won’t email. If you can provide some insight, I would be greatly appreciated!!
If I do not zip the file, the email works correctly and the attachment (an .xls file) is sent with no problems. However if I zip the file and run the Execute SQL Task, I get the following error:
[Execute SQL Task] Error: Executing the query "EXEC [msdb].[dbo].[sp_send_dbmail] @profile_name ..." failed with the following error: "Failed to open attachment file 'C:\SQLServer2008…\TheFile.zip'. Access denied.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Both .xls and .zip files reside in the same location and have the same permissions. I have confirmed that .zip files are not included in the “Prohibited Attachments” in the Database Mail config. And of course, the zip file is much smaller than the .xls file, so it’s not a file size issue.
I have looked at the Database Mail log, but it does not record the unsuccessful attempts with the zip file.
I still claim ‘newbie status’ and am not sure where to look to see why it won’t email. If you can provide some insight, I would be greatly appreciated!!