Click here to Skip to main content
15,895,142 members
Articles / Database Development / SQL Server

Export a complete database to an Excel file

Rate me:
Please Sign up or sign in to vote.
4.76/5 (28 votes)
19 Mar 2008CPOL2 min read 106.9K   2.4K   85  
Export all tables and data to an Excel file.
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <appSettings>
    <add key="SQLUN" value=""/> <!--User name for SQL Server connection (leave blank if integrated security)-->
    <add key="SQLPW" value=""/> <!--Password for SQL Server connection (leave blank if integrated security)-->
    <add key="SQLServer" value="(local)"/> <!--Location SQL Server-->
  </appSettings>
    <connectionStrings/>
    <system.web>
      <compilation debug="true" strict="false" explicit="true">
        <!--Add this assembly for converting datatable to recordset!!-->
        <assemblies>
          <add assembly="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
        </assemblies>
      </compilation>
        <pages>
            <namespaces>
                <clear />
                <add namespace="System" />
                <add namespace="System.Collections" />
                <add namespace="System.Collections.Specialized" />
                <add namespace="System.Configuration" />
                <add namespace="System.Text" />
                <add namespace="System.Text.RegularExpressions" />
                <add namespace="System.Web" />
                <add namespace="System.Web.Caching" />
                <add namespace="System.Web.SessionState" />
                <add namespace="System.Web.Security" />
                <add namespace="System.Web.Profile" />
                <add namespace="System.Web.UI" />
                <add namespace="System.Web.UI.WebControls" />
                <add namespace="System.Web.UI.WebControls.WebParts" />
                <add namespace="System.Web.UI.HtmlControls" />
                <!--<add namespace="System.Data"/>
                <add namespace="System.Data.SqlClient"/>-->
            </namespaces>
        </pages>
        
        <authentication mode="Windows" />
        
    </system.web>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Centric Netherlands
Netherlands Netherlands
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions