다음을 통해 공유


KillProcess 메서드

지정한 프로세스를 중지합니다.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Sub KillProcess ( _
    processId As Integer _
)
‘사용 방법
Dim instance As Server
Dim processId As Integer

instance.KillProcess(processId)
public void KillProcess(
    int processId
)
public:
void KillProcess(
    int processId
)
member KillProcess : 
        processId:int -> unit 
public function KillProcess(
    processId : int
)

매개 변수

  • processId
    유형: System. . :: . .Int32
    프로세스를 고유하게 식별하는 시스템 ID 값을 지정하는 Int32입니다.

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Stop all processes running on the AdventureWorks2008R2 database.
srv.KillAllProcesses("AdventureWorks2008R2")
'Stop the AventureWorks database.
srv.KillDatabase("AdventureWorks2008R2")
'Stop the specified process with ID 52.
srv.KillProcess(52)

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$srv.KillAllProcesses("AdventureWorks2008R2")
$srv.KillDatabase("AdventureWorks2008R2")
$srv.KillProcess(52)