Tuesday, November 27, 2007

SQL Server 2005 Management Studio File Locations

Why is it that each new program that comes along must have a different location to save its files? What's worse is when a new version of a program requires a different location. The first that comes to mind is Visual Studio 2003 and Visual Studio 2005. Each create a new folder in the users 'My Documents' directory. I recently had to install SQL Server 2005 Management Studio, which, by default, wants to save scripts to “My Documents\SQL Server Management Studio\Projects”

Now, I'm not a Database Engineer, but I have accumulated two dozen SQL scripts for various database tasks and already have a location where I've saved these scripts. There's two options, move the files to the new location (My Documents\SQL Server Management Studio\Projects), or modify the the settings to change where the files are saved.


I recommend the first option, because after considerable effort, I was not able to find all the settings to change where the files are saved.


The SQL Server Management Studio file locations can be customized through the registry. By navigating to “HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\90\Tools\Shell” in the registry, there are several keys which point to the folder “My Documents\SQL Server Management Studio\Projects”. The main key to change would be “DefaultFileOpenLocation”. Unfortunately, this only controls the directory that the program looks at when clicking 'Open File'. After over an hour of research, I wasn't able to find a setting to change which would force the application to change where it saves SQL files. So, while a user can control where to open files by default, the user cannot control where those files are saved by default.


I think the most frustrating thing about this, is how close I got to getting the application into doing what I want. To have that taken away from me because the program is designed to use settings defined in the registry AND hard coded into the system. BUT, the settings sprawl does not end there, in the “My Documents\SQL Server Management Studio\” you'll notice a folder labeled “Settings” which contains even more settings, this time in a .config file. This file also defines file locations, as well as several other application settings.


I initially intended this to be a how-to on how to configure SQL Server Management Studio to point to the location of YOUR choosing. Unfortunately, the application had other plans and this has turned into another example of a program implemented poorly.

1 comment:

  1. AAuugghh! Huh? Oh, wait, that was the intention, wasn't it? Help?

    ReplyDelete