Puedes utilizar la variable de sistema @@rowcount inmediatamente despues de hacer el select...
Código sql:
Ver originalDECLARE @TotalRows INT
SELECT A.DATETIME ,A.IDCLIENT,B.DESCRIPTION,
SUM(CASE WHEN A.IDVAR = 'WhD' THEN A.READVAL ELSE 0 END)
AS CANAL1,
SUM(CASE WHEN A.IDVAR = 'WhR' THEN A.READVAL ELSE 0 END)
AS CANAL2,
SUM(CASE WHEN A.IDVAR = 'F' THEN A.READVAL ELSE 0 END)
AS CANAL3,
SUM(CASE WHEN A.IDVAR = 'VarhD' THEN A.READVAL ELSE 0 END)
AS CANAL4,
SUM(CASE WHEN A.IDVAR = 'VArhR' THEN A.READVAL ELSE 0 END)
AS CANAL5,
SUM(CASE WHEN A.IDVAR = 'FP' THEN A.READVAL ELSE 0 END)
AS CANAL6
FROM READMASS A, TOPOLOGY B
WHERE A.DATETIME >= '2009-01-01 00:00.000' AND B.INSTYPE='Actaris SL7000' AND A.NOINS = B.NOINS AND B.DESCRIPTION LIKE '%TOTA%'
GROUP BY A.DATETIME,A.IDCLIENT,B.DESCRIPTION
ORDER BY A.IDCLIENT,A.DATETIME
SET @TotalRows = @@rowcount
SELECT @TotalRows
Saludos!