Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Export all tables of database to Excel Expand / Collapse
Author
Message
Posted Saturday, February 16, 2013 5:44 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Sunday, February 17, 2013 5:32 AM
Points: 9, Visits: 18
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
Post #1420935
Posted Saturday, February 16, 2013 5:56 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 8:12 AM
Points: 2,982, Visits: 4,399
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.
Post #1420936
Posted Monday, February 18, 2013 7:06 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 9:55 AM
Points: 6,713, Visits: 11,747
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

Believe you can and you're halfway there. --Theodore Roosevelt

Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein

The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein

1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
Post #1421202
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse