How to: Replace a Table or a Named Query in a Data Source View Using Data Source View Designer (Analysis Services)

You use Business Intelligence Development Studio to add, view, modify, or delete a named query in an Analysis Services project or database.

Note

To replace a table with another table, you must have an active connection to the source data in Data Source View Designer in project mode.

Important

If you rename a table in a data source, follow the steps for replacing a table and specify the renamed table as the source of the corresponding table in the data source view before you refresh a data source view. Completing the replacement and renaming process preserves the table, the table's references, and the table's relationships in the data source view. Otherwise, when you refresh the data source view, a renamed table in data source is interpreted as being deleted.

To replace a table with a named query

  1. In Business Intelligence Development Studio, open the project or connect to the database that contains the data source view in which you want to replace a table or a named query.

  2. 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.

  3. Open the Create Named Query dialog box by doing one of the following:

    • In either Tables or Diagram pane, right-click the table that you wish to replace, point to Replace Table and then click With New Named Query.

    • In either Tables or Diagram pane, click the table that you wish to replace and then point to Replace Table on the Data Source View menu and then click With New Named Query.

  4. In the Create Named Query dialog box, define the named query and then click OK. For information about defining named queries, see How to: Add, View, Modify, or Delete a Named Query Using Data Source View Designer (Analysis Services).

  5. 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.

To replace a table or named query with a table

  1. In Business Intelligence Development Studio, open the project or connect to the database that contains the data source view in which you want to replace a table or a named query.

  2. 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.

  3. Open the Replace Table with Other Table dialog box by doing one of the following:

    • In either Tables or Diagram pane, right-click the table or named query that you wish to replace, point to Replace Table and then click With Other Table.

    • In either Tables or Diagram pane, click the table or named query that you wish to replace and then point to Replace Table on the Data Source View menu and then click With Other Table.

  4. In the Replace Table with Other Table dialog box:

    1. In the DataSource drop-down list box, select the desired data source

    2. Select the table with which you wish to replace the table or named query

  5. Click OK.

  6. 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.