Any relation between SQL Server Service Name and Instance Name?
Yes, the service name is always MSSQL$<Instance Name>
for a named instance and MSSQLSERVER
for a default instance. I don't believe either can be altered or overridden, nor can I think of any reason why you'd want to.
You can enumerate the installed instances on a server via the registry, using Powershell for example:
Get-ItemProperty 'HKLM:\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL'
Mark showed you a way to get this information directly from the registry, but another way to do this would be through WMI, consumed by PowerShell:
Get-WmiObject -ComputerName "YourDestinationServer" -Namespace "root\microsoft\sqlserver\computermanagement11" -Class "SqlService" |
Where-Object {$_.SQLServiceType -eq 1} |
Select-Object ServiceName, DisplayName,
@{Name = "StateDesc"; Expression = {
switch ($_.State) {
1 { "Stopped" }
2 { "Start Pending" }
3 { "Stop Pending" }
4 { "Running" }
5 { "Continue Pending" }
6 { "Pause Pending" }
7 { "Paused" }
}
}}
The above command will give you the state of the SQL Server engine service(s) on a particular machine.