有时,执行发邮件的存储过程(带附件):
msdb.dbo.sp_send_dbmail
@profile_name = 'Seagull2DBMail',
@recipients = 'v-白丹丹 <v-baidd@sinooceanland.com>',
@subject = '反馈前50条执行时间比较长的语句',
@file_attachments='\\10.0.9.137\bcp\bcp_10.0.8.103\top_sql.xls'
报错:
Failed to open attachment file '\\10.0.9.137\bcp\bcp_10.0.8.103\top_sql.xls'.Executing API 'CreateFile' failed with error number 32
出错原因:该附件已经被打开。
解决办法:将该附件关闭。