29

I can suddenly no longer open .sql files in VS 2012 by simply double clicking in the Solution Explorer. I get the error message:

Unable to open Transact-SQL file in custom editor

I strongly suspect this is after installing SP1 for SQL Server 2012 Express yesterday, as part of Windows Updates. The error dialogue gives me a link to Get the latest version of SQL Server Data Tools, but that link only yields a Page not found on MSDN.

ProfK
  • 49,207
  • 121
  • 399
  • 775

3 Answers3

43

Installing the SQL Server Data Tools - November 2012 update fixed the SQL editor. All is good in the world again.

ProfK
  • 49,207
  • 121
  • 399
  • 775
  • 1
    This link is correct, they're just referring to it as the "December 2012" update. – PeterX May 23 '13 at 04:30
  • The current new version on the page is June 2013. Looks like it's constantly updated, great! – KShan Jun 24 '13 at 21:15
  • My problem is that I DON'T WANT TO OPEN THE FILE IN VISUAL STUDIO. I want the file to open in SQL Server Management Studio... which is open... and which loads files VERY quickly. And it used to work just fine. Ugh. Now even double-clicking from File Explorer tries to open the SQL files in VS2012, which takes FOREVER. I hate this. – pmbAustin Oct 04 '13 at 18:45
  • @pmbAustin you should open a new question for this issue. it' s not likely that anyone will answer here. – Brian Sweeney Aug 14 '14 at 14:00
  • @BrianSweeney I have, long ago, accepted an answer, and IMHO, that is enough. – ProfK Aug 15 '14 at 08:09
  • updated link: https://msdn.microsoft.com/en-us/data/hh297027. Note that iso links do not work (hope they do in the future) – Kat Lim Ruiz Mar 23 '15 at 19:00
7

Yes, yet another bug in SQL Server 2012 roll eyes

Right click on the SQL file and choose "Open With...". Choose "Source Code (Text) Editor" and choose "Set as Default".

Now it works again.

Lars
  • 119
  • 2
  • 1
    How is this a fix for the problem? All you've managed to do is to open the a SQL file as a plain text file. You still won't be able to connect with the server explorer or execute queries. – John Leidegren Dec 06 '12 at 13:22
  • Ctrl + MAJ +E doesn't run the query – Portekoi Jun 23 '15 at 08:27
1

Almost a year later, but I found the answer from joerage to be more helpful.

Default to the T-SQL Pane view within Visual Studio 2012 Database Project

Community
  • 1
  • 1
Hogan
  • 219
  • 4
  • 11