Easiest Way to Output Query Results to Excel, then Email Report

  • Hi Experts,

    I have SQL 2019 Standard.

    I'm looking for a simple solution to generate an excel file from a query.

    Then the file will be emailed to external recipients, outside the company.

    would an SSIS package be the best option?


  • SSIS is a good tool for that, but save yourself some trouble and export it as a csv unless someone complains.

  • As I have stated in your thread at SQL Teams - using SSIS for what you are trying to accomplish is going to be much more work than utilizing SSRS.  With that said, if all you need is a simple file that can be opened in Excel then using a CSV file is a much better and easier process than creating an actual Excel file.

    But - since you have stated you must have a formatted Excel report and not just a simple column based spreadsheet, then I will say again that SSRS and using a data-driven subscription is the better option for what you are attempting to accomplish.

    Note: Either way - you need Visual Studio 2019 for the SSDT tools to be able to build either SSIS or SSRS projects.  You can download and use the Community Edition and add the SSIS/SSRS extensions to be able to develop a solution.

    Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply