Introduction:
In SQL Server Management Studio (SSMS), the default location for files and projects is the SQL Server Management Studio Projects folder in your My Documents folder. However, sometime, we would like change the default location to a user-defined location.
Solution
SQL Server Management Studio is built upon the Visual Studio isolated Shell. In order to change the default behavior of SSMS, you should find where the default configuration defined in Visual Studio.
In Visual Studio, it is use settings to define different aspects of the Visual Studio look and feel. Every time you change a setting, the change is automatically saved, by default, in the Currentsettings.vssettings file.
From Visual Studio 2008 SP1, it introduces a new feature to support configuration of Isolated Shell applications: the .pkgdef file. You can defined settings in the .pkgdef file supports settings to customize an isolated shell application.
SSMS uses the setting ProjectsLocation/DefaultProjectsLocation to determine the default location.
Prior SQL Server 2008 R2, the SSMS is built upon Visual Studio 2008 isolated Shell or early version of Visual Studio. The ProjectsLocation is set from .vssettings XML file.
Since SSMS 2012 is built on Visual Studio 2010 shell, The DefaultProjectsLocation is set from .pkgdef file.
To change the default query save location, please following these instructions:
Prior SSMS 2008 R2
- Locate %USERPROFILE%\Documents\SQL Server Management Studio\Settings folder:
- Open the Currentsettings-<Date>. wssettings with text editor(e.g. Notepad)
- Change the value of element ProjectsLocation
<PropertyValue name="ProjectsLocation">%vsspv_user_documents%\My Projects</PropertyValue> - Save the file
(Note: The user defined settings are applied automatically every time that we start SSMS. When click Save, SSMS still get the original default project folder. But clicking on the 'My Projects' button on the left panel of the save dialog will bring to the folder where we specify in the xml file.)
Since SSMS 2012
- Locate C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Extensions\Application
- Open ssms.application.pkgdef with text editor(e.g. Notepad)
- Change the value of DefaultProjectsLocation
- "DefaultProjectsLocation"="$MyDocuments$\SQL Server Management Studio"
- Save the file
References
Changing the My Projects folder location (and other settings) in SSMS
Pkgdef and the Experimental Instance in VS 2010
Modifying the Isolated Shell By Using the .Pkgdef File
- Moved by Olaf HelperMVP 2 hours 40 minutes ago Moved from "SQL Database Engine" to a more related forum