Wednesday, July 24, 2013

Delete servers from the list on SQL Server 2012 - Logon Screen

You might have seen below screen countless times and you might wonder what is there isblog about in this simple screen. Well, continue reading and you would get the answer.
Many times, DBA have to login to production server from non-regular machine, may be a developer’s workstation. Once you login to SQL, do your work and close the management studio. Do you know that your server name is saved in management studio? Of course, very useful feature because you may not like to type server name/IP address every time. Whatever servers you have connected, it would be stored by management studio. Butsometime, it’s annoying!
What you would do if you want SQL Server Management Studio to forget “all” the servers listed in drop down of Server name? To do that, you need to know how and where it’s stored. You can use one of my favorite tool from sysinternals called Process Monitor (also known as ProcMon) and easily figure out that this is stored in a file under your windows user profile.
Below is the file in SQL 2008 R2 Management Studio.
%appdata%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
For SQL Server 2012, here is what we can see in ProcMon
So, the path is
%appdata%\Microsoft\Microsoft SQL Server\110\Tools\Shell\SqlStudio.bin
So far, you might wonder, where is the new feature? I have been asked by many users to delete entries from SSMS “Connect to Server” server name list. Well, unofficially, you can delete the file directly which we found via ProcMon. Note that delete file to get rid of server list is not officially supported by Microsoft.
Better way to achieve this is provided in SSMS 2012. To delete the servers from the list, highlight the name we want to delete (via keyboard or mouse) and then press delete key via keyboard. We can’t be multi-select and has to be done one by one. We can delete as many entries we want. I have delete few from first screenshot taken and here is the modified version.
This is not available in SQL 2008 R2 and its previous version. This came from feedback given to SQL Server Product group.
Hope you have learned something new today!
Post a Comment

Find a cool free stuff everyday

Giveaway of the Day

Hiren Bharadwa's Posts

DotNetJalps