Freigeben über


Job.Create-Methode

Creates a job on the instance of Microsoft SQL Server as defined by the Job object.

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

Syntax

'Declaration
Public Sub Create
'Usage
Dim instance As Job

instance.Create()
public void Create()
public:
virtual void Create() sealed
abstract Create : unit -> unit  
override Create : unit -> unit
public final function Create()

Implementiert

ICreatable.Create()

Beispiele

The following code example creates a new job.

C#

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

PowerShell

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

Siehe auch

Verweis

Job Klasse

Microsoft.SqlServer.Management.Smo.Agent-Namespace

Andere Ressourcen

Automatisierte Administrationstasks (SQL Server-Agent)

Planen von automatischen, administrativen Tasks im SQL Server-Agent

sp_add_job (Transact-SQL)