Server.EnumProcesses Server.EnumProcesses Server.EnumProcesses Method

정의

SQL Server의 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server.

오버로드

EnumProcesses() EnumProcesses() EnumProcesses()

SQL Server의 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server.

EnumProcesses(Boolean) EnumProcesses(Boolean) EnumProcesses(Boolean)

시스템 프로세스를 제외 하는 옵션으로 SQL Server 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server with the option to exclude system processes.

EnumProcesses(Int32) EnumProcesses(Int32) EnumProcesses(Int32)

지정한 프로세스에 대한 정보 목록을 열거합니다. Enumerates a list of information about the specified process.

EnumProcesses(String) EnumProcesses(String) EnumProcesses(String)

지정 된 로그인과 연결 된 SQL Server의 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server that are associated with the specified login.

EnumProcesses() EnumProcesses() EnumProcesses()

SQL Server의 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server.

public:
 System::Data::DataTable ^ EnumProcesses();
public System.Data.DataTable EnumProcesses ();
Public Function EnumProcesses () As DataTable
반환

A DataTable 개체 SQL Server의 인스턴스에서 실행 중인 프로세스의 목록을 포함 하는 값입니다. A DataTable object value that contains a list of processes running on the instance of SQL Server. 반환 된 다른 열을 설명 하는 테이블 DataTable합니다. The table describes the different columns of the returned DataTable.

데이터 형식 설명
* * Urn * * String 프로세스를 나타내는 the URN 문자열입니다. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. 참조는 cpu_time [sys.dm_exec_sessions (TRANSACT-SQL)]의 열 (http://msdn.microsoft.com/library/2b7e8e0c-eea0-431e-819f-8ccd12ec8cfa)합니다.
* * MemUsage * * Int32 에 현재 할당 된 프로시저 캐시의 페이지 수는 프로세스입니다. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.
Column Data type Description
Urn String The URN string that represents the process. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. See the cpu_time column in sys.dm_exec_sessions (Transact-SQL).
MemUsage Int32 The number of pages in the procedure cache that are currently allocated to the process. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.

예제

C#C#

Server srv = new Server("(local)");  

DataTable d = srv.EnumProcesses();  
foreach (DataRow r in d.Rows)  
{  
   Console.WriteLine("============================================");  
   foreach(DataColumn c in d.Columns)  
   {  
      Console.WriteLine(c.ColumnName + " = " + r[c].ToString());  
   }  
}  

PowerShellPowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  

$d = $srv.EnumProcesses()  
foreach ($r in $d.Rows)  
{  
   Write-Host "============================================"  
   Foreach ($c in $d.Columns)  
   {  
      Write-Host $c.ColumnName "=" $r[$c]  
   }  
}  

설명

이 메서드를 사용하여 SQL Server 인스턴스에서 현재 실행 중인 프로세스를 열거할 수 있습니다.Use this method to enumerate the processes that are currently running on the instance of SQL Server.

EnumProcesses(Boolean) EnumProcesses(Boolean) EnumProcesses(Boolean)

시스템 프로세스를 제외 하는 옵션으로 SQL Server 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server with the option to exclude system processes.

public:
 System::Data::DataTable ^ EnumProcesses(bool excludeSystemProcesses);
public System.Data.DataTable EnumProcesses (bool excludeSystemProcesses);
Public Function EnumProcesses (excludeSystemProcesses As Boolean) As DataTable
매개 변수
excludeSystemProcesses
Boolean Boolean Boolean

결과에 시스템 프로세스를 포함할지 여부를 지정하는 Boolean 값입니다. A Boolean value that specifies whether to include system processes in the results. 경우 True, 시스템 프로세스가 제외 됩니다. If True, system processes are excluded. 경우 False, 시스템 프로세스가 포함 됩니다. If False, system processes are included.

반환

A DataTable 개체 SQL Server의 인스턴스에서 실행 중인 프로세스의 목록을 포함 하는 값입니다. A DataTable object value that contains a list of processes running on the instance of SQL Server. 반환 된 다른 열을 설명 하는 테이블 DataTable합니다. The table describes the different columns of the returned DataTable.

데이터 형식 설명
* * Urn * * String 프로세스를 나타내는 the URN 문자열입니다. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. 참조는 cpu_time [sys.dm_exec_sessions (TRANSACT-SQL)]의 열 (http://msdn.microsoft.com/library/2b7e8e0c-eea0-431e-819f-8ccd12ec8cfa)합니다.
* * MemUsage * * Int32 에 현재 할당 된 프로시저 캐시의 페이지 수는 프로세스입니다. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.
Column Data type Description
Urn String The URN string that represents the process. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. See the cpu_time column in sys.dm_exec_sessions (Transact-SQL).
MemUsage Int32 The number of pages in the procedure cache that are currently allocated to the process. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.

예제

C#C#

Server srv = new Server("(local)");  

DataTable d = srv.EnumProcesses(false);  
foreach (DataRow r in d.Rows)  
{  
   Console.WriteLine("============================================");  
   foreach(DataColumn c in d.Columns)  
   {  
      Console.WriteLine(c.ColumnName + " = " + r[c].ToString());  
   }  
}  

PowerShellPowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  

$d = $srv.EnumProcesses($FALSE)  
foreach ($r in $d.Rows)  
{  
   Write-Host "============================================"  
   Foreach ($c in $d.Columns)  
   {  
      Write-Host $c.ColumnName "=" $r[$c]  
   }  
}  

EnumProcesses(Int32) EnumProcesses(Int32) EnumProcesses(Int32)

지정한 프로세스에 대한 정보 목록을 열거합니다. Enumerates a list of information about the specified process.

public:
 System::Data::DataTable ^ EnumProcesses(int processId);
public System.Data.DataTable EnumProcesses (int processId);
Public Function EnumProcesses (processId As Integer) As DataTable
매개 변수
processId
Int32 Int32 Int32

프로세스를 고유하게 식별하는 ID 값을 지정하는 Int32 값입니다. An Int32 value that specifies the ID value that uniquely identifies the process.

반환

A DataTable 개체 SQL Server의 인스턴스에서 실행 중인 프로세스의 목록을 포함 하는 값입니다. A DataTable object value that contains a list of processes running on the instance of SQL Server. 반환 된 다른 열을 설명 하는 테이블 DataTable합니다. The table describes the different columns of the returned DataTable.

데이터 형식 설명
* * Urn * * String 프로세스를 나타내는 the URN 문자열입니다. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process, such as. running or sleeping.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. 참조는 cpu_time [sys.dm_exec_sessions (TRANSACT-SQL)]의 열 (http://msdn.microsoft.com/library/2b7e8e0c-eea0-431e-819f-8ccd12ec8cfa)합니다.
* * MemUsage * * Int32 에 현재 할당 된 프로시저 캐시의 페이지 수는 프로세스입니다. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.
Column Data type Description
Urn String The URN string that represents the process. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process, such as. running or sleeping.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. See the cpu_time column in sys.dm_exec_sessions (Transact-SQL).
MemUsage Int32 The number of pages in the procedure cache that are currently allocated to the process. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.

예제

C#C#

Server srv = new Server("(local)");  

DataTable d = srv.EnumProcesses(1);  
foreach (DataRow r in d.Rows)  
{  
   Console.WriteLine("============================================");  
   foreach(DataColumn c in d.Columns)  
   {  
      Console.WriteLine(c.ColumnName + " = " + r[c].ToString());  
   }  
}  

PowerShellPowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  

$d = $srv.EnumProcesses(1)  
foreach ($r in $d.Rows)  
{  
   Write-Host "============================================"  
   Foreach ($c in $d.Columns)  
   {  
      Write-Host $c.ColumnName "=" $r[$c]  
   }  
}  

설명

이 메서드를 사용하여 SQL Server 인스턴스에서 현재 실행 중인 프로세스를 열거할 수 있습니다.Use this method to enumerate the processes that are currently running on the instance of SQL Server.

EnumProcesses(String) EnumProcesses(String) EnumProcesses(String)

지정 된 로그인과 연결 된 SQL Server의 인스턴스에서 실행 중인 프로세스 목록을 열거 합니다. Enumerates a list of processes running on the instance of SQL Server that are associated with the specified login.

public:
 System::Data::DataTable ^ EnumProcesses(System::String ^ loginName);
public System.Data.DataTable EnumProcesses (string loginName);
Public Function EnumProcesses (loginName As String) As DataTable
매개 변수
loginName
String String String

A String SQL Server의 인스턴스에서 실행 중인 프로세스와 연결 된 로그인을 지정 하는 값입니다. A String value that specifies the login associated with the processes running on the instance of SQL Server.

반환

A DataTable 개체 SQL Server의 인스턴스에서 실행 중인 프로세스의 목록을 포함 하는 값입니다. A DataTable object value that contains a list of processes running on the instance of SQL Server. 반환 된 다른 열을 설명 하는 테이블 DataTable합니다. The table describes the different columns of the returned DataTable.

데이터 형식 설명
* * Urn * * String 프로세스를 나타내는 the URN 문자열입니다. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. 참조는 cpu_time [sys.dm_exec_sessions (TRANSACT-SQL)]의 열 (http://msdn.microsoft.com/library/2b7e8e0c-eea0-431e-819f-8ccd12ec8cfa)합니다.
* * MemUsage * * Int32 에 현재 할당 된 프로시저 캐시의 페이지 수는 프로세스입니다. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.
Column Data type Description
Urn String The URN string that represents the process. "Server[@Name='PCNAME']/Process[@Spid='51']", for example.
Name String The name of the process.
Spid Int32 The SQL Server session ID that uniquely identifies the process, see the session_id column in sys.dm_exec_sessions (Transact-SQL).
Login String The login running the process.
Host String The name of the computer on which the process is running.
Status String The status of the process. Running and sleeping, for example.
Command String The command currently being executed.
Database String The database is which the process is running.
Cpu Int32 The cumulative time taken by the process in milliseconds. See the cpu_time column in sys.dm_exec_sessions (Transact-SQL).
MemUsage Int32 The number of pages in the procedure cache that are currently allocated to the process. A negative number indicates that the process is freeing up memory allocated by another process.
BlockingSpid Int16 The SQL Server procedure ID of the procedure that is blocking the referenced procedure..
IsSystem Boolean The value that specifies whether the process is a system process or not.
Program String The name of the program the process
ExecutionContextID Int16 The ID value that uniquely identifies the execution context under which the process is running.

예제

C#C#

Server srv = new Server("(local)");  

DataTable d = srv.EnumProcesses("sa");  
foreach (DataRow r in d.Rows)  
{  
   Console.WriteLine("============================================");  
   foreach(DataColumn c in d.Columns)  
   {  
      Console.WriteLine(c.ColumnName + " = " + r[c].ToString());  
   }  
}  

PowerShellPowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")  

$d = $srv.EnumProcesses("sa")  
foreach ($r in $d.Rows)  
{  
   Write-Host "============================================"  
   Foreach ($c in $d.Columns)  
   {  
      Write-Host $c.ColumnName "=" $r[$c]  
   }  
}  

설명

이 메서드를 사용하여 SQL Server 인스턴스에서 현재 실행 중인 프로세스를 열거할 수 있습니다.Use this method to enumerate the processes that are currently running on the instance of SQL Server.

적용 대상