Automate generation of database documentation from the command line

The /document command lets you generate SQL Server database documentation from the command line.

Syntax

dbforgesql.com /document [/option_name1[:value | [parameter1:value parameter2:value ..]] /option_name2 ..]

Note

To run dbForge Studio CLI commands, open Command Prompt and navigate to the folder that contains dbforgesql.com. The default path to this executable depends on where dbForge Studio for SQL Server is installed. If you installed dbForge Studio:

  • As a standalone tool
C:\Program Files\Devart\dbForge Studio for SQL Server
  • As part of the dbForge Edge bundle
C:\Program Files\Devart\dbForge Edge\dbForge Studio for SQL Server

Get command-line help

To view command-line switches for /document, run the following command:

dbforgesql.com /document /?

The output displays all switches and their descriptions.

Command details

  • To specify the path to your .ddoc project file and the name of the file itself, use the /projfile switch.

    dbforgesql.com /document /projfile:<file_path>
    
  • To specify the format of the generated documentation, use the /documentformat switch.

    dbforgesql.com /document /documentformat:<HTML|PDF|MARKDOWN>
    
  • To specify the path to the folder where the documentation will be generated, use the /path switch.

    dbforgesql.com /document /path:<folder_path>
    
  • To specify the output file name for PDF documents or folder name for HTML or Markdown documentation, use the /output switch.

    dbforgesql.com /document /output:<file_or_folder_name>
    
  • To specify a database to document and a connection string, use the /database and /connection switches:

    dbforgesql.com /document /connection:<connection_string> /database:<database_name>
    

Examples

Example 1: Generate documentation from a project file

This command generates documentation using a project file. The documentation is generated in the default HTML format using the configurations in the project file. The output is saved to the same folder as the project file.

dbforgesql.com /document /projfile:"D:\Docs\DatabaseDocumentation\AdventureWorks2025_documentation_project.ddoc"

Example 2: Change the document title and author

This command generates a PDF document based on the configurations in the project file but overrides the document title and author in the project file. The output is saved to the specified folder.

dbforgesql.com /document /projfile:"D:\Users\JordanSanders\DatabaseDocumentation\AdventureWorks2025.ddoc" /documentformat:PDF /doctitle:"AdventureWorks 2025 Database Documentation" /author:"Database Engineering Team" /path:"D:\DatabaseDocumentation\GeneratedDocumentation\" /output:"AdventureWorks2025_Reference.pdf"

Example 3: Generate documentation for all databases on the server

This command generates documentation for all databases on the server and creates a server connection string. The output is saved to the specified folder in the default HTML format.

dbforgesql.com /document /projfile:"D:\Users\JordanSanders\DatabaseDocumentation\AdventureWorks2025.ddoc" /connection:"Data Source=Demo2025\SQLSERVER2025;Integrated Security=False;User ID=sa" /database:ALLDATABASES /path:"D:\Users\JordanSanders\DatabaseDocumentation\GeneratedDocumentation\"