Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using Windows 8 and I'm trying to make Visual Studio 2012 the default program with which to open my .sql files.

I have right-clicked on a .sql file and chosen: Open with... > Choose default program... > More options > Look for another app on this PC. I use the form to open C:\Program Files\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe, but I then get the following error:

Cannot associate file type with this program

The program you have selected cannot be associated with this file type. Please choose another program.

I have associated .sql files with the Microsoft SQL Server Data Tools, T-SQL Editor under Tools > Options > Text Editor > File Extension. However, I believe this is just for syntax highlighting.

Whilst looking for a solution, I found this SO.SE question: How to add a new file association to Visual Studio?. However, I'm hoping for a solution that does not involve using a third-party program.

I also found this SO.SE question: Reassociate files types for visual studio 2012. However, I don't see .sql in the list of available file extensions.

Is it possible to set Visual Studio 2012 as the default editor for .sql files and, if it is, how can this be achieved on Windows 8?

share|improve this question

migrated from May 26 '13 at 9:22

This question came from our site for professional and enthusiast programmers.

Did you tried the registry trick? – The_aLiEn May 26 '13 at 11:13
@The_aLiEn What registry trick? (that's a no :)) – LordScree Jun 6 '13 at 7:57
In registry you can search for extension and change associated application to which you want. Extension associations are in HKEY_CLASSES_ROOT – The_aLiEn Jun 6 '13 at 22:37

You must log in to answer this question.

Browse other questions tagged .