Launching SQL Server 2008 Express from VS2010 in SQL Server Management Studio

[亡魂溺海] 提交于 2019-12-11 18:42:25

问题


My laptop has Windows 7, x64 bit, and was built this past December (2 months ago). It has Microsoft Visual Studio 2010 installed with SQL Server 2008 Express, but I had not used "Sql2008" before on this PC.

SQL Server Management Studio has been installed all that time, and I use it to connect to our company's instance of SQL Server.

Now, I need to do some development and debugging on a large stored procedure that is not returning the data we expect. I got a backup of the database companyDB.bak and moved that to my Win7x64 laptop in this folder: C:\Temp\companyDB.bak.

I open SQL Server Management Studio and select (local) and click "Connect":

After some time, I get error message:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

I do some research and found this helpful link: SQL SERVER – FIX : ERROR : (provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: )

His first step is to make sure SQL Server is running, which it seems to be:

Next, it says to make sure I am using TCP/IP Port 1433. When I looked, it seemed all of mine were BLANK, so I changed them so that all use Port 1433, then Stopped and Restarted the service:

OK, now I can get my local instance to start up.

When I attempted to restore the database using my "companyDB.bak" file, I get an error saying the database I am restoring from is newer than I am saving it to:

System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. That version is incompatible with this server, which is running version 10.00.2531. Either restore the database on a server that supports the backup, or use a backup that is compatible with this server. (Microsoft.SqlServer.Smo)

So, I downloaded SQLEXPRWT_x64_ENU.exe from here: from here: http://www.microsoft.com/en-us/download/details.aspx?id=30438

During installation, I get this error saying that it can't install until **SQL Server 2005 Express Tools" are removed:

Now below, if you will notice, I did a search of the items installed under my computer, and the only thing there is with "2005" in the title is VC++ 2005 Redistributable:

So, I cancelled the installation and started it again, this time selecting the "Upgrade from SQL Server 2000, SQL Server 2005 or SQL Server 2008" option, but I got the same error message.

I do not seem to be able to continue.

Obviously, some of my installed applications need VC++ 2005 Redistributable, or I would not have installed it a few months ago.

How do I proceed?

[UPDATE]:

Following Davide Mauri's SQL Server 2008 R2 Installation and the Phantom of SQL Server 2005 Express blog, I searched for the term Sql2005SsmsExpressFacet in the log file "C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\yyyymmdd_hhmmss\Detail.txt".

It only pointed to a single registry entry (where his pointed at two): ""

Init rule target object: Microsoft.SqlServer.Configuration.SetupExtension.Sql2005SsmsExpressFacet
Sco: Attempting to create base registry key HKEY_LOCAL_MACHINE, machine 
Sco: Attempting to open registry subkey 
Sco: Attempting to open registry subkey SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM
Rule 'Sql2005SsmsExpressFacet' detection result: SQL 2005 Ssms EE installed=True
Evaluating rule        : Sql2005SsmsExpressFacet
Rule running on machine: 5000-C6E8-1
Rule evaluation done   : Failed
Rule evaluation message: The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.

But, my registry does not even HAVE that directory:

[UPDATE 2]:

OK, so our IT guy has given me the full blown SQL Server 2008 R2 CD to install, but I am still hitting this same roadblock with it thinking that SQL Server 2005 Express tools are still installed - so I can not move forward.


回答1:


To fix this, I did the following:

  • Uninstall all of the SQL Management Studio instances I had
  • reboot
  • Install SQL Server 2008 (not the Express version)
  • reboot

Tada!

I guess Microsoft likes selling their product, and it worked.



来源:https://stackoverflow.com/questions/22050470/launching-sql-server-2008-express-from-vs2010-in-sql-server-management-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!