Executing Scripts

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.

  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 Documenter for SQL Server\documenter.com
    
  4. To execute the corresponding script, use the /execute command, and press the SPACE key.

    C:\Program Files\Devart\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 Documenter for SQL Server>documenter.com /execute
    /connection:"Data Source=DBMSSQL\MSSQL2012;Integrated Security=False;User ID=sa" 
    
  6. Specify the script file.

    C:\Program Files\Devart\dbForge Documenter for SQL Server>documenter.com /execute 
    /connection:"Data Source=DBMSSQL\MSSQL2012;Integrated Security=False;User ID=sa" /inputfile:"script.sql"
    
  7. Specify the password.

    C:\Program Files\Devart\dbForge Documenter for SQL Server>documenter.com /execute 
    /connection:"Data Source=DBMSSQL\MSSQL2012;Integrated Security=False;User ID=sa" /inputfile:"script.sql" 
    /Password:mypsw
    
  8. To hide the command line window, use the /quiet command. (Useful for batch files).

    C:\Program Files\Devart\dbForge Documenter for SQL Server>documenter.com /execute /connection:"Data Source=DBMSSQL\MSSQL2012;Integrated Security=False;User ID=sa" /inputfile:"script.sql" /Password:mypsw /quiet
    
  9. Press ENTER to run the process.

If you use the /argfile argument, all the following commands are specified inside an argfile:

/execute /connection:"Data Source=DBMSSQL\MSSQL2012;Integrated Security=False;User ID=sa" /inputfile:"script.sql"

In this case, the command line string will be written as follows:

C:\Program Files\Devart\dbForge Documenter for SQL Server>documenter.com /argfile:myarg.txt

Arguments Used in Command Line

Select corresponding command line switches to perform the required operations:

Arguments used in command line