SCCM SQL queries

Count Configuration Manager client versions in your environment

SQL query for the Configuration Manager database that counts how many computers run each client version.

LanguageSQL
What it does to the systemReads only. It changes nothing.

After a site update, clients upgrade over days or weeks. This query shows how far the client upgrade has come.

The result shows one row per client version with the number of computers. The newest version is at the top.

SQL
-- 1 = count only computers with a client. 0 = also count discovered computers with no client.
DECLARE @ClientsOnly BIT = 1;

SELECT
    ISNULL(rs.Client_Version0, 'No client') AS ClientVersion,
    COUNT(*)                                AS Computers
FROM v_R_System rs
WHERE ISNULL(rs.Obsolete0, 0) = 0
  AND (@ClientsOnly = 0 OR rs.Client0 = 1)
GROUP BY rs.Client_Version0
ORDER BY rs.Client_Version0 DESC;

How to use it

  1. Open SQL Server Management Studio and connect to the site database.
  2. Paste the query into a new query window.
  3. Run the query.
  4. Set @ClientsOnly to 0 to also count computers that have no client.
  5. Compare the top version with the client version of your site.

Good to know

  • The query skips obsolete records.
  • The version comes from client discovery data, not from hardware inventory.
client version client upgrade v_R_System Client_Version0
✉

Get new articles in your inbox

SCCM guides, AI tools, automation tips — sent when published. No spam.