在 SQL Server Management Studio 中从 VS2010 启动 SQL Server 2008

时间:2023-02-07
本文介绍了在 SQL Server Management Studio 中从 VS2010 启动 SQL Server 2008 Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我的笔记本电脑装有 Windows 7,x64 位,是去年 12 月(2 个月前)制造的.它安装了 Microsoft Visual Studio 2010SQL Server 2008 Express,但我之前没有在这台电脑上使用过Sql2008".

SQL Server Management Studio 一直安装,我用它连接到我们公司的 SQL Server 实例.

现在,我需要对一个未返回我们期望的数据的大型存储过程进行一些开发和调试.我获得了数据库 companyDB.bak 的备份,并将其移动到我的 Win7x64 笔记本电脑的以下文件夹中:C:\Temp\companyDB.bak.

我打开 SQL Server Management Studio 并选择 (本地) 并单击连接":

一段时间后,我收到错误消息:

<块引用>

与 SQL Server 建立连接时发生与网络相关或特定于实例的错误.服务器未找到或无法访问.验证实例名称是否正确以及 SQL Server 是否配置为允许远程连接.(提供程序:命名管道提供程序,错误:40 - 无法打开与 SQL Server 的连接)(Microsoft SQL Server,错误:2)

我做了一些研究,发现了这个有用的链接:

在安装过程中,我收到此错误消息,指出在删除 **SQL Server 2005 Express Tools" 之前无法安装:

现在下面,如果你注意到了,我搜索了我电脑下安装的项目,标题中唯一带有2005"的是VC++ 2005 Redistributable::>

所以,我取消了安装并重新开始,这次选择了从 SQL Server 2000、SQL Server 2005 或 SQL Server 2008 升级"选项,但我收到了相同的错误消息.

我似乎无法继续了.

显然,我安装的一些应用程序需要VC++ 2005 Redistributable,否则几个月前我不会安装它.

我该如何进行?

[更新]:

遵循 Davide Mauri 的 SQL Server 2008 R2 Installation and the Phantom of SQL Server 2005 Express 博客,我在日志文件C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\yyyymmdd_hhmmss\Detail.txt".

它只指向一个注册表项(他指向两个):""

初始化规则目标对象:Microsoft.SqlServer.Configuration.SetupExtension.Sql2005SsmsExpressFacetSco:尝试创建基本注册表项 HKEY_LOCAL_MACHINE,机器Sco:试图打开注册表子项Sco:试图打开注册表子项 SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM规则 'Sql2005SsmsExpressFacet' 检测结果:SQL 2005 Ssms EE installed=True评估规则:Sql2005SsmsExpressFacet在机器上运行的规则:5000-C6E8-1规则评估完成:失败规则评估消息:已安装 SQL Server 2005 Express Tools.要继续,请删除 SQL Server 2005 Express Tools.

但是,我的注册表甚至没有那个目录:

[更新 2]:

好的,所以我们的 IT 人员给了我完整的 SQL Server 2008 R2 CD 来安装,但我仍然遇到同样的障碍,认为 SQL Server 2005 Express 工具 仍然安装 - 所以我无法前进.

解决方案

为了解决这个问题,我做了以下事情:

  • 卸载我拥有的所有 SQL Management Studio 实例
  • 重启
  • 安装 SQL Server 2008(不是 Express 版本)
  • 重启

多田!

我猜微软喜欢销售他们的产品,而且效果很好.

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.

解决方案

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.

这篇关于在 SQL Server Management Studio 中从 VS2010 启动 SQL Server 2008 Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:用于从另一个表插入常量加值的存储过程 下一篇:使用来自 UDF 的结果集插入表变量

相关文章

最新文章