Partager via


Propriété Job.HasStep

Gets the Boolean property value that specifies whether the job has at least one job step.

Espace de noms :  Microsoft.SqlServer.Management.Smo.Agent
Assembly :  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Expensive Or SfcPropertyFlags.Standalone)> _
Public ReadOnly Property HasStep As Boolean 
    Get
'Utilisation
Dim instance As Job 
Dim value As Boolean 

value = instance.HasStep
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)]
public bool HasStep { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Expensive|SfcPropertyFlags::Standalone)]
public:
property bool HasStep {
    bool get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)>]
member HasStep : bool
function get HasStep () : boolean

Valeur de propriété

Type : System.Boolean
A Boolean value that specifies whether the job has at least one job step.If True, the job has at least one job step. If False, the job does not have any job steps.

Notes

Microsoft SQL Server Agent jobs must have at least one job step to be executable. Define and add JobStep objects to the JobSteps collection of a Job object to create job steps. This alters the value of the HasStep property.

Exemples

The following code example indicates whether the job has at least one job step.

C#

Server srv = new Server("(local)");
Job jb = new Job(srv.JobServer, "Test Job");
Console.WriteLine(jb.HasStep);

PowerShell

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

Voir aussi

Référence

Job Classe

Espace de noms Microsoft.SqlServer.Management.Smo.Agent

Autres ressources

Tâches d'administration automatisée (Agent SQL Server)

sp_add_job (Transact-SQL)

Planification des tâches administratives automatiques dans l'Agent SQL Server