June 28, 2010 at 7:15 am
How can I Export a result of a query to an excel file and sent this filre to an e-mail?
I need to do this in a Job in a specific hour of the day.
Thanks for your help
Viky
June 28, 2010 at 8:15 am
If you want to extract the data from the database in a format readable in Excel, use xp_sendmail extended stored proc. It can execute the query, put results into the file and send an email with this file as an attachment. Your first point of referece is:
http://msdn.microsoft.com/en-us/library/ms189505.aspx
Please note, don't try to create file with .xls extention. Extract your data as comma separated .csv file.
You can setup scheduled SQL Job (SQL Server Agent) to execute your required task regulary at the required time.
June 28, 2010 at 8:16 am
Do you have a question about that or are you just makeing a random comment?
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply