SQL Server ->> 获取服务器名字和SQL SERVER实例名的几种函数

时间:2022-03-07 17:32:52

 

 

SELECT    @@SERVERNAME as [@@SERVERNAME], SERVERPROPERTY('MachineName') MachineName, SERVERPROPERTY('InstanceName') InstanceName, SERVERPROPERTY('ServerName') ServerName,
        SERVERPROPERTY('ComputerNamePhysicalNetBIOS') PhysicalNetBIOS

 

 

结果

@@SERVERNAME          MachineName      InstanceName      ServerName    PhysicalNetBIOS
JerryPC\MSSQLSERVER2014  JerryPC      MSSQLSERVER2014   JerryPC    JerryPC