Job.Drop Method

Removes an existing job.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Drop() Removes an existing job.
Public method Drop(Boolean) Removes an existing job.
Top

The following code example creates a job, then drops it.

C#

Server srv = new Server("(local)");
Job jb = new Job(srv.JobServer, "Test Job");
jb.Create();
jb.Drop();

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$jb = new-object Microsoft.SqlServer.Management.Smo.Agent.Job($srv.JobServer, "EFSD Job")
$jb.Create()
$jb.Drop()

Community Additions

ADD
Show: