Share via


How to: Copy Queries

You can copy the body of a query into a new query to use as a starting point.

Note

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To copy a query

  1. From the View menu, click Solution Explorer.

  2. In Solution Explorer, right-click the query you want to copy and from the shortcut menu choose Design.

  3. In the SQL pane, copy the portion of the query you want to copy.

  4. Create a new query or open the query where you want to paste the copied SQL.

  5. Position the cursor where you want to add the SQL code.

  6. Right-click and from the shortcut menu click Paste.

See Also

Tasks

How to: Rename Queries

How to: Clear Query Results

How to: Save Queries

Other Resources

Performing Basic Operations with Queries