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;

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

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 🙂

2 thoughts on “SQL Server 2017 – DMV – sys.dm_os_host_info

  • Aditya

    Wow .. thanks a lot Dharmendra for sharing new DMV..It’s really helpful 🙂

    Reply
  • kevin

    Agreed https://akawn.com/blog/2017/03/sys-dm_os_host_info/ “move away from sys.dm_os_windows_info and start using sys.dm_os_host_info in multi OS environments”

    Reply

Leave a comment

Your email address will not be published. Required fields are marked *