Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 E-mailing a report from sql server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-06-18 : 09:16:39
Laura writes "Is there a way to take a report that runs nightly on sql server and email the result set to a specified list of users?"

Andraax
Aged Yak Warrior

790 Posts

Posted - 2002-06-18 : 09:37:49
Hi Laura!

Yes there is!

You can schedule jobs which use the xp_sendmail extended stored procedure to send query results by mail. For example:

exec xp_sendmail @recipients='kalle@hotmail.com', @query='select * from table1', @subject='Nightly report'

Look up xp_sendmail in books online for more paramters.

Regards,
Kalle Dahlberg

Go to Top of Page
   

- Advertisement -