Start a new topic

Export multiple results tabs to an Excel workbook

[This topic is migrated from our old forums. The original author name has been removed]

Hi - Is it possible to export the output of several queries all run at once that generates several tabs in the result set window to one MS Excel workbook where each result set is stored in a separate tab in the Excel workbook. Failing that, even if all the results were stored in one Excel worksheet,that would be fine too. All I can find online is to export each result set separately which is a pain. Thank you Conor

[This reply is migrated from our old forums. The original author name has been removed]

Re: Export multiple results tabs to an Excel workbook
I got it to work with the following commands in case it helps anyone else: @export on; @export set filename="C:\My Data\SQLResults\CEMAnswer.xls" AppendFile="clear" Format="xls"; ++ @export off;
[This reply is migrated from our old forums. The original author name has been removed]

Re: Export multiple results tabs to an Excel workbook
Yes, that's how it's done. Note that in the new 9.2.1 release you also have the ability to set the label for each individual sheet by using the command: @export set ExcelSheetName = "My Sheet Name"; ... before each SQL statement.