This is 5 years old now, but it doesn’t mention SSMS version, so I thought I’d add an update for SSMS 2012 and SSMS 2014. Step one differs between the versions, and then the rest is the same:
SSMS 2012
- Locate C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Extensions\Application
SSMS 2014
- Locate C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Extensions\Application
SSMS 2016
- Locate C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Extensions\Application
SSMS 17
- Locate C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Extensions\Application
SSMS 18
- Locate C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\Application
All (continued)
- Open ssms.application.pkgdef with text editor(e.g. Notepad)
- Change the value of DefaultProjectsLocation
“DefaultProjectsLocation”=”$MyDocuments$\SQL Server Management Studio” - For query storage location (query itself, not results), edit this:
“DefaultUserFilesFolderRoot”=”SQL Server Management Studio” - Save the file
Thanks to this source: http://www.networksteve.com/forum/topic.php/How_to_change_the_default_query_save_location_in_SSMS/?TopicId=41425&Posts=0