如果您不了解DbMail,先看sp_send_dbmail.具体的T-SQL如下:
 
   1:  SET ROWCOUNT 0 
   2:  EXEC msdb.dbo.sp_send_dbmail
   3:  @profile_name = 'Your_Server_Profile',
   4:  @recipients = 'recipient.1@xyz.com; recipient.2@xyz.com',
   5:  @body = 'Reports 1 and 2 are attached',
   6:  @file_attachments = 'C:\Report Folder\Report1.TXT;C:\Report Folder\Report2.TXT',
   7:  @subject = 'Reports 1 and 2 are attached' ;

     注意你必须设置rowcount为0,希望对您有帮助。

Petter Liu Blog。

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2021-11-18
  • 2021-11-13
  • 2022-12-23
  • 2021-12-28
  • 2021-12-03
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
相关资源
相似解决方案