SSMS無法開啟ErrorLog (An exception occurred while executing a Transact-SQL statement or batch. Microsoft.SqlServer.ConnectionInfo)

  • 73
  • 0

Msg 22004, Level 16, State 1, Line 0
Failed to open loopback connection. Please see event log for more information.
Msg 22004, Level 16, State 1, Line 0
Error log location not found.
 

問題:

SSMS 無法開errorlog, 執行sp_readerrorlog也會有error 

影像

解法:

Disable the authentication loopback check 
Re-enable the behavior that exists in Windows Server 2003 by setting the DisableLoopbackCheck registry entry in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa registry subkey to 1. 

To set the DisableLoopbackCheck registry entry to 1, follow these steps on the client computer: 
1.     Click Start , click Run , type regedit , and then click OK . 
2.     Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa 
3.     Right-click Lsa , point to New , and then click DWORD Value. 
4.     Type DisableLoopbackCheck , and then press ENTER. 
5.     Right-click DisableLoopbackCheck , and then click Modify . 
6.     In the Value data box, type 1 , and then click OK . 
7.     Exit Registry Editor. 
8.     Restart the computer. 
 

但 named instance , 非1433 port的機器,用這個方法無效 XD

最後發現是因為通訊協定裡的Shared Memory 已停用

enable shared memoery + 重啟sql service就沒問題了!!