SQL Packager 7

Basic command line features

This topic describes how to use the basic features of the command line.

Entering a command

When you enter a command line, the order of switches is unimportant. You are recommended to follow the Microsoft convention of separating a switch from its values using a colon as shown below.

/out:output.txt

(You can separate a switch that accepts a single value from its value using a space, but this is not recommended.) Values that include spaces must be delimited by double quotation marks ( " ). For example:

/out:"c:\output file.txt"

if you delimit a path with double quotation marks, you must not terminate the path with the backslash character ( \ ), because the backslash will be interpreted as an escape character. For example:

Incorrect:    /location:"C:\Packages\"

Correct:     /location:"C:\Packages"

For switches that accept multiple values, use commas to separate the values. For example:

/options:IncludeDependencies,ForceColumnOrder

For switches that accept a compound value, separate each part of the value using a colon. For example, the /includeschema and /excludeschema switches are used to include and exclude database objects from the actions performed by the tool. For example:

/includeschema:table:Product

includes all tables for which the table name contains the word Product.

Aliases

Many of the switches have an alias. The alias provides a convenient short-hand way to specify the switch. For example, /? is the alias for the /help switch, and /v is the alias for the /verbose switch. Note that switches and aliases are not case-sensitive.

/options switch

You can use the /options switch to change your options. For example, by default, comparisons are not case-sensitive; to specify case-sensitive comparisons:

/options:CaseSensitiveObjectDefinition

If you set any options explicitly, all of the default options are switched off.

Refer to the full command line help for more information about which options are set by default, and all the options that are available.

/options can't be used with a project file - you need to set the options in the project file instead.

/verbose and /quiet switches

The standard output mode prints basic information about what the tool is doing while it is executing. You can specify verbose and quiet modes using the /verbose and /quiet switches, respectively: in verbose mode, detailed output is printed; in quiet mode, output is printed only if an error occurs.

Redirecting command output

Output from all commands can be redirected to a file by one of several methods:

  • Use the /out switch to specify the file to which you want output directed:
    sqlpackager ... /out:outputlog.txt where outputlog.txt is the name of the file. If the file exists already, you must also use the /force switch to force the tool to overwrite the file, otherwise an error will occur.
  • Use the output redirection features that are provided by the shell in which you are executing the command.
    From the standard command prompt provided by Windows, you can redirect output to a file as follows:
    sqlpackager ... > outputlog.txt

    The redirection operator ( > ) and file name must be the last items on the command line.


    If the specified file exists already, it will be overwritten. To append output from the tool to an existing file, for example to append to a log without losing the data already present in the log, enter the following:
    sqlpackager ... >> existinglog.txt
    If you are scripting using a language such as VBScript, JScript, PHP, Perl, or Python, or if you want to access the tool from Web pages using ASP.NET, refer to the documentation for the language.

  • Specify command line arguments in an XML file that can be referenced using the /argfile switch.
    For details, see Using XML to specify command line arguments.

Didn't find what you were looking for?