Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 hangs up when opening a .sql file

I launch VS 2010, and simply open any ordinary (or blank) .sql file and it shows up incorrectly drawn inside the IDE. It draws the document tab, but nothing else. If I type on the keyboard, VS locks up. This only appears to be a problem with files that have the extension ".sql" and has no bearing on the actual content. I also noticed that in the Solution Explorer, those .sql files show the icon that is the same one associated with .js files.

like image 651
Lee Grissom Avatar asked Aug 19 '10 22:08

Lee Grissom


People also ask

How do I run a .SQL file in Visual Studio?

In Visual Studio Code, press Ctrl+Shift+P (or F1) to open the Command Palette. Select MS SQL:Connect and choose Enter.

Can I use Visual Studio for SQL?

You can use Visual Studio to create and update a local database file in SQL Server Express LocalDB. You can also create a database by executing Transact-SQL statements in the SQL Server Object Explorer tool window in Visual Studio.


2 Answers

Problem solved. I was able to resolve the problem by running the DACProjectSystemSetup_enu.msi installer found on the VS2010-SP1 ISO under the root directory. You might also need to re-install DACFramework_enu.msi and TSqlLanguageService_enu.msi.

I believe the problem was created as a result of installing SQL Server 2008 R2 after installing VS2010.

like image 55
Lee Grissom Avatar answered Nov 05 '22 01:11

Lee Grissom


I was able to fix the issue by:

  1. Downloading the SP1 DVD ISO from here.

  2. Executing DACProjectSystemSetup_enu.msi from the root of the ISO.

These 2 simple steps resolved it.

like image 9
Mauricio Feijo Avatar answered Nov 05 '22 00:11

Mauricio Feijo