Changing database connections in the SQL and XQuery editor

Regardless of the approach that you use to create SQL and XQuery statements in the editor, a script that contains the statements is connected to a specific database. However, you can connect the script to a different database by changing the database connection.

Before you begin

The script that contains SQL and XQuery statements must be open in the SQL and XQuery editor.

About this task

The database that the script is connected to determines the information that is available when you use content assist. The database connection also might affect the results when you run the SQL or XQuery statement.

The connection string for the current database is shown on the left in the top border of the editor.

Procedure

To change a database connection in the SQL and XQuery editor:

  1. Do one of the following actions:
    • In the Command pane of the editor, click the Connection tab, and then click Select.
    • Right-click in the editor, and then select Use Database Connection.
  2. Select a different connection profile in the Select Connection Profile wizard, and then click Finish.

Results

The connection string for the selected database is shown in the top border of the SQL and XQuery editor. The information for the selected connection is shown in the fields on the Connection page in the Command pane.

Feedback