Adding Operating System Names Into SSRS Reports

By Garth Jones

In the forums I see a lot of people asking questions about how to query for OS names.

Simply taking the OS name for the v_R_System SQL view in an SSRS report will not distinguish between different OS versions such as Windows 7 Professional, Enterprise, or Ultimate.

However, with a small change to this query, you will be able to get the exact Windows version that each PC is running.

Using the following query as an example, you can see that I am listing only those PCs running Windows 7 (Microsoft Windows NT Workstation 6.1).

Select

      R.Name0,

      R.Operating_System_Name_and0,

      OS.Caption0

From

      dbo.v_R_Systemr

      leftouterjoindbo.v_GS_OPERATING_SYSTEMOSonR.ResourceID=OS.ResourceId

Where

      R.Active0= 1

      andR.client0= 1

      andR.Operating_System_Name_and0=‘Microsoft Windows NT Workstation 6.1′

Orderby

      R.Operating_System_Name_and0

OS Name Results

Notice within the results that v_R_System SQL view (R.Operating_System_Name_and0) does not distinguish between Ultimate and Professional, but the v_GS_OPERATING_SYSTEM (OS.Caption0) does make this distinction.

With only a small change to your query you can display the true OS name (OS.Caption0) for each PC.

email

Written by , Posted .