You can use the SQL Scripts folder in a
data project to create SQL and XQuery statements in the SQL and XQuery editor.
Before you begin
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.
About this task
To create an SQL or XQuery statement in the SQL and XQuery editor by using
a data project:
- Open the Data perspective.
- In the Data Project Explorer view, expand the data project, right-click
the SQL Scripts folder, and then click on
the pop-up menu.
- Complete the New SQL or XQuery Script wizard, leaving SQL and
XQuery editor selected.
- Click Finish. The statement
is added to the SQL Scripts folder of the data project
and opens in the SQL and XQuery editor.
- Complete the SQL or XQuery statement.
- 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.
- Optional: To format your SQL or XQuery code, right-click in the
editor, and then click Format SQL on the pop-up menu.
- Save the statement.