EnumProcesses List

SQLServer Object

Description

Lists the processes connected to SQL Server. List is returned in a QueryResults object.

Visual Basic

QueryResults = SQLServer.EnumProcesses ( [[WhoByNameOrID :=]
{idLogin | lProcess}] )

C++

HRESULT pSQLServer->EnumProcesses (
LPSQLOLEQUERYRESULTS*
ppQueryResults,
SQLOLE_LPCSTR
idLogin = NULL,
long
lProcess = -1 );

Elements

Element Type Description

QueryResults QueryResults Returned QueryResults object
idLogin Identifier Login
lProcess Long Process

QueryResults

ColumnName ColumnType

spid SQLOLE_DTypeInt2
status SQLOLE_DTypeChar
loginname SQLOLE_DTypeChar
hostname SQLOLE_DTypeChar
program_name SQLOLE_DTypeChar
cmd SQLOLE_DTypeChar
dbname SQLOLE_DTypeChar
cpu SQLOLE_DTypeInt4
memusage SQLOLE_DTypeInt4
blocked SQLOLE_DTypeInt2

Reference

sp_who