How to hide hostname in SQL Server – SSMS

As a DBA, its our job to keep an eye on the database to make sure it’s performing well and in safe hands, so we often query into our database to see who are currently logged-in and what have been they executing on the database etc etc?  Every DBA does that and they do have some own handwritten query to find out the user and session information. Likewise I have one too, which gives me the hostname, program name, login name, status, total elapsed time and the query. This is how, I usually visit my SQL Server to find out the session statistics.

Now you must be wondering, is there a way to hide hostname and program name from where a connection is being made to SQL Server via SSMS? Yes, there is a way!!

Step 01: Open SSMS → “New Connection” → “Options >>”

hide-hostname-in-sql-server-01

Step 02: “Additional Connection Parameters” → In the text area put below string
Workstation ID=”PRASAD-SAHOO”;Application Name=”WWW.SQLINDIA.COM”

hide-hostname-in-sql-server-02

Step 03: We have overridden the connection information, now log-in and verify the same by executing below queries.

hide-hostname-in-sql-server-03Important Note: Do not try at office, DBAs are pretty smart enough to catch you  😛

Prasad Sahoo

Prasad Sahoo, is an enthusiast of Microsoft technologies in general and a passionate database professional, mainly focusing on SQL Server performance tuning and business intelligence. He has contributed a long time of his career working on SQL Server and other RDBMS. If he is not busy with SQL stuff then he must be watching some Hollywood movies.

Leave a Reply

%d bloggers like this: