How to automate the generation of database documentation

You can automate documentation generation tasks using the command line.

  1. Open the Command Prompt.

Note

To run the Command Line in Windows 10:

From the Desktop Mode

  • Move the mouse cursor to the exact lower left corner until the desktop shortcuts menu appears.
  • Right-click to see the shortcut menu and then click Run.

From the Charms Bar

  • Move your mouse to the upper right corner until the Charms Bar appears.
  • Select Apps from the list and type run in the search box.
  • Click Run from the search results.

Use Windows + R Shortcut Keys

  • In desktop mode, press the Windows + R keys, to show the Run command line.
  • In the window that opens, type cmd and press Enter.
  1. Type a path to the documenter.com file, located in dbForge Documenter for SQL Server installation folder on your PC, and press SPACEBAR.

  2. Type all the arguments (actions you want to run) in the Command Prompt. You can do this in three ways:

  • Type all the arguments directly in the Command Prompt and run them, for example:
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server\documenter.com /document /connection:
"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername" /database:"Adventureworks2019_Dev" /output:"D:\"

Run arguments

  • Specify a path to a previously saved project file (.ddoc) to load the command line settings from.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server\documenter.com /document /projfile: 
"D:\myprojfiles\Adventureworks2019.ddoc"
  • Type the path to a previously generated file with required command-line arguments (see below how to prepare the file), for example:
/argfile:"D:\file_name.txt"

Tip: To see a quick help on the arguments available in the command line, type the following:

/documenter.com /?

How to prepare a file with command-line arguments

1. In any text editor, type the command you want to execute, for example:

/document

2. Specify the connection parameters and a database you want to generate documentation for:

/document /connection:"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername" /database: "Adventureworks2019_Dev"

3. Specify the output documentation file format

/document /documentformat: "PDF"

4. Specify a path to store the output file:

/output: "D:\"

5. Add other arguments if needed.

Note

You can find the list of available command-line switches and arguments in the Switches used in the command line topic.

6. Save the file. You can then run it with the help of the /argfile argument.

Download and install a 30-day free trial version of Documenter for SQL Server to evaluate all the advanced features it delivers.

To learn how you can involve dbForge Documenter in the Development and CI processes, feel free to watch this video.