Re: How to export whole SQL database to MS Excel Workbook

Subject: Re: How to export whole SQL database to MS Excel Workbook
From: Ned Bedinger <doc -at- edwordsmith -dot- com>
To: Ronald Schwarz <RSchwarz -at- cosmocom -dot- com>
Date: Sat, 29 Dec 2007 11:08:51 -0800

Ronald Schwarz wrote:
> I have to document how 50% of the SQL tables in an application relate to
> the user interface configuration menus so that the user can trace
> through a configuration audit trail.

How many tables are we talking about?

> Can someone explain how to export the entire SQL database to a MS Excel
> Workbook?

Read a high-level description at:

Then read about the SQL Server Import Export Wizard online at MSDN.

I can only export one table at a time to a spreadsheet in
> order to capture the column headings of the tables.

This sounds like the Bulk Copy method using bcp.exe (for a list of all
the bcp parameters and options you don't need, and a few you might need,
search MSDN or SQL Server Books Online for 'bcp export.' If you let bcp
use its defaults (export the table as tab-delimited character data with
line-end character for row-ends), then Excel ought to be able to suck it
in. Not sure if bcp can write your data to Excel with the table name and
everything, but if the only other choice you had was to go a-reading
bushels of SQL Server documentation that may or may not lead to an
updated procedure for exporting an entire database to Excel, I believe
I'd go the default bcp route and make the necessary edits to get the
worksheet names (and column data types, where useful) right.

For a few tables, I
> also need the records in order to view the values of various settings in
> the application.

My comment about data types is with respect to this requirement only.

> The MS SQL Server Management Studio online help does not have an answer
> and I cannot write SQL or VBS scripts to automate the process.

I think you could pick that stuff up in a weekend. The hard part, the
biggest time sink when ramping up on MS data acces code, at least when I
learned it, was finding a source of good examples to copy -- the syntax
for identifying and connecting to the database, and then exporting the
data in a given format, was always wrong in the manuals, for years it
seems but maybe that perception is due to how much of a drag it is to be
misled by putative examples FROM THE VENDOR.

Anyway, actually, the tool for $29 that Jan suggested looks like a great
value compared to the hour or two you'd spend wrangling with the Export
Wizard, bcp, or any of the many other circuituous routes by which one
might recreate an application configuration database in Excel after the
application developers went to all the trouble of putting it in SQL

Good luck.

Ned Bedinger
doc -at- edwordsmith -dot- com


Create HTML or Microsoft Word content and convert to Help file formats or
printed documentation. Features include support for Windows Vista & 2007
Microsoft Office, team authoring, plus more.

True single source, conditional content, PDF export, modular help.
Help & Manual is the most powerful authoring tool for technical
documentation. Boost your productivity!

You are currently subscribed to TECHWR-L as archive -at- web -dot- techwr-l -dot- com -dot-

To unsubscribe send a blank email to
techwr-l-unsubscribe -at- lists -dot- techwr-l -dot- com
or visit

To subscribe, send a blank email to techwr-l-join -at- lists -dot- techwr-l -dot- com

Send administrative questions to admin -at- techwr-l -dot- com -dot- Visit for more resources and info.

How to export whole SQL database to MS Excel Workbook: From: Ronald Schwarz

Previous by Author: Re: Useful telcom, network and billing web sites
Next by Author: Re: Listing publications on a CV?
Previous by Thread: Re: How to export whole SQL database to MS Excel Workbook
Next by Thread: Re: How to export whole SQL database to MS Excel Workbook

What this post helpful? Share it with friends and colleagues:

Sponsored Ads