SQL Doc 4

Using the command line

SQL Doc provides a command line interface so that you can generate database documentation from the command line or in script or batch files.

You can use the command line:

Using the command line with a SQL Doc project file

To create a SQL Doc project file, you need to set up a documentation project, generate the documentation at least once, and then save the project. This creates a project file that contains information such as the connection details and objects to document.

To use the command line to generate documentation exactly as it is defined by the project file, specify the /project option.

In this example, SQL Doc will generate documentation using the dev1.sqldoc project file:

sqldoc /project:dev1.sqldoc

Using a project file as a template

You can also use a project file as a template by specifying additional command line options. The command line options override the equivalent settings in the project file.

In this example, SQL Doc will generate documentation using the dev1.sqldoc project file, but with Sales group displayed for the author name on the front page of the documentation:

sqldoc /project:dev1.sqldoc /copyrightauthor:"Sales group"

If the dev1.sqldoc project file specifies a different author name, this is overridden by the /copyrightauthor option.

Specifying a SQL Server instance

To generate documentation against a different SQL Server instance, use the /server option to override the connection details in the project file.

In the following example, SQL Doc will generate documentation using the dev1.sqldoc project file for the Staging server:

sqldoc /project:dev1.sqldoc /server:Staging

If the dev1.sqldoc project file specifies a different SQL Server instance, this is overridden by the /server option.

If SQL Server authentication is in use, and you have not saved the password, use /username and /password to specify authentication details:

sqldoc /project:dev1.sqldoc /server:Staging /username:User1 /password:P@ssw0rd

Specifying databases to document

If you want to document specific databases on a server, use the /database option to override the database selections in the project file:.

sqldoc /project:dev1.sqldoc /server:Staging /username:User1 /password:P@ssw0rd /database:WidgetDev,WidgetTest

Documenting all databases on a server

If you want to document all databases on a server, use the /alldbs option to override the database selection in the project file:

sqldoc /project:dev1.sqldoc /server:Staging /username:User1 /password:P@ssw0rd /alldbs

Using the command line without a SQL Doc project file

Using the /server option, you can generate documentation from the command line without having to create a project file first.

In the following example, SQL Doc will generate documentation for all accessible databases on the Staging server. The documentation type is set to web pages (HTML) with frames, and excluding documentation for permissions:

sqldoc /server:Staging1 /username:User1 /password:P@ssw0rd /filetype:html-frames /exclude_permissions

Specifying databases to document

If you want to document specific databases on a server, use the /database option.

In the following example, SQL Doc will generate documentation for the WidgetDev and WidgetTest databases on the Staging server:

sqldoc /server:Staging /username:User1 /password:P@ssw0rd /database:WidgetDev,WidgetTest

Specifying file types

To generate documentation with a different file type, use the /filetype option.

In the following example, SQL Doc will generate documentation using the dev1.sqldoc project file in the Microsoft Word document (.doc) format:

sqldoc /project:dev1.sqldoc /filetype:doc

To specify the Word document page size, add the /page option. For example, /page:Letter sets the Word page size to Letter (8.5" wide by 11" high).

Available file types

doc

document (.doc) 

docxdocument (.docx)

html

web pages (.html), no frames

html-frames

web pages (.html), using frames

chm

help file (.chm)

pdfPortable Document Format (.pdf)
md or markdownMarkdown (.md)

For more information about the file types, see About documentation formats.

Getting help from the command line

To display help from the command line, enter:

sqldoc /help

This displays basic help on all the command line options. For more detailed help, enter:

sqldoc /help /verbose

This displays a detailed description of each option and the values it can accept (where applicable), and all exit codes. To output the help in HTML format, enter:

sqldoc /help /verbose /html > filename.html

Entering a command

When you enter a command line, the order of the options doesn't matter. Separate an option from its values using a colon:

/project:MyProject.sqldoc

The colon must not be followed by a space; values that include spaces must be delimited by double-quotes. For example:

/project:"c:\My Project.sqldoc"

Aliases

Many options have an alias. The alias provides a convenient short-hand way to specify the option. For example, /? is the alias for the /help option, and /v is the alias for the /verbose option.

Options and aliases are not case-sensitive.


Didn't find what you were looking for?