SQL SERVER在删除自己创建的登录名之后,再次登录时总是显示之前删除的登录名,在19.0版本中没有了SqlStudio.bin文件而是将登录信息放在了:
C:\Users\users\AppData\Roaming\Microsoft\SQL Server Management Studio\19.0\UserSettings.xml文件下。
使用记事本打开。
![](https://img-blog.csdnimg.cn/direct/db88818311c34e41a3225b2b001c8afb.png)
然后删除这些东西即可:(一般这些东西会在<connection>后面,或者一对<Element>中间)。
<Element>
<Time>
<long>-638468806661964764</long>
</Time>
<Item>
<ServerConnectionSettings>
<Password />
<Instance>.</Instance>
<UserName>xiaowang</UserName>
<ServerType>8c91a03d-f9b4-46c0-a305-b5dcc79ff907</ServerType>
<AuthenticationMethod>1</AuthenticationMethod>
<Database />
<Advanced>
<Element>
<Key>
<string>IniDb</string>
</Key>
<Value />
</Element>
<Element>
<Key>
<string>CT</string>
</Key>
<Value>
<string>30</string>
</Value>
</Element>
<Element>
<Key>
<string>ET</string>
</Key>
<Value>
<string>0</string>
</Value>
</Element>
<Element>
<Key>
<string>PSize</string>
</Key>
<Value>
<string>4096</string>
</Value>
</Element>
<Element>
<Key>
<string>EC</string>
</Key>
<Value>
<string>False</string>
</Value>
</Element>
<Element>
<Key>
<string>UCCC</string>
</Key>
<Value>
<string>False</string>
</Value>
</Element>
<Element>
<Key>
<string>CCC</string>
</Key>
<Value>
<string>-986896</string>
</Value>
</Element>
<Element>
<Key>
<string>TSC</string>
</Key>
<Value>
<string>False</string>
</Value>
</Element>
<Element>
<Key>
<string>UCTI</string>
</Key>
<Value>
<string>False</string>
</Value>
</Element>
<Element>
<Key>
<string>CTI</string>
</Key>
<Value>
<string />
</Value>
</Element>
<Element>
<Key>
<string>CES</string>
</Key>
<Value />
</Element>
<Element>
<Key>
<string>CESEnclave</string>
</Key>
<Value />
</Element>
<Element>
<Key>
<string>CESProtocol</string>
</Key>
<Value />
</Element>
<Element>
<Key>
<string>CESUrl</string>
</Key>
<Value />
</Element>
<Element>
<Key>
<string>Prot</string>
</Key>
<Value />
</Element>
</Advanced>
<OtherParams />
</ServerConnectionSettings>
</Item>
</Element>
保存后重启数据库服务即可。