SQL语句实现查询SQL Server服务器名称和IP地址
获取服务器名称:SELECT SERVERPROPERTY("MachineName")select @@SERVERNAMEselect HOST_NAME()获取IP地址可以使用xp_cmdshell执行ipconfig命令:--开启xp_cmdshell exec sp_configure"show advanced options", 1 reconfigure with override exec sp_configure"xp_cmdshell...