I have a web portal in which user download excel sheet which is being generated from SQL Server 2008 Table.I want way to automate this process say after each one hour updated excel sheet (which is being derived from sql table) should directly get sent to specified E-mail address.
I have Code which Converts DataTable to Excel.
SQL Server 2008 - Database Mail
Using above i can schedule my stored procedure to run after 1 hour but how can i generate excel sheet from it and send it as attachment ?
Any another way to achieve same ?
You can achieve this in 2 ways
1) You can use Windows Service as Rajashekar said either
2) You can create a SSIS package to generate excel file and send email. Once done create a job to run this SSIS package every 1 hour
Below is the sample link to create excel file dynamically
http://www.codeproject.com/Articles/402958/SSIS-Package-Export-Data-from-Database-Daily-to-Ne
The other link to send email with attachments is below
http://www.codeproject.com/Articles/85172/Send-Email-from-SSIS-with-option-to-indicate-Email