• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2027
  • Last Modified:

How to know the Instance name of SQL Server?

How to know the Instance name of SQL Server? Can it have multiple instances?
0
baberamin
Asked:
baberamin
1 Solution
 
momi_sabagCommented:
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?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>Can it have multiple instances?
yes

>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
MSSQLSERVER$

or simply
MSSQLSERVER

for a unnamed (default) instance
0
 
RiteshShahCommented:
from DOS prompt, run command

osql -L

you will see all SQL Server's instances from your network, including your own server.
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
vinurajrCommented:
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....
0
 
chapmandewCommented:
for the name:

select serverproperty('servername')
0
 
baberaminAuthor Commented:
what about these command? does they do the same?

sp_helpserver
select @@servername
0
 
RiteshShahCommented:
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now