7

When I start SQL Server Managaemnt Studio (SSMS), I'm having a problem in connecting to the database.

What will be the 'server name' if my computer's name is Rakesh?

slhck
  • 235,242
Rakesh
  • 81

5 Answers5

2

The server name in SQL Management studio often consists of two parts.

Firstly, there is the portion that identifies the computer, followed by the portion which identifies the SQL instance.

When you install MSSQL Server to your computer, you install an 'instance' which typically has a name associated with it. You may have multiple instances, and you can even elect one of these to be the 'default instance' which is used if no instance name is specified.

As mentioned in other answers, you can browse for an instance using the 'Server Name' drop down box, but this may only work if the Browsing service is enabled on the computer you wish to connect to.

To enable SQL Server Browser, Enable and start the windows service "SQL Server Browser". This should make your instances discoverable. Learn about it here

The Server name syntax is typically Machine\Instance To identify your own machine, you may use 'COMPUTERNAME', 'IPADDRESS', 'localhost', '127.0.0.1', or '.' (which is my preference).

For example:

  • To connect to the default instance, use .
  • To connect to instance 'MySQLservice' on Computer 'BobsComputer' BobsComputer\MySQLservice

If you don't know your installations instance name, you can discover it by opening SQL Server Configuration Manager from your servers start menu. Within the tree, select 'SQL Server Services' and take note of the instance IDs which appear in brackets adjacent to each 'SQL Server' service.

If you are having trouble connecting to a database server, ensure your firewall is configured correctly on the server. Sometimes it is best to temporarily disable the firewall when working through issues like this.

Élie
  • 274
1

If it's your personal computer, use any of the following for server name without the quotes:

  1. "(local)"
  2. "127.0.0.1"
  3. "."
0

TRY THIS!!!

Step 1

You want to connect it locally. It works sometimes writing the name of the your machine (not case sensitive). Although you have an alternative, Only if your machine name doesn't connect.

Essentially, just paste this into the connection window:

(localdb)\MSSqlLocalDb

Or like shown below: Server

Workaround: Use Named Pipes instead

If it doesn’t – well, there’s a workaround, although it’s a bit laborious. It in fact requires you to know the instance name pipe – a weird, nonsensical URI-looking piece of textual vomit you simply can’t guess. And then, most of the time, you can just use your local user account to log in.

The workaround has quite a few steps, and finally comes down to this beautiful screen below:

using pipeline

But how do you figure out the right Server name? Check out the steps below!

Time needed: 10 minutes.

How to connect to local MS SQL Server?

  1. Try using (localdb)\MSSqlLocalDb first That’s definitely the first step – only if it fails, go through the rest of the steps!

  2. Find your friendly local SQL Server Express LocalDB Command Line Tool The location is something like this under your SQL Server’s installation path -> Tools -> Binn.

    So, in order to use the tool, let’s fire up a command line window and write the following command:

    cd “C:\Program Files\Microsoft SQL Server\130\Tools\Binn\” (Replace the version number with whatever’s relevant to your environment!)

0

Under servername, type either
.\
or
.\sqlexpress

.\ is the same as localhost and from your fairly cryptic question I assume it is being accessed locally?

Dave
  • 25,513
0

The server name instance can be specified during SQL Server installation. If you haven't specified any, it's (local). If you don't know what your Server name is:

  1. When you start SSMS, in the Connect to Server dialog, click to expand Server name list
  2. The last item in the drop-down list is Browse for more. Click it

  3. You'll get a new dialog - Browse for Servers. In the Local Servers tab, expand database Engines

All SQL Server instances installed on your local machine are listed here. Select the one you want and make sure you provide valid credentials.