For the default instance of SQL Server, the server name is the computer name. For a named instance of SQL Server, the server name is the <computer_name>\<instance_name>, such as ACCTG_SRVR\SQLEXPRESS.
In Microsoft SQL Server Management Studio, in the Object Explorer pane, right click the server and select properties. In the pane, there should be a heading called "Connection" and in that heading a link to a new window called "View connection properties". The value next to "Server name" is the name of your server.
Open up SQL Server Configuration Manager
(search for it in the Start menu). Click on SQL Server Services
. The instance name of SQL Server is in parenthesis inline with SQL Server
service. If it says MSSQLSERVER, then it's the default instance. To connect to it in Management Studio, just type .
(dot) OR (local)
and click Connect. If the instance name is different, then use .\[instance name]
to connect to it (for example if the instance name is SQL2008, connect to .\SQL2008
).
Also make sure SQL Server
and SQL Server Browser
services are running, otherwise you won't be able to connect.
Edit:
Here's a screenshot of how it looks like on my machine. In this case, I have two instances installed: SQLExpress
and SQL2008
.
Run this Query to get the name
SELECT @@SERVERNAME
Open CMD
Run this
SQLCMD -L
You will get list of SQL Server instance
the default server name is your computer name, but you can use "." (Dot) instead of local server name.
another thing you should consider is maybe you installed sql server express edition. in this case you must enter ".\sqlexpress" as server name.
As mentioned by @Khaneddy2013, the cmd SQLCMD -L returns no server name when I run. Bcz I only have installed the SSMS (local db and server were not installed). After tried installing SqlLocaLDB and SQLEXPR32_x86_ENU(32 bit OS) I was able to connect. And now the cmd window shows the server names too.
There are many ways mentioned above. But I use rather simple way (well not simple as SELECT @@SERVERNAME). When you start SQL server management studio you will prompt below GUI
In there Server name is your server name (There may have multiple servers according to you dev environment choose correct one). Hope this helps :)
Note: To connect to server on SQL Server Management Studio(SSMS), we must first install SQL Server.
So steps to proceed are as
Step 1 : Downloads and Install Microsoft SQL Server 2019
Step 2 : Downloads and Install SQL Server Management Studio
If still not able to see the Server name on SSMS, have a look at these three screen:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With