共用方式為


Create 方法

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

命名空間:  Microsoft.SqlServer.Management.Smo.Agent
組件:  Microsoft.SqlServer.Smo (在 Microsoft.SqlServer.Smo.dll 中)

語法

'宣告
Public Sub Create
'用途
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()

實作

ICreatable. . :: . .Create() () () ()

範例

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()