How to: Add Existing Items to a Project

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 three project types: SQL Server Script Project, Analysis Services Script Project, and SQL Server Compact 3.5 SP2 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 cannot add it to an Analysis Services Script Project. To associate additional file extensions to a project type, see How to: Associate File Extensions to a Code Editor.

To add an existing query or a miscellaneous file to a project

  1. In Solution Explorer, select a target project.

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

  3. In the Add Existing Item dialog box, select the file to add, and then click Add.

  4. If you are adding query files, the connection dialog will prompt you to specify a connection for the query. You can click Cancel on the connection dialog if you do not want to associate a connection to the query.

  5. The file will be added to the Queries or Miscellaneous Files folder of the project.