How to remove cached server names from the Connect to Server dialog?

40,519

Solution 1

As of SQL Server 2012 you no longer have to go through the hassle of deleting the bin file (which causes other side effects). You should be able to press the Delete key within the MRU list of the Server Name dropdown in the Connect to Server dialog. This is documented in this Connect item and this blog post.

To be clear, since a couple of people seemed to have trouble with this for months: You need to click on the Server name: dropdown, and down-arrow or hover with your mouse until the server you want to remove is selected, and then press Delete. In this screen shot, I'm going to press Delete now, and it will remove the server ADMIN:SHELDON\SQL2014 from my MRU list. Note that because I merely hovered with my mouse, this is not even the server that is showing in the Server name: text box.

enter image description here

Note that if you have multiple entries for a single server name (e.g. one with Windows and one with SQL Auth), you won't be able to tell which one you're deleting.

Solution 2

Found it!

C:\Users\%username%\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\SqlStudio.bin

So the answer is as before: delete the file, or use some nifty PowerShell magic to edit it.

Solution 3

As for SQL Server Management Studio v18 it appears this file is now XML and you can edit it directly: %APPDATA%\Microsoft\SQL Server Management Studio\18.0\UserSettings.xml

Solution 4

If you want to remove particular account or update password on Windows 10 then you can go to Windows Credentials in Credential Manager and update or remove related entry: Control Panel >> Credential Manager >> Windows Credentials >> Microsoft:SSMS

enter image description here

Share:
40,519
Damian Powell
Author by

Damian Powell

Geek. Drummer. Photographer. Carnivore.

Updated on January 24, 2022

Comments

  • Damian Powell
    Damian Powell over 2 years

    Or, to put it another way, where is SqlStudio.bin for SQL Server 2012? It doesn't seem to be in the place that would be expected by looking at this other SO question.

  • Dan
    Dan over 11 years
    I used this method to reset the list of remembered users on a server. If you delete the server, it also deletes the list of users that have ever been used to connect to the server.
  • JoeBrockhaus
    JoeBrockhaus over 10 years
    I'm using SSMS 11.0.3128.0 and this does not work still (anymore?). I had to resort to Damian's answer below. If I had to guess, this 'fix' probably didn't make the final product cut because it clouds the behavior of native text delete. (Notice how in the MSDN blog post there was a consideration to keep the 'deleted' item's text in the textbox after hitting the delete? That's a poor UX decision - what if you just wanted to delete the text, not the entries?)
  • Adir D
    Adir D over 10 years
    @JoeBrockhaus Yes, it works. Were you expecting it to visibly remove the entry from the list as you pressed delete? I don't think it works that way. Or perhaps you are in a VM or your delete key inadvertently cleared the active entry as if it were typed in, rather than deleting the entry in the list that was highlighted. As for the UX design, don't complain to me, I'm just the messenger. This is not exactly the solution I had in mind when I filed this Connect item 5 years ago...
  • JoeBrockhaus
    JoeBrockhaus over 10 years
    There may have been some updates that installed afterwards that bumped the release, but all I meant is I just downloaded and installed from MSDN today. I've tried it on multiple machines in different environments on different hardware and still no luck. Deleting the bin file is an easy solution for me - I don't care about any of the other settings affected by removing it.
  • Adir D
    Adir D over 10 years
    @JoeBrockhaus Then use the other solution and delete the .bin file. shrug Again, I'm not at your machine, so I have no idea if or why it is really not working for you.
  • Andriy M
    Andriy M over 10 years
    Never heard of this feature, tried just now, and it worked. The About box says I'm using Microsoft SQL Server Management Studio 11.0.3128.0. I simply clicked the down button and pressed Delete. It didn't matter that there was text in the edit box, in fact the text wasn't even removed. I'm thrilled.
  • TheRubberDuck
    TheRubberDuck almost 10 years
    I'm having the same problem as @JoeBrockhaus. I've noticed that the "press delete" method works on the server name, but not on the login. This might explain the disconnect the two of you had. Any additional input?
  • Adir D
    Adir D almost 10 years
    @EnvisionAndDevelop Not sure I understand. The connect to dropdown exposes server/instance name, and that's what you can delete. You can't delete just a login name from the login dropdown. Well, prior to connecting, you can remove what's there, but SSMS will still remember the login name that was there when you pulled the server name from the server name dropdown.
  • Adir D
    Adir D almost 10 years
    @JoeBrockhaus The way it's supposed to work is WHEN THE DROPDOWN IS OPEN, you cursor down so that an entry from the list is highlighted. Clicking delete should remove that entry from the list (I just tried it, and it worked fine), and it doesn't remove the text in the Server name: box. If you are in a VM or RDP session or something, you may have to extend the keystroke by using Ctrl+Del, or Fn+Delete, or Shift+Delete. In a Parallels VM on a Mac, I need to use Fn+Del. Also, you need to be absolutely certain you are using SSMS 2012 or better. This won't work on older versions of SSMS.
  • JoeBrockhaus
    JoeBrockhaus almost 10 years
    OK, so I'll concede this does work, but not how everyone has described it: The important detail is that the list has to be open, which is counter to the logic that you have to 'select the item' in the list, which is what everyone has been saying. Even that blog post says select with mouse or keyboard, which is why it didn't make sense originally. It requires a mouse to first click the dropdown, hover the item, and press delete while it's 'hot' in the list.
  • TheRubberDuck
    TheRubberDuck almost 10 years
    That explains my confusion; the question begins with "How to remove cached Login", which is what I expected to find the answer to, but you say "You can't delete just a login name from the login dropdown". Maybe that should be clarified in your answer.
  • Adir D
    Adir D almost 10 years
    @EnvisionAndDevelop Well, since the user accepted my answer two years ago today, it's obvious that this solved the problem they were having. So instead, I've clarified the question.
  • TheRubberDuck
    TheRubberDuck almost 10 years
    I highly suspect that the user accepted your answer because it was helpful, and because he had the only other answer and didn't want to accept it. Either way, why are you reluctant to add a legitimately helpful sentence to your answer? Do you think it would hurt to be clear about it? It seems weird to me that you would change someone else's question to fit your answer than to improve your answer to address both possible questions.