SP_WHO2 showing Task Manager for SPID greater than 50 on SQL Server 2019

Anonymous
2022-03-21T02:43:20.587+00:00

Dear All,

I am using the sp_who2 procedure and it is giving results for Task Manager with SPID greater than 50. This is on one of the latest SQL server 2019 CU 15.0.4198.2.

Task Manager is generally seen on the background processes but have never seen spid with Task Manager greater than 50 185005-sp-who2-1.jpg.
The dbcc inputbuffer for the processes yields no event.,ref184908-sp-who2-2.jpg.

The dmv sys.dm_Exec_Sessions confirms that this is not a user process , the query SELECT * FROM sys.dm_exec_session WHERE is_user_process = 0; refer attached image sp_who2-3184976-sp-who2-3.jpg.

The replication has been configured on this server with Primary/distributor/subscriber each on different server.

Thank you for your responses.

Kind Regards

SQL Server | Other
0 comments No comments
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,586 Reputation points
    2022-03-21T07:01:26.597+00:00

    Hi @Anonymous ,

    Welcome to Microsoft Q&A!
    Normally, SPID 1 to 50 is reserved for SQL Server internal processes, and the user process starts from SPID 51.
    When you have some other tasks in your environment, you will see more Task Manager. Meanwhile, from your results this is not blocked and you can not pay attention to it. Here is another thing you can see that these Task Manager are in master database, which indicates that they are system processes.
    There is a script which can show the user's process:

    SELECT * FROM sys.dm_exec_sessions;  
            --By default, it shows all processes in SQL Server. We might not be interested in the system processes. We can filter the results using the following query.  
    SELECT * FROM sys.dm_exec_sessions WHERE is_user_process = 1;  
    

    If you change the value of is_user_process to 0, you will get the system process.

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


3 additional answers

Sort by: Most helpful
  1. Olaf Helper 47,441 Reputation points
    2022-03-21T07:10:36.317+00:00

    it is giving results for Task Manager with SPID greater than 50.

    And what's the problem with it?
    Yes, system processes ca have ID's greater then 50 (even because 50 is very small range), for example internal Service Broker processes.

    0 comments No comments

  2. tibor_karaszi@hotmail.com 4,316 Reputation points
    2022-03-21T10:41:47.39+00:00

    Adding to Olaf's post: It was a long long time ago when system processes were limited to < 50. I.e., there is nothing strange about system processes going over 50, at least since SQL Server 2005 (possibly even going back to 7.0, which was released 1998).

    0 comments No comments

  3. Tom Phillips 17,771 Reputation points
    2022-03-21T12:43:33.84+00:00

    Just to add to the other comments.

    SPID =<50 are ALWAYS system processes. However, system processes can still exist in SPIDs >50.

    Using the "is_user_process" is a better method to determine non-system processes.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.