Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a SQL view which I use to create a report and copy it to excel and send it to the person ho want it. I want to do it automatically which send him daily or weekly report by email so that I don't have to do it every time. Can anyone tell me how to do it?

What I have tried:

Sql View to create a report Import that in excel
Posted
Updated 1-Nov-17 4:22am

The easiest way I can think of, without having to write any code, would be to create an SSRS report and allow the user to subscribe to it.
 
Share this answer
 
Another alternative would be to set up an SSIS package and a SQL Agent job to run it ... SQL Server Agent | Microsoft Docs[^]. Watch out for issues when overwriting an existing spreadsheet - see Overwriting an Excel file destination using SSIS | Samuel Haddad[^] for a solution

or ...

Have a spreadsheet with a data connection to the database and have that refresh the data on demand (depends on where your user is in relation to your network I guess ... inside or outside the firewall)

Also check out this CodeProject article - How To Send Mail Using SQL Server: Part 1[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900