Scheduling database documentation

You can schedule or automate data generation tasks with the help of dbForge Documenter for SQL Server and Windows Task Scheduler.

Scheduling the generation of database documentation includes the following steps:

Creating a .bat file using dbForge Documenter

First, you need to create a file with the .bat extension for generating database documentation.

To create the .bat file, do the following:

1. On the standard toolbar, click New Documentation.

2. In the Selection Connections dialog, select the check box with the required connection and click Select.

3. In the database documentation tree of the Database Documenter project that opens, select a database or database objects you want to document.

4. Click Generate.

5. In the Generate Documentation dialog, click Save Command Line.

Generate Documentation dialog - dbForge documenter tool

6. In the Command line execution file settings window that opens, verify and configure the settings to manage the *.bat file text.

Command line file settings in dbForge Documenter for SQL Server

Command-line file settings

Name Default State Description
Project file Disabled Loads command-line settings from the project file .ddoc.
Connection Enabled Specifies the connection string.
Database Enabled Specifies databases for which the documentation project will be generated. The user can specify a single database or multiple databases separated by commas. If the user wants to select all the databases of the server, the ALLDATABASES parameter can be used
Password Disabled Specifies the server password.
Document format Enabled Specifies the output documentation file format.
Save in Enabled Specifies the destination directory for documentation.
File name Enabled Specifies an output file name for PDF documentation or folder name for HTML or Markdown documentation.
Author Disabled Specifies the ‘author’ parameter for documentation.
Copyright Enabled Specifies the ‘copyright’ parameter for documentation.
Created Enabled Specifies the ‘created’ parameter for documentation.
Document title Disabled Specifies the ‘doctitle’ parameter for documentation.
Document logo Enabled Specifies the ‘doclogo’ parameter for documentation.
Document description Disabled Specifies the ‘docdescription’ parameter for documentation.
Breadcrumbs Enabled Specifies the ‘breadcrumbs’ parameter value for documentation.
Permissions Enabled Specifies the ‘permissions’ parameter value for documentation.

7. (Optional) To verify that the command line settings are valid, click Validate.

8. To save the script as a *.bat file, click Save.

Creating a synchronization task

After the batch file for database synchronization was created, we can proceed with the creation of a synchronization task using the Windows Task Scheduler so that the computer can carry out the task automatically.

To create a Windows synchronization task, do the following:

1. Open the Control Panel > Administrative Tools and select Task Scheduler.

2. In the Task Scheduler window that opens, navigate to the Actions pane and click Create Basic Task to create a scheduled task.

Click Create Basic Task in Windows Task Scheduler

3. In the Create Basic Task Wizard window that opens, specify the name and description of the task and click Next.

Specify the name and description

4. On the Trigger tab, choose when to launch the task and then click Next.

  • Schedule based on the calendar: Daily, Weekly, Monthly, or One time. For this, specify the schedule you want to use.
  • Schedule based on common recurring events: When the computer starts or When I log on.
  • Schedule based on specific events: When a specific event is logged. For this, specify the event log, source, and even ID using the drop-down lists.

Select the time period for the task to be started

5. On the Action tab, click Start a program to schedule a program to start automatically and then click Next.

Schedule a program to start automatically

6. On the Start a Program subtab, click Browse to select the .bat file you have created with the help of dbForge Documenter for SQL Server and then click Next.

There are optional fields that you can set:

  • Add arguments: Specify the arguments to run the task with specific instructions.
  • Start in: Specify the folder in which the program will start.

Start a program

7. On the Finish tab, verify the settings and click Finish.

The task will be displayed in the Active Tasks section.

View the created task in the Active Tasks section of Task Scheduler

Download and install a 30-day free trial version of dbForge database schema documentation tool to evaluate all the advanced features it delivers.