count the number of records in the below dataset.
SELECT session_id,COUNT(*) FROM (
select DISTINCT session_id, scheduler_id
from sys.dm_os_tasks
where parent_task_address IS NOT NULL
AND session_id IS NOT NULL) a
GROUP BY session_id
count the number of records in the below dataset.
SELECT session_id,COUNT(*) FROM (
select DISTINCT session_id, scheduler_id
from sys.dm_os_tasks
where parent_task_address IS NOT NULL
AND session_id IS NOT NULL) a
GROUP BY session_id