Exporting Data from Your Database

< Previous section  |  Table of Contents  |  Index  |  Next section >

MBUtility has several ways to export selected data from your database to an output file. For example, you might regularly wish to export data to another application for some reason; by making a command file that uses MBUtility, you could automate the export process, thereby simplifying the task (and also avoiding errors).

The command line for exporting all the tables in your database is

mbutility ExportAll option option ...

where the options are:

Tells MBUtility to embed data schemas for the tables in the output file. This is useful if you're exporting the data to software that accepts embedded schemas.
Tells MBUtility not to embed data schemas in the output file. This is the default.
Tells MBUtility not to export information from deleted records.
Tells MBUtility to export information from deleted records.
Specifies a file where the output should be written. This file will be written in Unicode characters, which means it should only be edited with software that can deal with Unicode (e.g. Wordpad).
The name of the maintenance organization (associated with your MainBoss database). This name is case-insensitive; for example, MainBoss is the same as mainboss.
The name of the server that holds the MainBoss database.
The name of the MainBoss database.

If you specify /OrganizationName, you don't have to specify either /DataBaseServer or /DataBaseName. If you don't specify /OrganizationName, you must specify both /DataBaseServer and /DataBaseName.

For example,

mbutility exall /out:mytables /on:MyMainBoss +es

exports data about units to a file named mytables. The output file will include embedded data schemas.

Exporting a Specific Table: The Export verb is similar to ExportAll, but it exports a single data table rather than all of them. Export accepts all of the options accepted by ExportAll. In addition, it takes the following:

Specifies a data schema for exporting the data; this option is mandatory. The named schema should be one of MBUtility's built-in schemas (as discussed in Built-In Data Schemas). If the schema name contains blank characters, the name should be enclosed in quotes, as in
/si:"Storeroom Assignment"
Tells MBUtility you plan to read the exported data into Microsoft Excel. In this case, MBUtility writes out two files: one containing the schema and one containing data that refers to the schema. Both files are written to the same directory and have the same base name (specified by the /Output option); however, the schema file has the file name extension .xsd while the data file has .xml. For example, if you specify /Output:mydata, you'd end up with mydata.xsd and mydata.xml.

+EXCEL cannot be used in conjunction with +EmbeddedSchema.

For more on using Excel with exported data, see An Example of Exporting to Excel 2007, An Example of Exporting to Excel 2010, or An Example of Exporting to Excel 2013.

< Previous section  |  Table of Contents  |  Index  |  Next section >