Settings-Klasse

The Settings object represents a group of configurable settings on the instance of SQL Server.

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

Syntax

'Declaration
<SfcElementTypeAttribute("Setting")> _
Public NotInheritable Class Settings _
    Inherits SqlSmoObject _
    Implements IAlterable, IScriptable
'Usage
Dim instance As Settings
[SfcElementTypeAttribute("Setting")]
public sealed class Settings : SqlSmoObject, 
    IAlterable, IScriptable
[SfcElementTypeAttribute(L"Setting")]
public ref class Settings sealed : public SqlSmoObject, 
    IAlterable, IScriptable
[<SealedAttribute>]
[<SfcElementTypeAttribute("Setting")>]
type Settings =  
    class
        inherit SqlSmoObject
        interface IAlterable
        interface IScriptable
    end
public final class Settings extends SqlSmoObject implements IAlterable, IScriptable

Hinweise

Diese Funktion wird in zukünftigen Versionen von Microsoft SQL Server nicht mehr bereitgestellt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

To get Settings object properties, users can be a member of the public fixed server role.

To set Settings object properties, users must be a member of the sysadmin fixed server role.

Thread Safety

Alle öffentlichen, statischen Elemente dieses Typs (Shared in Microsoft Visual Basic) sind für Vorgänge mit mehreren Threads sicher. Für Instanzelemente kann nicht sichergestellt werden, dass sie für Threads sicher sind.

Beispiele

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display information about the instance of SQL Server in Information and Settings.
Console.WriteLine("OS Version = " & srv.Information.OSVersion)
Console.WriteLine("State = " & srv.Settings.State.ToString)
'Display information specific to the current user in UserOptions.
Console.WriteLine("Quoted Identifier support = " & srv.UserOptions.QuotedIdentifier)
'Modify server settings in Settings.

srv.Settings.LoginMode = ServerLoginMode.Integrated
'Modify settings specific to the current connection in UserOptions.
srv.UserOptions.AbortOnArithmeticErrors = True
'Run the Alter method to make the changes on the instance of SQL Server.
srv.Alter()

Vererbungshierarchie

System. . :: . .Object
  Microsoft.SqlServer.Management.Smo. . :: . .SmoObjectBase
    Microsoft.SqlServer.Management.Smo. . :: . .SqlSmoObject
      Microsoft.SqlServer.Management.Smo..::..Settings

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.