I am used to exploring what is available in the technology of love – SQL Server. As I was exploring into one of the simplest set of DMVs which have been available for ages. There are several ways to get the OS information inside SQL Server. One of the ways is to use the DMV as shown below.

SELECT * FROM sys.dm_os_windows_info

The other way to know the OS related information about SQL Server is to scan your Error Logs. During startup, SQL Server logs all this information which is a wealth of information. A sample output is shown below:

Microsoft SQL Server 2016 (SP1) (KB3182545) – 13.0.4001.0 (X64)
Oct 28 2016 18:17:30
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Enterprise 6.3 <X64>

When I started to write about this blog is when I realized will it also work similar on SQL vNext. To my surprise, there has been a new DMV that is getting added for Linux in mind. The “windows” term is getting removed and it made a lot of sense.

SELECT * FROM sys.dm_os_host_info

If you installed the vNext version then this DMV will work. On a side note, I am interested in knowing how many of you have installed the CTP of SQL Server on Linux? What has been your experience? Let me know.

Reference: Pinal Dave (https://blog.sqlauthority.com)

First appeared on SQL SERVER – SQL Server: Getting OS information using DMV

About the Author

Pinal Dave

Pinal Dave is a Microsoft Technology Evangelist (Database and BI). He has written over 1700 articles on the subject on his blog at http://blog.sqlauthority.com. He is a dynamic and proficient Principal Database Architect who specializes in SQL Server Performance Tuning and has 7+ years of hands-on experience. He holds a Masters of Science degree and a number of certifications, including MCTS, MCDBA and MCAD (.NET). He is also Regional Mentor for PASS Asia. Prior to joining Microsoft he was awarded Microsoft MVP award for three continuous years for his contribution in community.

Start the discussion at forums.toadworld.com