SQL Server export/email results automatically
Posted on 2012-04-05
In SQL Server 2000, I am looking to run a query automatically on a regular basis and then have the results exported to an .XLS file which then will be emailed as an attachment.
Can this be setup automatically as a JOB or Stored Procedure? I would prefer .xls format rather than .csv. I need to edit the results in Excel, if it is in the .CSV format- the leading zero's get cut off when opening in Excel. If the results cannot be emailed as an attachment but you know how to automate the export as an .XLS file (or CSV without cutting off the leading zero's when opening in Excel) - please let me know. Thanks.