How to know the Instance name of SQL Server?

Posted on 2009-04-12
Last Modified: 2012-06-27
How to know the Instance name of SQL Server? Can it have multiple instances?
Question by:baberamin
LVL 37

Expert Comment

ID: 24128205
you can have multiple instances on the same machine

what do you mean by how to know the instance name?
you mean in an application or as a windows user?
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24128206
>Can it have multiple instances?

>How to know the Instance name of SQL Server?
you specify the name during installation.
after that, you can check in the windows services applet, the names are part of the service name, aka

or simply

for a unnamed (default) instance
LVL 31

Expert Comment

ID: 24128432
from DOS prompt, run command

osql -L

you will see all SQL Server's instances from your network, including your own server.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Expert Comment

ID: 24128631
you can make use of serverproperties function... to know the instance name and In One server there may be more than one Instance ... This may Hold More than one DB....
LVL 60

Expert Comment

ID: 24129182
for the name:

select serverproperty('servername')

Author Comment

ID: 24135473
what about these command? does they do the same?

select @@servername
LVL 31

Accepted Solution

RiteshShah earned 500 total points
ID: 24135483
sp_helpserver gives you details about all the available server including linked server.

select @@servername can give you sql server name in which you are currently connected with.

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CPU high usage when update statistics 2 30
Deal with apostrophe in stored procedures 8 43
replace \ by - in select 4 21
Job - date manual 1 22
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question