다음을 통해 공유


Job.PurgeHistory 메서드

Removes system records maintaining execution history for the referenced job.

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

구문

‘선언
Public Sub PurgeHistory
‘사용 방법
Dim instance As Job

instance.PurgeHistory()
public void PurgeHistory()
public:
void PurgeHistory()
member PurgeHistory : unit -> unit
public function PurgeHistory()

The following code example deletes the execution history records of the "Test Job" job.

C#

Server srv = new Server("(local)");
Job jb = srv.JobServer.Jobs["Test Job"];
jb.PurgeHistory();

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = $srv.JobServer.Jobs["Test Job"]
$jb.PurgeHistory()

참고 항목

참조

Job 클래스

Microsoft.SqlServer.Management.Smo.Agent 네임스페이스

관련 자료

SQL Server 에이전트에서 자동 관리 태스크 예약

관리 태스크 자동화(SQL Server 에이전트)

sp_purge_jobhistory(Transact-SQL)