Поделиться через


Server.Configuration Property

Gets the configuration options for the instance of Microsoft SQL Server.

Пространство имен: Microsoft.SqlServer.Management.Smo
Сборка: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

Синтаксис

'Декларация
Public ReadOnly Property Configuration As Configuration
public Configuration Configuration { get; }
public:
property Configuration^ Configuration {
    Configuration^ get ();
}
/** @property */
public Configuration get_Configuration ()
public function get Configuration () : Configuration

Значение свойства

A Configuration object that specifies the configuration options for the instance of SQL Server.

Замечания

Изменения текста

The Configuration property points to the Configuration object, which has a property for each configurable server setting, such as FillFactor and NestedTriggers. Each property points to a ConfigProperty object that contains the maximum value, minimum value, and run value of the server setting. It also tells you whether the server setting is advanced and whether it is dynamic. The server settings can be modified by setting the properties of the ConfigProperty object. If the server setting is not dynamic, you must also restart the system.

Это пространство имен, класс или элемент поддерживаются только платформой Microsoft .NET Framework версии 2.0.

Пример

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display all the configuration options.
Dim p As ConfigProperty
For Each p In srv.Configuration.Properties
    Console.WriteLine(p.DisplayName)
Next
Console.WriteLine("There are " & srv.Configuration.Properties.Count.ToString & " configuration options.")
'Display the maximum and minimum values for ShowAdvancedOptions.
Dim min As Integer
Dim max As Integer
min = srv.Configuration.ShowAdvancedOptions.Minimum
max = srv.Configuration.ShowAdvancedOptions.Maximum
Console.WriteLine("Minimum and Maximum values are " & min & " and " & max & ".")
'Modify the value of ShowAdvancedOptions and run the Alter method.
srv.Configuration.ShowAdvancedOptions.ConfigValue = 0
srv.Configuration.Alter()
'Display when the change takes place according to the IsDynamic property.
If srv.Configuration.ShowAdvancedOptions.IsDynamic = True Then
    Console.WriteLine("Configuration option has been updated.")
Else
    Console.WriteLine("Configuration option will be updated when SQL Server is restarted.")
End If

Синхронизация потоков

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.

Платформы

Платформы разработки

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

Целевые платформы

Список поддерживаемых платформ см. в разделе Hardware and Software Requirements for Installing SQL Server 2005.

См. также

Справочник

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

Другие ресурсы

How to: Modify SQL Server Configuration Options in Visual Basic .NET
Configuring SQL Server in SMO
Управление серверами