SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQL Server 2017 – DMV – sys.dm_os_host_info

I always love to get my hands dirty with new features of SQL Server. I was exploring SQL Server on Linux, and at a point, I had to check the operating system details of the Linux system. Being lazy to figure out Linux OS command to check the operating system details, I started figuring out the DMVs and found a new;

DMV – sys.dm_os_host_info

It was introduced in SQL Server 2017 (SQL vNext). Before SQL vNext, One of the easiest ways to see the Windows Operating information is to use the DMV;

SELECT * FROM sys.dm_os_windows_info

With the introduction of SQL Server on Linux support, Microsoft introduced a new DMV;

SELECT * FROM sys.dm_os_host_info

Below shows the difference between the DMVs on a Windows and Linux server: 

The above snapshot confirms that we can get multi-OS environments information using the new DMV sys.dm_os_host_info. Another point, you may have noticed that Microsoft has removed the term “windows” and put “host” in the new DMV. It does make sense. 

Here are the host_release & host_sku codes, and their descriptions. Only valid for Windows Operating Systems

host_release codes

  • 6.3 is either Windows 8.1, Windows 10 or Windows Server 2012 R2, Windows Server 2016
  • 6.2 is either Windows 8 or Windows Server 2012

host_sku codes

  • 4 =  Enterprise Edition
  • 7 =  Standard Server Edition
  • 8 = Datacenter Server Edition
  • 10 = Enterprise Server Edition
  • 48 = Professional Edition

My suggestion is to move away from the DMV sys.dm_os_windows_info and start using sys.dm_os_host_info in multi-OS environments.

Happy Learning!!! TGIF ??

The post SQL Server 2017 – DMV – sys.dm_os_host_info appeared first on .

SQL Geek

Dharmendra is a SQL Server/Microsoft Data Platform professional with over eight years of experience. He enjoys helping others in the SQL Server community and does this by contributing on blogs, speaking at several SQL events. His passion and focus is to explore and share more and more on SQL Server.

Comments

Leave a comment on the original post [www.dharmendrakeshari.com, opens in a new window]

Loading comments...