You can automate executing the scripts using the command line.
1. Click Start.
2. Type ‘cmd’ in the Search programs and files text box and press ENTER.
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.
3. Type a path to the documenter.com file located in the dbForge Documenter for SQL Server installation folder on your PC, and then press the SPACE key.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server\documenter.com
4. To execute the corresponding script, use the /execute command.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /execute
5. Specify connection details of the server where to execute the script.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /execute
/connection:"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername"
6. Specify the script file.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /execute
/connection:"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername" /inputfile:"script.sql"
7. Specify the password.
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /execute
/connection:"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername" /inputfile:"script.sql"
/Password:yourpassword
8. To hide the command line window, use the /quiet command (useful for batch files).
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /execute
/connection:"Data Source=SQLSRV\SQL2019;Integrated Security=False;User ID=yourusername" /inputfile:"script.sql" /Password:yourpassword /quiet
9. Press ENTER to run the process.
If you use the /argfile argument, all the required commands are specified inside an argument file. In this case, the command line string will be written as follows:
C:\Program Files\Devart\dbForge SQL Tools Professional\dbForge Documenter for SQL Server>documenter.com /argfile:myarg.txt
Select corresponding parameter to perform the required operation:
Parameter | Usage and description |
---|---|
/connection | /connection:<connection_string> Specifies the connection string. |
/database | Specifies a database to execute a script to. Databases specified in the script will be ignored. Does not affect objects with fully qualified names. |
/encoding | /encoding:<codepage|encoding name> Specifies the encoding that should be applied to open and execute the script. |
/exitcodes | Returns the list of possible exit codes that can be returned by the command-line process. |
/inputfile | Specifies a SQL or ZIP file with the script to execute. |
/password | Enters the server password. Overrides the password specified in the connection string. |
Download and install a 30-day free trial version of Documenter for SQL Server to evaluate all the advanced features it delivers.