Export all tables of database to Excel

  • Hi to everybody

    How can I export all tables of a database to one excel file (each table should be one spreadsheet in the excel file) by using SQL Code?

    Important remarks:

    - The export should be generated via (T-)SQL Code not else how

    - The Excel File should be created by SQL Code (it does not exist in advance)

    - The tablenames are dynamic; I don't know the names in advance. Therefore the skript should dynamically read table names (using something like a for-loop)

    - I am using SQL Server 2008 R2

    - I am using MS Office 2007

    Any ideas?

    Thanks a lot for your support in advance

    Angeline

  • Angeline87 (2/16/2013)


    Hi to everybody

    How can I export all tables of a database to one excel file (each table should be one spreadsheet in the excel file) by using SQL Code?

    Important remarks:

    - The export should be generated via (T-)SQL Code not else how.

    - I am using SQL Server 2008 R2

    - I am using MS Office 2007

    Any ideas?

    Thanks a lot for your support in advance

    Angeline

    Check this please... http://www.sqlservercentral.com/Forums/Topic1206241-1291-1.aspx

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Just fixing up the link for future onlookers:

    http://www.sqlservercentral.com/Forums/Topic1206241-1291-1.aspx

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

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

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