Creating SQL and XQuery statements in the SQL and XQuery editor by using a data project

You can use the SQL Scripts folder in a data project to create SQL and XQuery statements in the SQL and XQuery editor.

The SQL and XQuery editor supports any statement that can be run by the database to which you are connected. Any statement that you create is stored in a file with the extension .sql.

Prerequisite: Before you create an SQL or XQuery statement by using a data project, create a data project in the Data Project Explorer view.

To create an SQL or XQuery statement in the SQL and XQuery editor by using a data project:

  1. Open the Data perspective.
  2. In the Data Project Explorer view, expand the data project, right-click the SQL Scripts folder, and then click New > SQL or XQuery Script on the pop-up menu.
  3. Complete the New SQL or XQuery Script wizard, leaving SQL and XQuery editor selected.
  4. Click Finish. The statement is added to the SQL Scripts folder of the data project and opens in the SQL and XQuery editor.
  5. Complete the SQL or XQuery statement.
  6. Optional: To insert the code pattern of a template into your statement, at the insertion point, type the first few characters of the template name, press Ctrl + Space, and then select the template in content assist.
  7. Optional: To format your SQL or XQuery code, right-click in the editor, and then click Format SQL on the pop-up menu.
  8. Save the statement.
Related concepts
SQL and XQuery editor
Related tasks
Changing the SQL statement terminator
Validating SQL and XQuery statements
Inserting code templates in SQL and XQuery statements

Feedback