How to email results of a select statement?
Need help in creating a job which emails results of a SELECT command.
August 31st, 2015 1:53am

EXEC msdb.dbo.sp_send_dbmail 
     @profile_name = 'Name', 
     @recipients = 'ttt@gmail.com', 
     @query = 'SELECT COUNT(*) FROM AdventureWorks.Person.Address', 
     @subject = 'Error Log Count', 
     @attach_query_result_as_file = 1 ;
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2015 3:07am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics