Running A Job From The Command Line

Syntax

Use either the tworkbench or the messageprocessor command to run a job from the command line. The syntax for these commands is identical:

Tworkbench DTSname /x
messageprocessor DTSname /x

Where DTSname is the name of the DTS file and x is one or more of the supported switches.

The following rules apply:

Using Variables in the Command Line

The syntax required to specify a variable in the command line depends on the type of variable, as follows:

Text variable:

The variable value must always be enclosed by 3 sets of double quotes, whether or not there are spaces in the variable. For example, if the Variable name is PromptVar and the value is "Modified value", then the command line statement is: 

tworkbench "MyTest.dts" /TS="c:\Program Files (x86)%Public%\Public Documents\Scribe\Samples\Textdata\company.txt"/VPromptVar="""Modified Value""" /RS /C

Numeric variable

For example, if the Variable name is PromptVar and the value is 200, then the command line statement is:

tworkbench "MyTest.dts" /VPromptVarNumber=200 /C /RS 

Multiple variables:

The following example uses multiple variables, with a hyphen separating the variables:

tworkbench "MyTest.dts" /VPromptVarNumber=200 -VPromptedDate=TODAY() -VPromptVar="""Text Value""" -C -RS 

Note that you can also use slashes to separate variables, as follows:

tworkbench "MyTest.dts" /VPromptVarNumber=200 /VPromptedDate=TODAY() /VPromptVar="""Text Value""" /C /RS 

Quoted variable

If quotation marks enclose a prompted variable that is passed from the command line, the quotation marks are stripped from the variable. To pass a quoted variable, use escape characters (\") before each quotation mark. For example, to pass "Hello_world" into a formula, use the following: "\"Hello_world\""

Specifying a Unicode Connection

To specify that both connections in a DTS may contain Unicode data:

tworkbench "c:\program files (x86)\scribe\dtsfiles\myunicodedts.dts" /SS=mysourcedsn /SU=myusername /SP=mypassword /SN=Y /TU=mytargetusername/TP=mytargetpassword /TO="This DTS supports Unicode data" /TN=Y

Note:  
  • If you save a DTS file after specifying connection information from the command line, the specified connection information is also saved.
  • You do not need to specify the full path if the DTS file is located in the application directory.

See also

Command Line Switches

DTS Report

Globally Changing Table or Field Names

Troubleshooting A Failed Connection