Share via


JobServer.SqlAgentRestart Property

Gets or sets the Boolean property value that specifies whether SQL Server Agent is monitored and restarted if it stops.

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

Syntax

'Declaration
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.Standalone Or SfcPropertyFlags.SqlAzureDatabase)> _
Public Property SqlAgentRestart As Boolean 
    Get 
    Set
'Usage
Dim instance As JobServer 
Dim value As Boolean 

value = instance.SqlAgentRestart

instance.SqlAgentRestart = value
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)]
public bool SqlAgentRestart { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::Standalone|SfcPropertyFlags::SqlAzureDatabase)]
public:
property bool SqlAgentRestart {
    bool get ();
    void set (bool value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.Standalone|SfcPropertyFlags.SqlAzureDatabase)>]
member SqlAgentRestart : bool with get, set
function get SqlAgentRestart () : boolean 
function set SqlAgentRestart (value : boolean)

Property Value

Type: System.Boolean
A Boolean value that specifies whether SQL Server Agent is monitored and restarted if it stops.If True, SQL Server Agent is restarted.If False (default), SQL Server Agent is not restarted.

Examples

Scheduling Automatic Administrative Tasks in SQL Server Agent

See Also

Reference

JobServer Class

Microsoft.SqlServer.Management.Smo.Agent Namespace

Other Resources

Automated Administration Tasks (SQL Server Agent)

SQL Server Agent Stored Procedures (Transact-SQL)