我有一個使用osql連接到SQL Server 2005命名實例的腳本。但是腳本引發以下錯誤:連接到SQL Server 2005命名實例的問題
[SQL Native Client]Named Pipes Provider: Could not open a connection to SQL Server [53].
[SQL Native Client]Login timeout expired
[SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
腳本的連接部分如下圖所示:
osql -E -S <servername>\<named_instance> -i D:\scripts\script1.sql -o D:\scripts\script1.txt
我的問題是:是什麼原因造成這個錯誤,什麼是可能的解決方案?
請參閱編輯後的版本。它看起來像我忘記點擊代碼圖標,使代碼看起來應該如此。 – titanium 2009-06-25 20:12:32
我已經找到可能的原因。我查看了SQL Server配置管理器。已命名的實例服務已停止。雖然沒有通過正確的票證或通過電子郵件發送任何通知,但也許我們團隊中的某個人故意阻止了這一點。 – titanium 2009-06-25 20:19:40