Change default login SQL Server Management Studio (SSMS)

18,454

Solution 1

From Removing the remembered login and password list in SQL Server Management Studio:

You can delete all remembered links by deleting or renaming a file.

SQL Server Management Studio 2008 delete the file C:\Users\%username%\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

SQL Server Management Studio 2005 delete the file – same as above answer but the Vista path. C:\Users\%username%\AppData\Roaming \Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

These are the names for Vista/Win7

Solution 2

For SQL Server Management Studio 15.0.18330.0 (aka v. 18.5):

  1. Go to C:\Users[YOURNAMEHERE]\AppData\Roaming\Microsoft\SQL Server Management Studio\18.0
  2. Open the UserSettings.xml in your favorite text editor
  3. Search for the username you want to get rid of. You'll find it between an opening and closing UserName tag (e.g. < UserName >USERNAMEYOUWANTTODELETE< / UserName >). That tag will be inside a ServerConnectionSettings tag, which will be inside of an Item tag, inside an Element tag, inside of a Connections tag, inside of a ServerConnectionItem tag (so, ServerConnectionItem > Connections > Element > Item > ServerConnectionSettings > UserName)
  4. Delete the entire Element tag that contains the Username tag for the username you want to get rid of. Note that there are Element tags at higher and lower levels than the one you want to delete. Don't just delete the first Element tag you find. Delete the specific one that contains the Item tag which contains the ServerConnectionSettings tag which contains the UserName tag that you want to delete.
  5. Save the UserSettings.xml file

You're done. That user profile should be toast. Unless you had SSMS open while you did it, in which case the UserSettings.xml will be regenerated to what it was when you opened SSMS, and you'll have to do it all over again. Close SSMS first!

Solution 3

You can simply highlight the server name and click DEL on keyboard, same thing for the logins

enter image description here

Share:
18,454
George
Author by

George

Updated on June 05, 2022

Comments

  • George
    George about 2 years

    Some time ago I created a new login to my local SQL Server 2008 Express database server, called "sa_readonly". Now everytime I start SQL Server Management Studio, it displays the "Connect to Server" form, with the default login set to "sa_readonly". This login doesn't exist anymore, and I want to change the default login to "sa". How do i do that?