Yesterday I had faced error when I was connecting SQL Server using 127.0.0.1. I had immediately checked if SQL Server is working perfectly by connecting to it by specifiing my local box computer. While I was doing this suddenly I realize that it is indeed interesting to know how many different way we can connect to SQL Server which is installed in the local box.
I created list of 5 different way but I am sure there are many more ways and I would like to document there here. Here is my setup. I am attempting to connect to the default instance of SQL Server from the same system where it is installed.
Method 1: Connecting using local host IP 127.0.0.1
Method 2:Â Connecting using just a single dot (.)
Method 3: Connecting using (local)
Method 4: Connecting using localhost
Method 5: Connecting using computer name – in my case it is BIG
Here are my two questions for you? (Scroll below the image)
1) Which is your favorite method?
2) What are other methods you are familiar with to connect to local host?
Reference:Â Pinal Dave (https://blog.sqlauthority.com)
38 Comments. Leave new
I prefer connecting as localhost. This is because most of the SSAS sample projects of Adventureworks datawarehouse (available online) are configured with localhost as the sql server name. Hence the sample projects work without any changes.
Wow… I love the way “./SQLExpress” worth knowing that there are several different techniques for doing such simple thing :)
single dot would be your fav…
Preferred method is the Instance name in case there are multiple local instances
using computerName
How to fix this SQL server error during installation ?
The SQL Server service failed to start. For more infomation, see the SQL Server Books Online topics, “How to: View SQL Server 2005 Setup Log Files” and “Starting SQL Server Manually.”
I prefer computer name or dns alias.
We use dns alias for easy of moving applications.
I know a lot of people who use the single dot (.), “(local)” and “localhost” to connect to their local instance, but it does suffer from one big drawback in an environment where servers are not rebuilt from scratch, but are instead cloned from a pre-configured disk image.
When the disk image was built, the SQL server instance would have picked up the template name as default instance name. Later when the image is cloned, most IT departments forget to rename the SQL instances on that server. The connections to local host from the same machine as the instance works, but the moment they try to connect to that instance from a remote machine, all hell breaks loose.
According to me, it’s *always* better to use the actual SQL Server instance name.
(By the way: @Rajasekharan V: SSMS has some cool parameters, but this is the first time I have seen someone use the SSMS command-line parameters in daily life! It’s nice!)
Instance Name .. :)
always dot (.) sir :)
There is two more method to connect with local instance.
. (dot)
(local)
localhost
Host Name
::1
Private IP
Loopback IP(127.0.0.1)
Name pipe (ie. \.pipesqlquery)
Mostly I am using Host Name or dot.
Good advice! I had this happen at my location.
hello sir…
i unable to connect with default instance single dot (.) in my laptop.. it gives server not found error …. then what should i do…. ???
i suffer from the same problem
Hi,
I have one doubt on window authentication, if logged in user is not a member of sql server account then how he can logged in sql and server and how can have full access of DB?
under which security group he will get access?
Pls clear my doubt.