简体   繁体   English

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

[英]Launching SQL Server 2008 Express from VS2010 in SQL Server Management Studio

My laptop has Windows 7, x64 bit, and was built this past December (2 months ago). 我的笔记本电脑具有Windows 7,x64位,并于去年12月(2个月前)制造。 It has Microsoft Visual Studio 2010 installed with SQL Server 2008 Express , but I had not used "Sql2008" before on this PC. 它具有随SQL Server 2008 Express一起安装的Microsoft Visual Studio 2010 ,但是我以前在此PC上没有使用过“ Sql2008”。

SQL Server Management Studio has been installed all that time, and I use it to connect to our company's instance of SQL Server. 一直都在安装SQL Server Management Studio ,我用它来连接到我们公司的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 . 我获得了数据库companyDB.bak的备份,并将其移至以下文件夹中的Win7x64便携式计算机: C:\\Temp\\companyDB.bak

companyDB.bak

I open SQL Server Management Studio and select (local) and click "Connect": 我打开SQL Server Management Studio并选择(本地) ,然后单击“连接”:

(本地)

After some time, I get error message: 一段时间后,我收到错误消息:

A network-related or instance-specific error occurred while establishing a connection to SQL Server. 建立与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. 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2) (提供程序:命名管道提供程序,错误:40-无法打开与SQL Server的连接)(Microsoft SQL Server,错误:2)

错误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: ) 我进行了一些研究,发现了这个有用的链接: SQL SERVER-FIX:错误:(提供者:命名管道提供程序,错误:40-无法打开与SQL Server的连接)(Microsoft SQL Server,错误:)

His first step is to make sure SQL Server is running, which it seems to be: 他的第一步是确保SQL Server正在运行,这似乎是:

SQL Server(SQLEXPRESS)

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: 接下来,它说确保我正在使用TCP / IP端口1433。当我看时,似乎我的所有端口都是空白的,因此我更改了它们,使其全部使用端口1433,然后停止并重新启动该服务:

TCP端口1433

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: 当我尝试使用“ companyDB.bak”文件还原数据库时,出现错误,提示我要还原的数据库比将其保存到的数据库新:

System.Data.SqlClient.SqlError: The database was backed up on a server running version 10.50.1600. System.Data.SqlClient.SqlError:数据库已备份在运行版本10.50.1600的服务器上。 That version is incompatible with this server, which is running version 10.00.2531. 该版本与此服务器(运行版本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) (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 因此,我从此处下载了SQLEXPRWT_x64_ENU.exe :从此处下载: http : //www.microsoft.com/zh-cn/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: 在安装过程中,我收到此错误消息,指出直到删除“ SQL Server 2005 Express工具”,它才能安装:

SQL Server 2005 Express工具

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 : 现在在下面,如果您会注意到,我搜索了安装在计算机下的项目,标题中唯一带有“ 2005”的是VC ++ 2005 Redistributable

VC ++ 2005可再发行

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. 因此,我取消了安装并重新开始安装,这次选择了“从SQL Server 2000,SQL Server 2005或SQL Server 2008升级”选项,但是我得到了相同的错误消息。

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. 显然,我安装的某些应用程序需要VC ++ 2005 Redistributable ,否则几个月前我将不会安装它。

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". 在Davide Mauri的SQL Server 2008 R2安装和SQL Server 2005 Express幻影博客之后,我在日志文件“ C:\\ Program Files \\ Microsoft SQL Server \\ 100 \\ Setup Bootstrap \\ Log \\ yyyymmdd_hhmmss \\ Detail”中搜索了Sql2005SsmsExpressFacet 。文本”。

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]: [更新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. 是的,所以我们的IT专家给了我完整的SQL Server 2008 R2 CD安装,但是我仍然遇到同样的障碍,因为我认为仍然安装了SQL Server 2005 Express工具 -所以我无法前进。

SQL Server 2008 R2安装

To fix this, I did the following: 为了解决这个问题,我做了以下工作:

  • Uninstall all of the SQL Management Studio instances I had 卸载我拥有的所有SQL Management Studio实例
  • reboot 重启
  • Install SQL Server 2008 (not the Express version) 安装SQL Server 2008(非Express版本)
  • reboot 重启

Tada! 多田!

I guess Microsoft likes selling their product, and it worked. 我猜微软喜欢销售他们的产品,而且效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM