Converting WQL to SQL

By now, you are probably writing queries you find useful enough that you want to move them into a SQL Server Reporting Services (SSRS) report to leverage all the formatting, sharing, and scheduling capabilities! Chapter 18, “Reporting,” discusses SSRS in depth.

Now examine the query used previously in the “Example: Querying for Devices with a Hardware Scan in the Last 15 Days” section. To convert this query to SQL quickly, look at the ConfigMgr logs. Open smsprov.log and execute the query you want to convert. Look for a line that begins with Execute WQL. This entry displays the actual WQL query issued:

Execute WQL  =select SMS_R_System.Name, SMS_G_System_WORKSTATION_STATUS.LastHardwareScanfrom  SMS_R_System inner join SMS_G_System_WORKSTATION_STATUS ...

Get System Center 2012 Configuration Manager Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.