Sql-server – Need a SQL Query for finding OS Version, RAM, etc

sql serverssms

DBAs, I need some help. Is it possible to find below mentioned parameters through SQL query or else GUI (cluadmin, msinfo32, systeminfo, etc.) is the only option. I'm aware of finding below mentioned parameters through GUI, but based on the fact that working with query will save lot of time, I'm looking for a SQL query to get below details in SSMS.

OS Version – (eg., Windows 2012 Server Standard SP1)

RAM (GB) – (eg., 128GB)

Machine Type – (eg., Physical or Virtual)

Installed On – (When SQL instance is installed or built eg., 08 August, 2016)

If SQL instance is in cluster, I'm looking to get below details as well

SQL Virtual Name –

SQL Virtual IP –

Cluster Name –

Cluster IP –

Node1 –

Node1 IP –

Node2 –

Node2 IP –

Best Answer

Check out Glenn Berry's Diagnostic Scripts. He includes a whole range of queries in there for accessing server information, including a basic health check.

You will need to download the set of scripts appropriate for the version of SQL Server you're diagnosing.