Posts Tagged ‘email’

How to email result query from SQL Server

To send the result via email in sql server use the sp_send_dbmail procedures but before you execute that sp you need to enable the Database Mail using the Configuration Wizard or use the sp_configure

Example:

EXEC msdb.dbo.sp_send_dbmail
@profile_name = ‘MyProfilename’,
@recipients = ‘myemail@gmail.com’,
@query =’SELECT * FROM tblname,
@body = ‘Description.’,
@subject = ‘Subject’ ;

Read More

, ,

No Comments



SetPageWidth