The Database Engine Query Editor supports the following SQLCMD script keywords:
[!!:]GO[count]
!! <command>
:exit(statement)
:Quit
:r <filename>
:setvar <var> <value>
:connect server[\instance] [-l login_timeout] [-U user [-P password]]
:on error [ignore|exit]
:error <filename>|stderr|stdout
:out <filename>|stderr|stdout
Note: |
|---|
For both :error and :out, stderr and stdout send output to the messages tab.
|
SQLCMD commands not listed above are not supported in Query Editor. When a script containing SQLCMD keywords that are not supported is executed, the Query Editor will send an "Ignoring command <ignored command>" message to the destination for each unsupported keyword. The script will execute successfully, but the unsupported commands will be ignored.
Caution: |
|---|
|
Because you are not starting SQLCMD from the command line, there are some limitations when running Query Editor in SQLCMD Mode. You cannot pass in command-line parameters such as variables, and, because the Query Editor does not have the ability to respond to operating system prompts, you must be careful not to execute interactive statements.
|