SQL Server 2005でメールを送信する機能


SQL Server 2005のメール送信機能の概要
SQL Server 2005でメールを送信:
 

  
  
  
  
  1. EXEC msdb.dbo.sp_send_dbmail  
  2.     @profile_name = 'test',  
  3.     @recipients = '[email protected];[email protected]',  
  4.     --@recipients = '[email protected]',  
  5.     @body = ' msdb.dbo.sp_send_dbmail , , ',  
  6.     @subject = '  sql ',  
  7.     @query = ' select  =name, =case xtype when ''S'' then '' '' else '' '' end from sysobjects where xtype in(''U'',''S'') ',   
  8.     @attach_query_result_as_file = 1,  
  9.     @query_attachment_filename = 'Results.txt'