問題描述
我的筆記本電腦裝有 Windows 7,x64 位,是去年 12 月(2 個月前)制造的.它安裝了 Microsoft Visual Studio 2010 和 SQL 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!