Compartilhar via


Propriedade do RDL Job.CurrentRunStep

Gets information about the job step that is currently running.

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

Sintaxe

'Declaração
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Expensive Or SfcPropertyFlags.Standalone)> _
Public ReadOnly Property CurrentRunStep As String 
    Get
'Uso
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

Valor da propriedade

Tipo: System.String
A String value that specifies the job step that is currently running.

Comentários

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

Exemplos

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

Consulte também

Referência

Job Classe

Namespace Microsoft.SqlServer.Management.Smo.Agent

Outros recursos

Tarefas de administração automatizadas (SQL Server Agent)

sp_add_job (Transact-SQL)

Agendando tarefas administrativas automáticas no SQL Server Agent