Freigeben über


Job.DeleteJobStepLogs-Methode (Int32)

Deletes job step log files that are larger that the specified log ID number.

Namespace:  Microsoft.SqlServer.Management.Smo.Agent
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

Syntax

'Declaration
Public Sub DeleteJobStepLogs ( _
    largerThan As Integer _
)
'Usage
Dim instance As Job 
Dim largerThan As Integer

instance.DeleteJobStepLogs(largerThan)
public void DeleteJobStepLogs(
    int largerThan
)
public:
void DeleteJobStepLogs(
    int largerThan
)
member DeleteJobStepLogs : 
        largerThan:int -> unit
public function DeleteJobStepLogs(
    largerThan : int
)

Parameter

  • largerThan
    Typ: System.Int32
    A Int32 value that specifies the log ID number, higher than which to delete the job step log files.

Beispiele

The following code example deletes all job step log files that have ID values larger than 5.

C#

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

PowerShell

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

Siehe auch

Verweis

Job Klasse

DeleteJobStepLogs-Überladung

Microsoft.SqlServer.Management.Smo.Agent-Namespace

Andere Ressourcen

Planen von automatischen, administrativen Tasks im SQL Server-Agent

Automatisierte Administrationstasks (SQL Server-Agent)

sp_delete_jobsteplog (Transact-SQL)