How to: Add, View, Modify, or Delete a Named Query Using Data Source View Designer
In Microsoft SQL Server 2005 Analysis Services (SSAS), you use Business Intelligence Development Studio to add, view, modify, or delete a named query in an Analysis Services project or database.
-
In Business Intelligence Development Studio, open the project or connect to the database that contains the data source view in which you want to add a named query.
-
In Solution Explorer, expand the Data Source Views folder, then open the data source view in Data Source View Designer by doing one of the following:
-
Double-click the data source view.
-
Right-click the data source view and click Open.
-
Click the data source view and then on the View menu, click Open.
-
Double-click the data source view.
-
Open the Create Named Query dialog box by doing one of the following:
-
In the Tables or Diagram pane, right-click an open area and then click New Named Query.
-
On the Data Source View Designer toolbar or on the Data Source View menu, click New Named Query.
-
In the Tables or Diagram pane, right-click an open area and then click New Named Query.
-
In the Create Named Query dialog box, do the following:
-
In the Name text box, type a query name.
-
Optionally, in the Description text box, type a description for the query.
-
In the Data Source list box, select the data source against which the named query will execute.
-
Type the query in the bottom pane, or use the graphical query building tools to create a query.
-
In the Name text box, type a query name.
Note: |
|---|
| The query-building user interface (UI) depends on the data source. Instead of getting a graphical UI, you can get a generic UI, which is text-based. You can accomplish the same things with these different UIs, but you must do so in different ways. For more information, see Create/Edit Named Query Dialog Box (SSAS). |
-
Click OK.
An icon showing two overlapping tables appears in the table header to indicate that the table has been replaced by a named query.
-
Save the modified data source view by doing one of the following:
-
On the File menu, click Save Selected Items or Save All.
-
On the Data Source View Designer toolbar, click Save Selected Items or Save All.
-
Close the Data Source View Designer in Business Intelligence Development Studio and then click Save when prompted.
-
On the File menu, click Save Selected Items or Save All.
-
In Business Intelligence Development Studio, open the project or connect to the database that contains the data source view in which you want to view or modify a named query.
-
In Solution Explorer, expand the Data Source Views folder, then open the data source view in Data Source View Designer by doing one of the following:
-
Double-click the data source view.
-
Right-click the data source view and click Open.
-
Click the data source view and then on the View menu, click Open.
-
Double-click the data source view.
-
Open the Edit Named Query dialog box by doing one of the following:
-
In either Tables or Diagram pane, right-click the named query and then click Edit Named Query.
-
In either Tables or Diagram pane, click the named query and then click Edit Named Query on the Data Source View menu.
-
In either Tables or Diagram pane, double-click the named query.
-
In either Tables or Diagram pane, right-click the named query and then click Edit Named Query.
-
In the Create Named Query dialog box, do the following:
-
In the Name text box, view or modify the query name.
-
In Description text box, view or modify the description for the query.
-
In the Data Source list box, view or modify the data source against which the named query will execute.
-
In the bottom pane, view or modify the query. Use the graphical query building tools as appropriate. For more information, see Create/Edit Named Query Dialog Box (SSAS).
-
In the Name text box, view or modify the query name.
Note: |
|---|
| The query building user interface (UI) depends on the data source. Instead of getting a graphical UI, you can get a generic UI, which is text based. You can accomplish the same things with these different UIs, but you must do so in different ways. |
-
Click OK or Cancel as appropriate.
-
Save the modified data source view by doing one of the following:
-
On the File menu, click Save Selected Items or Save All.
-
On the Data Source View Designer toolbar, click Save Selected Items or Save All.
-
Close the Data Source View Designer in Business Intelligence Development Studio and then click Save when prompted.
-
On the File menu, click Save Selected Items or Save All.
-
In Business Intelligence Development Studio, open the project or connect to the database that contains the data source view in which you want to delete a named query.
-
In Solution Explorer, expand the Data Source Views folder, open the data source view in Data Source View Designer by doing one of the following:
-
Double-click the data source view.
-
Right-click the data source view and click Open.
-
Click the data source view and then on the View menu, click Open.
-
Double-click the data source view.
-
Open the Delete Objects dialog box by doing one of the following:
-
In either the Tables or the Diagram pane, right-click the named query that you want to delete , and then click Delete Table From DSV
-
In either the Tables or the Diagram pane, click the named query that you want to delete, and then click Delete on the Data Source View Designer toolbar.
-
In either the Tables or the Diagram pane, right-click the named query that you want to delete , and then click Delete Table From DSV
-
In the Delete Objects dialog box, review the objects that will be deleted and the objects that will no longer be valid, then click OK or Cancel as appropriate.
-
Save the modified data source view by doing one of the following:
-
On the File menu, click Save Selected Items or Save All.
-
On the Data Source View Designer toolbar, click Save Selected Items or Save All.
-
Close the Data Source View Designer in Business Intelligence Development Studio and then click Save when prompted.
-
On the File menu, click Save Selected Items or Save All.
Tasks
How to: Replace a Table or a Named Query in a Data Source View Using Data Source View DesignerConcepts
Data Source Views (Analysis Services)Working with Data Source Views (Analysis Services)
Replacing a Table or a Named Query in a Data Source View

Note: