SQL Server ->> 获取服务器名字和SQL SERVER实例名的几种函数
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