JobServer.EnumJobs JobServer.EnumJobs JobServer.EnumJobs Method

Definition

Enumerates a list of information about the current job.

Overloads

EnumJobs() EnumJobs() EnumJobs()

Enumerates a list of information about the current job.

EnumJobs(JobFilter) EnumJobs(JobFilter) EnumJobs(JobFilter)

Enumerates a list of information about current jobs.

EnumJobs() EnumJobs() EnumJobs()

Enumerates a list of information about the current job.

public:
 System::Data::DataTable ^ EnumJobs();
public System.Data.DataTable EnumJobs ();
Public Function EnumJobs () As DataTable
Returns

A DataTable object value that contains a table of information about SQL Server Agent jobs. The table describes the different columns of the returned DataTable.

Column
Data type
Description
UrnString A URN value that uniquely identifies the job.
NameString The name of the job.
JobIDGuid A unique system-generated ID value.
DateCreatedDateTime The date and time when the job was created.
DateLastModifiedDateTime The date and time when the job was last modified.
DescriptionString The textual description of the job.
EmailLevelInt32 The numeric value that specifies the required way in which the job completes for an e-mail to be sent after execution that is listed in the CompletionAction enumeration.
IsEnabledBoolean The Boolean value that specifies whether the job is enabled.
If True, the job is enabled.
If False, the job is not enabled.
EventLogLevelInt32 The numeric value that specifies the required way in which the job completes for an event to be logged after execution that is listed in the CompletionAction enumeration.
NetSendLevelInt32 The numeric value that specifies the required way in which the job completes for a net send network message to be sent after execution that is listed in the CompletionAction enumeration.
OriginatingServerString The name of the instance of SQL Server that is the master server in a multiserver administration scenario.
OwnerLoginNameString The name of the login that owns the job.
PageLevelInt32 The numeric value that specifies the required way in which the job completes for a pager message to be sent after execution that is listed in the CompletionAction enumeration.
StartStepIDInt32 The ID value of the job step that is first in the sequence of job steps that belong to the job.
VersionNumberInt32 The version number of the job.
CategoryIDInt32 The job category ID number.

Examples

Scheduling Automatic Administrative Tasks in SQL Server Agent

EnumJobs(JobFilter) EnumJobs(JobFilter) EnumJobs(JobFilter)

Enumerates a list of information about current jobs.

public:
 System::Data::DataTable ^ EnumJobs(Microsoft::SqlServer::Management::Smo::Agent::JobFilter ^ filter);
public System.Data.DataTable EnumJobs (Microsoft.SqlServer.Management.Smo.Agent.JobFilter filter);
Public Function EnumJobs (filter As JobFilter) As DataTable
Parameters
filter
JobFilter JobFilter JobFilter

A JobFilter object value that is used to specify constraints to restrict output.

Returns

A DataTable object value that contains a table of information about SQL Server Agent jobs. The table describes the different columns of the returned DataTable.

Column
Data type
Description
UrnString A URN value that uniquely identifies the job.
NameString The name of the job.
JobIDGuid A unique system-generated ID value.
CategoryString The name of the category to which the job is assigned.
CurrentRunRetryAttemptInt32 The number of attempts, including the current attempt, that the job has been run and retried.
CurrentRunStatusInt32 The numeric value that represents a specific execution status that is listed in the JobExecutionStatus enumeration.
CurrentRunStepInt32 The numeric value that identifies the currently running job step.
DateCreatedDateTime The date and time when the job was created.
DateLastModifiedDateTime The date and time when the job was last modified.
DeleteLevelInt32 The numeric value that specifies the required way in which the job completes for the job to be deleted after execution that is listed in the CompletionAction enumeration.
DescriptionString The textual description of the job.
EmailLevelInt32 The numeric value that specifies the required way in which the job completes for an e-mail to be sent after execution that is listed in the CompletionAction enumeration.
IsEnabledBoolean The Boolean value that specifies whether the job is enabled.
If True, the job is enabled.
If False, the job is not enabled.
EventLogLevelInt32 The numeric value that specifies the required way in which the job completes for an event to be logged after execution that is listed in the CompletionAction enumeration.
HasScheduleBoolean The Boolean value that specifies whether the job has at least one schedule assigned to it.
If True, the job has at least one schedule.
If False, the job has no schedules.
HasServerBoolean The Boolean value that specifies whether the job is scheduled to run on a target server in a multiserver administration scenario.
If True, the job has at least one target server.
If False, the job does not have a target server.
HasStepBoolean The Boolean value that specifies whether the job has at least one job step assigned to it.
If True, the job has at least one job step.
If False, the job does not have a job step.
LastRunDateDateTime The date and time when the job was last executed.
LastRunOutcomeInt32 The numeric value that specifies the way in which the job completed the last time it was executed that is listed in the CompletionAction enumeration.
NetSendLevelInt32 The numeric value that specifies the required way in which the job completes for a net send network message to be sent after execution that is listed in the CompletionAction enumeration.
NextRunDateDateTime The date and time when the job is next scheduled to run.
NextRunScheduleIDInt32 The numeric ID value that uniquely identifies the schedule to be used the next time the job runs.
OperatorToEmailString The name of the operator to e-mail when the job requires that e-mail is sent on completion.
OperatorToNetSendString The name of the operator to net send when the job requires that e-mail is sent on completion.
OperatorToPageString The name of the operator to page when the job requires that e-mail is sent on completion.
OriginatingServerString The name of the instance of SQL Server that is the master server in a multiserver administration scenario.
OwnerLoginNameString The name of the login that owns the job.
PageLevelInt32 The numeric value that specifies the required way in which the job completes for a pager message to be sent after execution that is listed in the CompletionAction enumeration.
StartStepIDInt32 The ID value of the job step that is first in the sequence of job steps that belong to the job.
JobTypeInt32 The numeric value that specifies the type of job that is listed in the JobType enumeration.
VersionNumberInt32 The version number of the job.

Examples

Scheduling Automatic Administrative Tasks in SQL Server Agent

Applies to