By default, the SQL and XQuery editor uses a
semicolon ( ; ) as the default statement terminator. You can change
the default statement terminator or specify a different statement
terminator for the SQL statements in a script that you create in the
SQL and XQuery editor.
You change the statement terminator
for all SQL statements by changing the default statement terminator
on the SQL and XQuery page in the Preferences window
(). You change the statement terminator for the SQL statements
in an individual script by using either the Command pane or the
pop-up menu in the SQL and XQuery editor.
Before you begin
The SQL script for which you want to change the statement
terminator must be open in the SQL and XQuery editor.
About this task
A statement terminator applies to all of the SQL statements
that are in the script in which you specify the statement terminator.
You can specify different statement terminators in different SQL scripts.
The statement terminator can be a string of one or more case-sensitive
characters. If you specify a string of multiple characters as the
statement terminator, the statement terminator must be preceded by
a space in your code.
The statement terminator that you specify
for an SQL script persists every time that you open the script in
the SQL and XQuery editor.
Procedure
To change the statement terminator for the SQL statements
in an SQL script:
- Open a script from the Data Project Explorer. When
the script opens, you are asked to specify the SQL statement terminator.
After you specify the SQL statement terminator, the script opens in
the editor.
- Use the command pane in the SQL and XQuery editor:
- Open the Validation tab.
- In the Set statement terminator box,
type one or more characters to use as the statement terminator.
- Use the pop-up menu in the editor:
- Right-click in the editor, and then select Set
Statement Terminator.
- In the Set Statement Terminator window,
type one or more characters to use as the statement terminator and
then click OK.
Results
If you specify a statement terminator other than the default,
a comment is added to the top of the SQL script that indicates the
statement terminator that you specified. Existing occurrences of the
default statement terminator are not updated in the SQL script; you
must change them manually.