SQL Server: Get ServerName, InstanceName and Version

I needed to know the server name and instance name of an SQL Server. This script will give us the results.
SELECT
@@servername AS 'Server Name'
,@@servicename AS 'Instance Name'

To check the current version of the SQL Server, we can use below one
select @@version

No comments:

Post a Comment