Job Members
The Job class represents a Microsoft SQL Server Agent job.
The following tables list the members exposed by the Job type.
Public Constructors
Nombre | Description | |
---|---|---|
Job | Overloaded. Initializes a new instance of the Job class. |
Arriba
Protected Fields
Nombre | Description | |
---|---|---|
m_ExtendedProperties | (inherited from SqlSmoObject ) |
Arriba
Public Properties
(see also Protected Properties )
Nombre | Description | |
---|---|---|
Category | Gets or sets the category to which the job belongs. | |
CurrentRunRetryAttempt | Gets the number of times Microsoft SQL Server Agent has attempted to run the job unsuccessfully. | |
CurrentRunStatus | Gets the current execution status of the job. | |
CurrentRunStep | Gets information about the job step that is currently running. | |
DateCreated | Gets the date and time when the job was created. | |
DateLastModified | Gets the date and time when the job was last modified. | |
DeleteLevel | Gets or sets the completion action that determines whether to delete the job definition when the job finishes execution. | |
Description | Gets or sets the textual description of the job. | |
EmailLevel | Gets or sets the completion action that determines whether to send an e-mail notification to an operator when the job finishes execution. | |
EventLogLevel | Gets or sets the completion action that determines whether to generate an operating system event log entry when the job finishes execution. | |
HasSchedule | Gets the Boolean property value that specifies whether the job has at least one schedule. | |
HasServer | Gets the Boolean property value that specifies whether the job has a target server assigned for multiple-server operations. | |
HasStep | Gets the Boolean property value that specifies whether the job has at least one job step. | |
IsEnabled | Gets or sets the Boolean property value that specifies whether the job is enabled. | |
JobID | Gets or sets the job ID value. | |
JobSchedules | Gets a collection of JobSchedule objects that represent the schedules assigned to the job. | |
JobSteps | Gets a collection of JobStep objects that represent the job steps defined for the job. | |
JobType | Gets the job type, which specifies whether the job is local or multiserver. | |
LastRunDate | Gets the date and time when the job was last run. | |
LastRunOutcome | Gets the result of the job from the last time it completed execution. | |
Name | Gets the name of the referenced job. (inherited from NamedSmoObject) | |
NetSendLevel | Gets or sets the completion action that determines whether to net-send a notification to an operator when the job finishes execution. | |
NextRunDate | Gets the date and time when the job is next scheduled to run. | |
NextRunScheduleID | Gets the ID value of the schedule that is responsible for the next execution of the job. | |
OperatorToEmail | Gets or sets the operator that receives notification by e-mail when the job finishes execution. | |
OperatorToNetSend | Gets or sets the operator that receives a net-send notification when the job finishes execution. | |
OperatorToPage | Gets or sets the operator that receives a pager notification when the job finishes execution. | |
OriginatingServer | Gets the name of the server that is acting as the master server in a multiserver job. | |
OwnerLoginName | Gets or sets the owner of the job. | |
PageLevel | Gets or sets the completion action that determines whether to send a pager notification to an operator when the job finishes execution. | |
Parent | Gets or sets the JobServer object that is the parent of the Job object. | |
Properties | Gets a collection of Property objects that represent the object properties. (inherited from SqlSmoObject) | |
StartStepID | Gets or sets the ID value of the first job step in the sequence to be executed. | |
State | Gets the state of the referenced object. (inherited from SmoObjectBase) | |
Urn | Gets the Uniform Resource Name (URN) address value that uniquely identifies the object. (inherited from SqlSmoObject) | |
UserData | Gets or sets user-defined data associated with the referenced object. (inherited from SmoObjectBase) | |
VersionNumber | Gets a system-maintained value that is incremented every time the job is modified. |
Arriba
Protected Properties
Nombre | Description | |
---|---|---|
ExecuteForScalar | Gets or sets the Boolean property value that specifies whether the object is set to the execute for scalar option. (inherited from SqlSmoObject) | |
ObjectInSpace | Gets the Boolean property value that specifies whether the object exists in isolation or whether it is connected to the instance of Microsoft SQL Server directly or indirectly. (inherited from SqlSmoObject) | |
PresetProperties | Gets or sets the preset properties of the referenced object. (inherited from SqlSmoObject) | |
ScalarResult | Gets the scalar result for the referenced object. (inherited from SqlSmoObject) |
Arriba
Public Methods
(see also Protected Methods )
Nombre | Description | |
---|---|---|
AddSharedSchedule | Adds a shared schedule to the Microsoft SQL Server Agent job. | |
Alter | Updates any Job object property changes on an instance of Microsoft SQL Server. | |
ApplyToTargetServer | Adds a server to the list of target servers maintained for the referenced Microsoft SQL Server Agent job. | |
ApplyToTargetServerGroup | Adds one or more servers to the list of target servers maintained for the referenced Microsoft SQL Server Agent job. | |
Create | Creates a job on the instance of Microsoft SQL Server as defined by the Job object. | |
DeleteJobStepLogs | Overloaded. | |
Drop | Overloaded. Removes an existing job. | |
EnumAlerts | Enumerates a list of Agent alerts that cause automated execution of the referenced job. | |
EnumHistory | Overloaded. Enumerates a list of execution history items associated with the referenced job. | |
EnumJobStepLogs | Overloaded. Enumerates a list of job step log files. | |
EnumJobStepsByID | Returns an array of JobStep objects that belong to the referenced job and that are ordered by ID value. | |
EnumTargetServers | Enumerates a list of execution target servers that have been assigned to the referenced job. | |
Equals | Overloaded. (inherited from Object ) | |
GetHashCode | (inherited from Object ) | |
GetType | (inherited from Object ) | |
Initialize | Overloaded. Initializes the object and forces the properties be loaded. (inherited from SqlSmoObject) | |
Invoke | Runs the job. | |
PurgeHistory | Removes system records maintaining execution history for the referenced job. | |
ReferenceEquals | (inherited from Object ) | |
Refresh | Refreshes the object and retrieves properties when the object is next accessed. (inherited from SqlSmoObject) | |
RemoveAllJobSchedules | Overloaded. Removes all shared and unshared schedules from the job. | |
RemoveAllJobSteps | Removes all the job steps associated with the job. | |
RemoveFromTargetServer | Removes an execution target server from the list of target servers maintained for a job. | |
RemoveFromTargetServerGroup | Removes a group of execution target servers from the list of target servers maintained for a job. | |
RemoveSharedSchedule | Removes a shared schedule. | |
Rename | Renames the job. | |
Script | Overloaded. Generates a Transact-SQL script that can be used to re-create the Microsoft SQL Server Agent job. | |
Start | Overloaded. Runs the referenced job. | |
Stop | Stops executing the referenced job. | |
ToString | Returns a String that represents the referenced object. (inherited from SqlSmoObject) |
Arriba
Protected Methods
Nombre | Description | |
---|---|---|
AlterImpl | (inherited from SqlSmoObject ) | |
AlterImplFinish | (inherited from SqlSmoObject ) | |
AlterImplInit | (inherited from SqlSmoObject ) | |
AlterImplWorker | (inherited from SqlSmoObject ) | |
BindDefaultImpl | (inherited from SqlSmoObject ) | |
BindRuleImpl | (inherited from SqlSmoObject ) | |
CheckCollation | (inherited from SqlSmoObject ) | |
CheckObjectState | Overloaded. Validates the state of the referenced object. (inherited from SqlSmoObject) | |
CheckObjectStateImpl | (inherited from SqlSmoObject ) | |
CheckVersion80 | Checks the validity of the object on Microsoft SQL Server 2000. (inherited from SqlSmoObject) | |
CheckVersion80SP3 | Checks the validity of the object on Microsoft SQL Server 2000 SP3. (inherited from SqlSmoObject) | |
CheckVersion90 | Check the validity of the object on Microsoft SQL Server 2005. (inherited from SqlSmoObject) | |
CheckVersionBelow90 | (inherited from SqlSmoObject ) | |
CleanObject | (inherited from SqlSmoObject ) | |
CreateImpl | (inherited from SqlSmoObject ) | |
CreateImplFinish | (inherited from SqlSmoObject ) | |
CreateImplInit | (inherited from SqlSmoObject ) | |
DropImpl | (inherited from SqlSmoObject ) | |
DropImplWorker | (inherited from SqlSmoObject ) | |
Finalize | (inherited from Object ) | |
FormatSqlVariant | (inherited from SqlSmoObject ) | |
GenerateDataSpaceScript | (inherited from SqlSmoObject ) | |
GetBindDefaultScript | (inherited from SqlSmoObject ) | |
GetBindRuleScript | (inherited from SqlSmoObject ) | |
GetBoolParameter | Overloaded. (inherited from SqlSmoObject ) | |
GetDateTimeParameter | (inherited from SqlSmoObject ) | |
GetDateTimeParameterAsInt | (inherited from SqlSmoObject ) | |
GetDBName | Gets the database name that is associated with the object. (inherited from AgentObjectBase) | |
GetEnumParameter | (inherited from SqlSmoObject ) | |
GetFragOptionString | (inherited from SqlSmoObject ) | |
GetGuidParameter | (inherited from SqlSmoObject ) | |
GetParameter | Overloaded. (inherited from SqlSmoObject ) | |
GetPropValue | (inherited from SqlSmoObject ) | |
GetPropValueOptional | (inherited from SqlSmoObject ) | |
GetPropValueOptionalAllowNull | (inherited from SqlSmoObject ) | |
GetRealValue | (inherited from SqlSmoObject ) | |
GetScriptingOptionsForCreate | (inherited from SqlSmoObject ) | |
GetServerName | Gets the name of the instance of Microsoft SQL Server with which the object is associated. (inherited from SqlSmoObject) | |
GetSqlServerVersionName | Gets the version name of the instance of Microsoft SQL Server with which the object is associated. (inherited from SqlSmoObject) | |
GetStringParameter | Overloaded. (inherited from SqlSmoObject ) | |
GetTimeSpanParameterAsInt | (inherited from SqlSmoObject ) | |
GetUrnRecursive | Overloaded. (inherited from SqlSmoObject ) | |
ImplInitialize | (inherited from SqlSmoObject ) | |
IsCollectionDirty | (inherited from SqlSmoObject ) | |
IsObjectDirty | Verifies whether the object properties have been modified and the changes have not yet been persisted on the instance of Microsoft SQL Server. (inherited from SqlSmoObject) | |
IsObjectInitialized | Verifies whether the object has been initialized. (inherited from SqlSmoObject) | |
IsObjectInSpace | Verifies whether the object is isolated or connected to the instance of Microsoft SQL Server. (inherited from SqlSmoObject) | |
IsVersion80SP3 | (inherited from SqlSmoObject ) | |
MarkDropped | (inherited from SqlSmoObject ) | |
MarkForDropImpl | (inherited from SqlSmoObject ) | |
MemberwiseClone | (inherited from Object ) | |
PostAlter | (inherited from SqlSmoObject ) | |
PostCreate | (inherited from SqlSmoObject ) | |
PostDrop | (inherited from SqlSmoObject ) | |
RenameImpl | (inherited from NamedSmoObject ) | |
RenameImplWorker | (inherited from NamedSmoObject ) | |
ScriptAlter | (inherited from SqlSmoObject ) | |
ScriptChangeOwner | (inherited from NamedSmoObject ) | |
ScriptCreate | (inherited from SqlSmoObject ) | |
ScriptDdl | (inherited from SqlSmoObject ) | |
ScriptDrop | (inherited from SqlSmoObject ) | |
ScriptImpl | Overloaded. (inherited from SqlSmoObject ) | |
ScriptImplWorker | (inherited from SqlSmoObject ) | |
ScriptRename | (inherited from NamedSmoObject ) | |
SetParentImpl | (inherited from SqlSmoObject ) | |
Trace | (inherited from SqlSmoObject ) | |
UnbindDefaultImpl | (inherited from SqlSmoObject ) | |
UnbindRuleImpl | (inherited from SqlSmoObject ) | |
UpdateCollectionState2 | (inherited from SqlSmoObject ) |
Arriba
Vea también
Referencia
Job Class
Microsoft.SqlServer.Management.Smo.Agent Namespace
Otros recursos
Scheduling Automatic Administrative Tasks in SQL Server Agent
Automatizar las tareas administrativas (Agente SQL Server)
sp_add_job (Transact-SQL)