問(wèn)題描述
我的筆記本電腦裝有 Windows 7,x64 位,是去年 12 月(2 個(gè)月前)制造的.它安裝了 Microsoft Visual Studio 2010 和 SQL Server 2008 Express,但我之前沒(méi)有在這臺(tái)電腦上使用過(guò)Sql2008".
SQL Server Management Studio 一直安裝,我用它連接到我們公司的 SQL Server 實(shí)例.
現(xiàn)在,我需要對(duì)一個(gè)未返回我們期望的數(shù)據(jù)的大型存儲(chǔ)過(guò)程進(jìn)行一些開(kāi)發(fā)和調(diào)試.我獲得了數(shù)據(jù)庫(kù) companyDB.bak 的備份,并將其移動(dòng)到我的 Win7x64 筆記本電腦的以下文件夾中:C:\Temp\companyDB.bak
.
我打開(kāi) SQL Server Management Studio 并選擇 (本地) 并單擊連接":
一段時(shí)間后,我收到錯(cuò)誤消息:
<塊引用>與 SQL Server 建立連接時(shí)發(fā)生與網(wǎng)絡(luò)相關(guān)或特定于實(shí)例的錯(cuò)誤.服務(wù)器未找到或無(wú)法訪問(wèn).驗(yàn)證實(shí)例名稱(chēng)是否正確以及 SQL Server 是否配置為允許遠(yuǎn)程連接.(提供程序:命名管道提供程序,錯(cuò)誤:40 - 無(wú)法打開(kāi)與 SQL Server 的連接)(Microsoft SQL Server,錯(cuò)誤:2)
我做了一些研究,發(fā)現(xiàn)了這個(gè)有用的鏈接:
在安裝過(guò)程中,我收到此錯(cuò)誤消息,指出在刪除 **SQL Server 2005 Express Tools" 之前無(wú)法安裝:
現(xiàn)在下面,如果你注意到了,我搜索了我電腦下安裝的項(xiàng)目,標(biāo)題中唯一帶有2005"的是VC++ 2005 Redistributable::>
所以,我取消了安裝并重新開(kāi)始,這次選擇了從 SQL Server 2000、SQL Server 2005 或 SQL Server 2008 升級(jí)"選項(xiàng),但我收到了相同的錯(cuò)誤消息.
我似乎無(wú)法繼續(xù)了.
顯然,我安裝的一些應(yīng)用程序需要VC++ 2005 Redistributable,否則幾個(gè)月前我不會(huì)安裝它.
我該如何進(jìn)行?
[更新]:
遵循 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".
它只指向一個(gè)注冊(cè)表項(xiàng)(他指向兩個(gè)):""
初始化規(guī)則目標(biāo)對(duì)象:Microsoft.SqlServer.Configuration.SetupExtension.Sql2005SsmsExpressFacetSco:嘗試創(chuàng)建基本注冊(cè)表項(xiàng) HKEY_LOCAL_MACHINE,機(jī)器Sco:試圖打開(kāi)注冊(cè)表子項(xiàng)Sco:試圖打開(kāi)注冊(cè)表子項(xiàng) SOFTWARE\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM規(guī)則 'Sql2005SsmsExpressFacet' 檢測(cè)結(jié)果:SQL 2005 Ssms EE installed=True評(píng)估規(guī)則:Sql2005SsmsExpressFacet在機(jī)器上運(yùn)行的規(guī)則:5000-C6E8-1規(guī)則評(píng)估完成:失敗規(guī)則評(píng)估消息:已安裝 SQL Server 2005 Express Tools.要繼續(xù),請(qǐng)刪除 SQL Server 2005 Express Tools.
但是,我的注冊(cè)表甚至沒(méi)有那個(gè)目錄:
[更新 2]:
好的,所以我們的 IT 人員給了我完整的 SQL Server 2008 R2 CD 來(lái)安裝,但我仍然遇到同樣的障礙,認(rèn)為 SQL Server 2005 Express 工具 仍然安裝 - 所以我無(wú)法前進(jìn).
為了解決這個(gè)問(wèn)題,我做了以下事情:
- 卸載我擁有的所有 SQL Management Studio 實(shí)例
- 重啟
- 安裝 SQL Server 2008(不是 Express 版本)
- 重啟
多田!
我猜微軟喜歡銷(xiāo)售他們的產(chǎn)品,而且效果很好.
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.
這篇關(guān)于在 SQL Server Management Studio 中從 VS2010 啟動(dòng) SQL Server 2008 Express的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!