Remarque
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de vous connecter ou de modifier des répertoires.
L’accès à cette page nécessite une autorisation. Vous pouvez essayer de modifier des répertoires.
Gets information about the job step that is currently running.
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 CurrentRunStep As String
Get
'Utilisation
Dim instance As Job
Dim value As String
value = instance.CurrentRunStep
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)]
public string CurrentRunStep { get; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Expensive|SfcPropertyFlags::Standalone)]
public:
property String^ CurrentRunStep {
String^ get ();
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Expensive|SfcPropertyFlags.Standalone)>]
member CurrentRunStep : string
function get CurrentRunStep () : String
Valeur de propriété
Type : System.String
A String value that specifies the job step that is currently running.
Notes
For executing jobs, the property reports the job step by number, and the name of the job step as a string, for example: 2 (Run Replication Agent.).
Exemples
The following code example creates a new job and displays its current step.
C#
Server srv = new Server("(local)");
Job jb = new Job(srv.JobServer, "Test Job");
jb.Create();
Console.WriteLine(jb.CurrentRunStep);
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()
Write-Host $jb.CurrentRunStep
Voir aussi
Référence
Espace de noms Microsoft.SqlServer.Management.Smo.Agent
Autres ressources
Tâches d'administration automatisée (Agent SQL Server)
Planification des tâches administratives automatiques dans l'Agent SQL Server