다음을 통해 공유


EnumProcesses Method

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The EnumProcesses method returns a QueryResults object that enumerates the Microsoft SQL Server processes running on a referenced instance of Microsoft SQL Server.

구문

object
.EnumProcesses( [ WhoByNameOrID ] )as QueryResults

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • WhoByNameOrID
    String or small integer that identifies a login name or process ID.

Prototype (C/C++)

HRESULT EnumProcesses(
LPSQLDMOQUERYRESULTS* ppResults,
SQLDMO_LPCSTR szWho = NULL,
long lWho = -1);

Returns

A QueryResults object that contains one result set defined by these columns.

Column Data type Description

blocked

smallint

When nonnull, process ID blocking a request of the process ID listed by the row.

cmd

nchar(34)

Abbreviated indicator of current command. AWAITING COMMAND when no command is current.

cpu

integer

Cumulative CPU time for process.

dbname

nvarchar(129)

Database currently in use by process.

hostname

nchar(129)

If applicable, network name of the client workstation.

loginname

nvarchar(129)

Name of the SQL Server login.

memusage

integer

Number of pages in the procedure cache currently allocated to this process. A negative number indicates that the process is freeing memory allocated by another process.

program_name

nchar(129)

If applicable, name of the client application.

spid

smallint

SQL Server process ID.

status

nchar(31)

Execution state, such as running or sleeping.

ecid

smallint

Execution context ID used to uniquely identify the subthreads operating on behalf of a single process. If the computer is running an instance of SQL Server 7.0 or earlier, a value of zero is returned.

주의

If an application calls EnumProcesses on an instance of SQL Server version 7.0, the ecid column returns zero.

Applies To:

SQLServer Object