Partager via


Server.JobServer Property

Gets the SQL Server Agent associated with the instance of Microsoft SQL Server.

Espace de noms: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Syntaxe

'Déclaration
Public ReadOnly Property JobServer As JobServer
public JobServer JobServer { get; }
public:
property JobServer^ JobServer {
    JobServer^ get ();
}
/** @property */
public JobServer get_JobServer ()
public function get JobServer () : JobServer

Valeur de propriété

A JobServer object that specifies the SQL Server Agent associated with the instance of SQL Server.

Notes

Texte mis à jour :

The JobServer object represents the SQL Server Agent. You can use the JobServer object to reference the SQL Server Agent jobs, operators, and alerts. SQL Server Agent settings can be viewed or modified by using the JobServer object.

Cet espace de noms, cette classe ou ce membre est pris en charge uniquement par la version 2.0 de Microsoft .NET Framework.

Exemple

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Define an Alert object variable by supplying the SQL Agent and the name arguments in the constructor.
Dim al As Alert
al = New Alert(srv.JobServer, "Test_Alert")
'Specify the performance condition string to define the alert.
al.PerformanceCondition = "SQLServer:General Statistics|User Connections||>|3"
'Create the alert on the SQL Agent.
al.Create()
'Define an Operator object variable by supplying the SQL Agent and the name arguments in the constructor.
Dim op As [Operator]
op = New [Operator](srv.JobServer, "Test_Operator")
'Set the net send address.
op.NetSendAddress = "NetworkPC"
'Create the operator on the SQL Agent.
op.Create()
'Run the AddNotification method to specify the operator is notified when the alert is raised.
al.AddNotification("Test_Operator", NotifyMethods.NetSend)

Sécurité des threads

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Plateformes

Plateformes de développement

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Plateformes cibles

Pour obtenir la liste des plateformes prises en charge, consultez Configuration matérielle et logicielle requise pour l'installation de SQL Server 2005.

Voir aussi

Référence

Server Class
Server Members
Microsoft.SqlServer.Management.Smo Namespace

Autres ressources

How to: Create a Job with Steps and a Schedule in Visual Basic .NET
Scheduling Automatic Administrative Tasks in SQL Server Agent
Setting Properties
Gestion des serveurs