sysprocesses

  • hi guys, is there a difference between checking for top running processes for a specific db.

    select top 10 * from sys.sysprocesses

    where

    status <> 'background'

    AND cmd NOT IN ('signal handler','lock monitor','log writer','lazy writer','checkpoint sleep','awaiting command',

    'TASK MANAGER')

    and spid > 50

    and spid <> @@spid

    order by CPU desc

    vs

    select top 10 * from master.dbo.sysprocesses

    where

    status <> 'background'

    AND cmd NOT IN ('signal handler','lock monitor','log writer','lazy writer','checkpoint sleep','awaiting command',

    'TASK MANAGER')

    and spid > 50

    and spid <> @@spid

    order by CPU desc

    in my second one i usually get more results.

  • what do you mean my top running :w00t:

    I think sp_lock give you valuable information and based on that you can investigate further

    😛

    ----------
    Ashish

  • In SQL 2005 both point to the same view as far as I know.

    the data actually exists in the invisible resource database.

    One thing to remember is the metadata visibility in SQL 2005.

    When you query sysprocesses as an unpriviliged user (without view server state)

    You'll only see processes you "own".

    Cheers!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply