question

eleni avatar image
eleni asked

how do a way to zip the file first (what are the commands?) and then send the file using sp_send_dbmail

Dear sir, Is there a way to zip the file first (what are the commands?) and then send the file using sp_send_dbmail? My step in a job is as below: EXEC msdb.dbo.sp_send_dbmail @ recipients=N'Elena.Iasonos@bankofcyprus.com', @body='Dear Recipient, Please find attached the Users Audit Logs Report. -- Sent from Batch Emailer Automated Process. *** Note that this is an automated process. This email has been sent from a non-monitored email account. Please do not reply. ', @subject ='Users Audit LOgs - Report File - TEST',@profile_name ='BatchEmailer',@file_attachments ='H:\AutoReporting\UsersAuditLogsReport.xls';
zip
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Can you put a step before this one and use Powershell to zip up the file? Or you could do something like this post suggests: http://stackoverflow.com/questions/26312483/create-zip-file-from-sql-server Note: I've never tried it that way so YMV.
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.