SELECT @@servicename
AS Servicename --returns instance name, even if this is the default
(MSSQLSERVER)
SELECT
SERVERPROPERTY ('InstanceName') AS InstanceName --null mean is defalut
select @@SERVERNAME
AS SQLclusterName
SELECT CONVERT(char(20),
SERVERPROPERTY('servername'))AS WindowsClusterName --use this name to connect
to db
SELECT
@@SERVERNAME AS pre_change_name,
--returns servername\instance as far as this is not the default instance
Serverproperty('Servername') AS
current_server_name
No comments:
Post a Comment