Export (0) Print
Expand All

Job.DeleteJobStepLogs Method (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)

public void DeleteJobStepLogs(
	int largerThan
)

Parameters

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

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)

Community Additions

ADD
Show:
© 2014 Microsoft