Here are the basics on exporting to excel. We will build on this action in the next two videos to build complex reports.

When finalizing your SQL queries you might need to send the results to an end user.

The easiest way to deploy a report based on a SQL result is to export to excel. Toad Automation can help you build a variety of Excel reports ranging from simple data dumps to attractive complex reports. Let’s take a look at how to do this.

Toad Automation Export

The Select to File activity is built to execute simple data dumps to Excel, csv or html.

If you want to run exports repetitively and keep all of the results you can append worksheets to an existing Excel file. Just remove the Overwrite option. You can also give each work sheet a name and append a timestamp. (In TDP 3.3 and above this option is available in the export wizard only) This is good if you want to compare the data in tables from a week to week basis. To do the compare you can use one of our compare tools.

Toad Automation Export Wizard

However, you might want to run several queries and put them in the same Excel workbook but on different worksheet. You can do this by entering a script with all of your SQL In this case each SQL will be executed and be exported to separate worksheets.

About the Author

Debbie Peabody

Debbie Peabody is a Software Development Team Lead. She joined Quest in 1997 coding for Quest’s SQL Tuning product SQLab. She brings many years of experience of development on database tool products and co-designed Toad Data Point.

Notable Replies

  1. says:
    sunitha81

    I have a automation script with multiple select statements and the output gets saved into a single workbook -multiple sheets. I would like to rename the sheets and don’t see an option to do in under Select to File activity -Export Options or Export Wizard template options. I am using TDP 4.2 & 4.3 version.

    Please advise
    Thanks
    Sunitha

  2. says:
    alex.nordeen

    Rename your worksheets in the output file, and then in the Advanced Export Properties window define the worksheet name for each select statement by clicking on Advanced Properties in the Export File subsection.