SQL SERVER – Fun Post – Connecting Same SQL Server using Different Methods

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)

SQL SERVER - Fun Post - Connecting Same SQL Server using Different Methods connectinglocal

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)

Previous Post
SQL SERVER – FIX ERROR – Cannot connect to . Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. (Microsoft SQL Server, Error: 18452)
Next Post
SQL SERVER – Unable to DELETE Project in Data Quality Projects (DQS)

Related Posts

No results found.

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.

    Reply
  • Wow… I love the way “./SQLExpress” worth knowing that there are several different techniques for doing such simple thing :)

    Reply
  • single dot would be your fav…

    Reply
  • Rachel Fonseca (@Irachelfonseca)
    September 8, 2012 2:02 am

    Preferred method is the Instance name in case there are multiple local instances

    Reply
  • using computerName

    Reply
  • Vikram K Bariya
    September 9, 2012 7:49 am

    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.”

    Reply
  • I prefer computer name or dns alias.
    We use dns alias for easy of moving applications.

    Reply
  • Nakul Vachhrajani
    September 9, 2012 10:52 pm

    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!)

    Reply
  • Instance Name .. :)

    Reply
  • always dot (.) sir :)

    Reply
  • 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.

    Reply
  • Good advice! I had this happen at my location.

    Reply
  • 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…. ???

    Reply
  • vadnereharshalgmailcom
    September 24, 2015 11:12 am

    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.

    Reply

Leave a Reply