How to: Save Queries

Save your query when you want to work with it later. Note that running your query does not save your changes.

Note

To save your query in a project, that database project must be open.

Note

Queries can only be saved to a database project. If you don't have a database project open, the Save command will not be available.

Note

Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.

To save a query

  1. Create your query.

  2. From the File menu, click Save <query_name>.

    Note

    A newly created query will be given a system name. To choose your own name for the query choose Save <query_name> As.

  3. The query will be saved in the Query folder of the project in Solution Explorer.

See Also

Tasks

How to: Create Queries

How to: Run Queries

How to: Discard Changes Made to Queries

Other Resources

Designing Queries and Views

Working with Views

Types of Queries

Performing Basic Operations with Queries