Recently, I deployed Microsoft SQL Server 2012 on to one of my test workstations which already had SQL Server 2008 R2 installed on it. Later, I uninstalled SQL Server 2008 R2 from the workstation and suddenly, I noticed something strange – the SQL Server related script and solution files which were supposed to open up in SSMS failed to do so – the icon was set to a default “unknown program” too.
To re-associate these files with the SSMS, there are two possible options:
Option 1: Use the Control Panel to associate a program to a given file type
- Launch the Control Panel
- Go to Programs –> Default Programs
- Select “Associate a file type or protocol with a specific program”
- Scroll through the window and select the required file extension
- Choose “Change Program” and select the required program (in this case, SSMS) to associate it with the file type at hand
(*This method is valid for SQL Server 2012 and below).
Option 2: Use the SSMS to restore broken file associations related to Visual Studio shell
The SSMS is nothing but a Visual Studio shell. Hence, the SSMS for SQL Server 2012 extends the core benefits of Visual Studio 2010 shell. One such feature/benefit is the ability to Restore File Associations from the Tools menu.
- Within the SSMS for SQL Server 2012, go to Tools –> Options
- Under the General page in the Environment node, click on “Restore File Associations”
- The following confirmatory message will be received, indicating that the file associations have been restored as expected
(*This method is applicable from SQL 2012 only. SSMS for SQL Server 2008 R2 and below does not have this feature.)
(Please NOTE: For me, this did not work as expected when using the SSMS for SQL Server 2012 RTM. However, when I deployed SQL Server 2012 SP1, things worked as expected. Do share your findings in the comments below as applicable.)
Until we meet next time,