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
 General SQL Server Forums
 New to SQL Server Programming
 Automate mailing of Excel Report

Author  Topic 

pushp82
Yak Posting Veteran

83 Posts

Posted - 2012-09-19 : 01:55:18
Hi Team,

I need to fetch a report from database based on multiple query on daily bases and mail to team. I don't have BI so how can I accomplish this task with SSMS.

I can use sp_send_dbmail to attach the file but which would be the easiest way to fetch records in excel and save to particular destination.

Export wizard is really wearied in term of formate and I could not successes with multiple query report in one sheet.

Please guide.

Thanks
Pushp

jackv
Master Smack Fu Yak Hacker

2179 Posts

Posted - 2012-09-19 : 10:43:47
Using T-SQL and SSMS
http://codebetter.com/raymondlewallen/2005/05/04/generate-an-excel-xls-spreadsheet-from-t-sql-in-sql-server/

You could also then convert and save it to a HTML file - which makes the attachment smaller and more versatile.
http://www.sqlserver-dba.com/2012/01/sql-server-powershell-excel-to-html.html

Jack Vamvas
--------------------
http://www.sqlserver-dba.com
Go to Top of Page
   

- Advertisement -