Edit

Share via


Add existing items to a project

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)

Add new items to a project to extend application functionality. An existing item can be a query or a miscellaneous file. SQL Server Management Studio has two project types: SQL Server Script Project, and Analysis Services Script Project. The project type determines the query files that you can add to the project. For example, you can add a Transact-SQL query (a file with a .sql extension) to a SQL Server Script project, but you can't add it to an Analysis Services Script Project. To associate other file extensions to a project type, see Associate file extensions to a code editor.

Add an existing query or a miscellaneous file to a project

  1. In Solution Explorer, select a target project.

  2. On the Project menu, select Add Existing Item.

    • Look in

      Locate the files or folders to add to your project from this list. For XML Web services and ASP.NET Web applications, the files are located on the Web server.

    • Desktop

      Displays the files and folders located on the desktop.

    • My Projects

      Displays the files and folders at the default My Projects location.

    • My Computer

      Displays the contents of your My Computer folder.

    • File name

      Use this option to filter the files and folders that are displayed. Enter the full or partial file name on which to filter; use an asterisk (*) as a wildcard.

      Note

      Navigate to Web and network locations by entering the URL or network path in the File name box. For example, https://mywebsite displays the files available at the mywebsite Web location, and \\myserver\myshare displays the files available at the myshare location on myserver.

    • Files of type

      Use this option to filter files based on file extension. Each product lists default filters of the most common file types.

    • Add

      Use this dropdown list button to add the item to the project and open the item in its default editor.

      • Add

        Copies the existing item to your project folder on disk and adds the item under the selected project in Solution Explorer. Any changes made to the item aren't reflected in the item at the original location. This is the default editor for the file type.

      • Add As Link

        Adds the selected file to the project and opens it with the default editor for the file type. This option opens the originally selected file and doesn't copy the file to the project folder.

  3. If you're adding query files, the connection dialog prompts you to specify a connection for the query. You can select Cancel on the connection dialog if you don't want to associate a connection to the query.

  4. The file is added to the Queries or Miscellaneous Files folder of the project.