How to generate database documentation from multiple SQL servers

Applies to
ApexSQL Doc

Summary
This article explains the database documenting process from multiple SQL servers using an argument file or a project file in Command Line Interface (CLI).

Description

Using a project file
ApexSQL Doc allows database documenting from multiple SQL servers at the same time. After the connection to SQL servers is established, databases which will be documented from each server, need to be selected as shown below:

After the databases and the other settings for the documenting are selected, the current project needs to be saved as .axdp file. This can be done by clicking the Save button from the Home tab in the Projects group as shown below:


The saved project file contains the information about all selected SQL servers, databases, packages and settings. To use the project file in the Command Line Interface (CLI), a switch needs to be defined in Command Prompt as shown below:

C:\Program Files\ApexSQL\ApexSQL Doc\ApexSQLDoc.com
 /pr:C:\Users\p3tar\Desktop\db_documentation.axdp

By default, the project file needs to be saved in ApexSQL Doc installation directory. If this is the case, there is no need to specify the path to the project file after the “/pr:” switch, just its name, for example /pr:db_documentation.axdp. In case the project file is on the other location, so the full path to the project file needs to be specified, like shown in the image above.

Quick tip icon

Quick tip:

Enter the full path of the project file along with the .axdp extension for the command to be correct

If the .axdp extension is not included in CLI command, an error will appear as shown below:

The project file is not found 
c:\users\p3tar\desktop\db_documentation

C:\Program Files\ApexSQL\ApexSQLDoc

If the project file is not saved in the default location (ApexSQL Doc installation directory), specifying just the name of the project file will cause the same error as shown below:

C:\Program Files\ApexSQL\ApexSQLDoc\ApexSQLDoc.com 
/pr:db_documentation.axdp

The project file is not found db_documentation.axdp

Quick tip icon

Quick tip:

The defined settings saved in the project file can be overridden if you add the appropriate switch, without need to change the project file itself

Using the argument file
The file with an xml extension that contains all information for the database documenting process defined by the customer is the argument file. To generate the database documentation from multiple SQL servers using the argument file, it’s needed to specify the switches between the brackets “<>” for the selected servers, databases, and documenting settings as shown in the example below.

Generating the database documentation from multiple SQL servers using the argument file

Using the dbes switch, multiple SQL servers may be defined along with the databases from each one of them. This switch that can be repeated, and in case of multiple SQL servers it must be repeated for each one. The settings bellow the dbes switch, shown in the image above, cannot be repeated as they are common for all SQL servers. To use the above shown argument file, you need to specify its name as an argument for the /argfile switch, as shown below:

C:\Program Files\ApexSQL\ApexSQLDoc\ApexSQLDoc.com 
/pr:c:\users\p3tar\desktop\db_documentation.axdp

Quick tip icon

Quick tip:

The argument file cannot be combined with the other switches

If any other switch is added after specifying the argument file, a warning message will come up, as shown below:

Switch ‘argfile’ cannot be used along with other switches.

Switch ‘argfile’ cannot be used along with other switches.
C:\Program Files\ApexSQL\ApexSQLDoc