I seem to have lost the association from .sql files to the default VS T-SQL editor. I'm using Visual Studio 2008. When i open a .sql file it opens using a text editor with no syntax highlighting. How do I reassociate all .sql files with the default T-SQL editor while inside Visual Studio?
A:
in file explorer, right click on the .sql file, chose "open with" then "choose program...", select VS and check "always use..."
KM
2009-05-26 18:29:23
i chose "open with" and don't have the choice of VS. I have choices of XML, Source Code, HTML, Binary, Resource editors. I've tried them all (currently using Source Code editor). I added VS (devenv.exe) as a program and used that but it opened a new instance of VS with the Source Code editor (no syntax highlighting)
2009-05-26 18:35:01
@Scott, the open with list will list window's bets guesses. Isn't there a "choose program..." option at the bottom? this will open a dialogue box where you can pick any program you want.
KM
2009-05-26 18:56:14
@KM, thanks for working with me on this, yes i did get a choose program. That is the option I chose to select VS as in your suggestion. But which exe do I choose then for the built-in T-SQL editor with visual studio. I tried selecting VS as you suggested but the exe i chose is devenv.exe and that opened another instance of VS but still used the source code editor with no highlighting.
2009-05-26 21:46:22
@Scott, I don't have VS, so I can't tell you
KM
2009-05-26 22:00:23
A:
If you are not in a "SQL Server Project" you don't have the T-SQL Editor (Default Project Editor), just the default one. You can always use the default text editor which is not much different.
Marc Climent
2009-06-02 16:26:29
A:
Thanks Pavel, works like a charm. In my case I copied the guid from HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\Language Services\T-SQL90\Default and created a new .sql key in HKLM\SOFTWARE\Microsoft\VisualStudio\9.0\Languages\File Extensions.
cosmos
2009-08-14 22:23:59