Compartilhar via


Classe Settings

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

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

Sintaxe

'Declaração
<SfcElementTypeAttribute("Setting")> _
Public NotInheritable Class Settings _
    Inherits SqlSmoObject _
    Implements IAlterable, IScriptable
'Uso
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

Comentários

Esse recurso será removido em uma versão futura do Microsoft SQL Server. Evite usar esse recurso em desenvolvimentos novos e planeje modificar os aplicativos que atualmente o utilizam.

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

Qualquer membro público estático (Compartilhado no Microsoft Visual Basic) desse tipo é seguro para operações multi-threaded. Não há garantia de que qualquer membro de instância seja seguro para threads.

Exemplos

'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()

Hierarquia de herança

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

Segurança de thread

Quaisquer membros static (Shared no Visual Basic) públicos deste tipo são thread-safe. Não há garantia de que qualquer membro de instância seja thread-safe.