Sending Result set data in an email

Last Post 24 Apr 2008 11:27 PM by SQLUSA. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
PaulMcKibben
New Member
New Member

--
24 Apr 2008 01:42 PM
Has anyone sent the result set data in the body of an email before?

I am not talking about building a flat file out of a query and then attaching it to the email.

Thank you.
Paul
SQLUSA
New Member
New Member

--
24 Apr 2008 11:27 PM
Yes.

EXEC msdb.dbo.sp_send_dbmail
@recipients = 'support@abcxyz.com',
@query = 'select * from AdventureWorks.HumanResources.Department' ,
@subject = 'Deparment Summary'

Kalman Toth - Database, Data Warehouse & Business Intelligence Architect
SQL Server Training, SSAS, SSIS, SSRS: http://www.sqlusa.com/order2005grandslam


Acceptable Use Policy
---