Management Studio default file save location

98,074

Solution 1

I know this is an old question, but I found a link expaining how to do this properly, at least for SQL 2005. Think it will work for later versions as well.

Changing the my projects folder

The settings are stored in an .vssettings XML file in My Documents\SQL Server Management Studio\Settings folder. Make sure you close SSMS before making changes to this file: SSMS writes to it when you close the application and will overwrite any changes you make. To change the My Projects folder, you are looking for this line:

   <PropertyValue name="ProjectsLocation">%vsspv_user_documents%\My
   Projects</PropertyValue>

The value inside is the location of the My Projects folder. Simply change the value, and the next time you open SSMS the My Projects folder will be mapped.

Solution 2

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

  1. Locate C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\Extensions\Application

SSMS 2014

  1. Locate C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Extensions\Application

SSMS 2016

  1. Locate C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\Extensions\Application

SSMS 17

  1. Locate C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\Extensions\Application

SSMS 18

  1. Locate C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\Application

All (continued)

  1. Open ssms.application.pkgdef with text editor(e.g. Notepad)
  2. Change the value of DefaultProjectsLocation "DefaultProjectsLocation"="$MyDocuments$\SQL Server Management Studio"
  3. For query storage location (query itself, not results), edit this: "DefaultUserFilesFolderRoot"="SQL Server Management Studio"
  4. 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

Solution 3

A simple work around is to create a shortcut to your desired save location. Place the shortcut in the SSMS\Projects directory. When saving, select "All Files (.)" at the bottom, then double click your shortcut.

Not ideal, but a quick and simple work around.

Solution 4

Just to make sure, did you update the locations in the registry here:

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell\General\ProjectLocationEntries

Solution 5

The installation location for SSMS 18 has changed, along with the location of the configuration file that controls the default file save location. The file that needs to be edited is now located at the following path:

C:\Program Files (x86)\Microsoft SQL Server Management Studio 18\Common7\IDE\Extensions\Application\ssms.Application.pkgdef

  1. Close all running instances of SSMS 18.

  2. Open ssms.Application.pkgdef with a text editor running with Administrator privileges.

  3. Change the value of DefaultProjectsLocation to what you'd like the default to be:

    • "DefaultProjectsLocation"="C:\My\Preferred\Save\Location"
  4. Save the file and restart SSMS.

Share:
98,074
JeremyWeir
Author by

JeremyWeir

http://twitter.com/JeremyWeir http://www.linkedin.com/in/jeremyrweir

Updated on July 05, 2022

Comments

  • JeremyWeir
    JeremyWeir almost 2 years

    Open a new query window. Write some SQL. Save the script, the Save File As dialog box opens - but always to the same default location in the Profiles directory. Is there any way to set my default file location? ...Like I used to do with apps from the 1980s?

    Under Tools|Options a default location can be specified for query results. I need the same thing for new queries (the text editor). Tried changing locations in the Registry but SSMS just overwrote my changes. Any suggestions?

    (I saw this unanswered question at http://www.eggheadcafe.com/software/aspnet/30098335/management-studio-default.aspx and I had same exact question so I just reposted it here)

  • Ishmael
    Ishmael over 15 years
    Thanks! I've been looking for this for a long time too!
  • JeremyWeir
    JeremyWeir over 15 years
    Studio resets the values of those reg items when I reopen it.
  • edosoft
    edosoft over 15 years
    Yes I have now seen this as well (settings overwritten on restart) I'll look into it.
  • Marshall
    Marshall almost 13 years
    Note: When trying this out, when I click Save, I still get the original default project folder. But clicking on the 'My Projects' button on the left panel of the save dialog brings me to the folder where I want my scripts saved. Thanks.
  • JeremyWeir
    JeremyWeir over 11 years
    That's the same link as Marshall's answer from 2011 :)
  • Dave Johnson
    Dave Johnson over 9 years
    I am on SSMS 2012, so none of the other "answers" worked. Thanks :)
  • DJ van Wyk
    DJ van Wyk almost 9 years
    This was the only non-workaround solution for SSMS 2014 as well.
  • Doug
    Doug about 8 years
    Thanks, this works for me in SSMS 2016 Release Candidate. But, this only solves the problem of where Save As defaults to save new queries. It does not solve the (unasked) question of where File Open looks for existing files...
  • David Fawzy
    David Fawzy about 8 years
    Thanks D-Money That also worked with SQL management studio 2016
  • David Fawzy
    David Fawzy about 8 years
    Sql 2016 location C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Extensions\Applicatio‌​n
  • Michael Schwab
    Michael Schwab over 7 years
    Ugh, just saw that this solution was already posted above. sorry for the dupe.
  • influent
    influent about 7 years
    @DavidFawzy that should be 130 for SSMS 2016, not 120.
  • Ads
    Ads over 5 years
    If your version isn't listed here, you probably just need to look through all the folders 120, 130, etc, starting at the highest number and work your way down, until you find the ssms.application.pkgdef file.. Look in \140, then \130, then \120.. etc, etc.
  • Dylan Petrusma
    Dylan Petrusma over 3 years
    If you could add the instructions from David Guerra for SSMS 18 this would be perfect. I've come here once or twice since I upgraded and couldn't figure out the latest version.
  • user2197446
    user2197446 about 3 years
    I searched for 18.0_IsoShell and changed everything at this level that referred to "%USERPROFILE%\My Documents\" to my "%USERPROFILE%\OneDrive\My Documents" folder. Why does Microsoft make this so hard to change? I shouldn't have to run regedit to fix this!