SQL -> XLS Automatically?

  • Hey all,

    I have a monthly process, a part of this empties and repopulates 3 tables.

    Another colleague requires the output of these 3 tables in Excel.

    Currently, its a very simple case of SELECT * from ... for each of the 3 tables, paste the results of each query in to an excel tab and save the file.

    It would be really great if as part of the monthly process it did this automatically, or if I could create a job and run the job as and when I saw fit etc (but ideally part of the monthly process)

    I looked at this some time ago - something to do with using the MS Jet thing, but I kept getting errors!

    Any ideas?

    So, to sum up, basically:

    SQL Query 1 results -> Excel Tab 1

    SQL Query 2 results -> Excel Tab 2

    SQL Query 3 results -> Excel Tab 3

    Entire spreadsheet saved somewhere on our local network drives

    All executed from the same stored procedure which creates them in the first place ideally...

  • In SQL Server, you can accomplish this via SSIS/DTS. You can also do this via excel by querying the database, to include writing some VBA code that allows spreadsheet to be updated at the click of a button.

    You have options, remember, repetitive tasks are great tasks to automate

    Marvin Dillard
    Senior Consultant
    Claraview Inc

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

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