I have a very simple query
I want to run this query to run automatically on a daily basis and save the results in excel. Is their any way I can achieve this purpose?
I tried using SQL server jobs but the output excel file was corrupted and could not be opened. I choose the target file as an excel file which was already not present in the system.After the job executes successfully, it creates the excel but I couldn't open it, it says the file is corrupted.
I tried creating a package using Export Data option from SQL Server Management Studio. I followed steps from here -
Simple way to export data from SQL Server
But I am extremely confused on how to schedule the package. I don't even know if I created the package correctly. I tried several times but every time I got different errors. Is there any simple and easy way to achieve this purpose?
Thank you for your guidance.
C#:
Select * from Employees
where company = 'Company A'
order by firstName
I want to run this query to run automatically on a daily basis and save the results in excel. Is their any way I can achieve this purpose?
I tried using SQL server jobs but the output excel file was corrupted and could not be opened. I choose the target file as an excel file which was already not present in the system.After the job executes successfully, it creates the excel but I couldn't open it, it says the file is corrupted.
I tried creating a package using Export Data option from SQL Server Management Studio. I followed steps from here -
Simple way to export data from SQL Server
But I am extremely confused on how to schedule the package. I don't even know if I created the package correctly. I tried several times but every time I got different errors. Is there any simple and easy way to achieve this purpose?
Thank you for your guidance.