다음을 통해 공유


Server.Configuration 속성

Gets the configuration options for the instance of SQL Server.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
<SfcObjectAttribute(SfcObjectRelationship.ChildObject, SfcObjectCardinality.One)> _
Public ReadOnly Property Configuration As Configuration 
    Get
‘사용 방법
Dim instance As Server 
Dim value As Configuration 

value = instance.Configuration
[SfcObjectAttribute(SfcObjectRelationship.ChildObject, SfcObjectCardinality.One)]
public Configuration Configuration { get; }
[SfcObjectAttribute(SfcObjectRelationship::ChildObject, SfcObjectCardinality::One)]
public:
property Configuration^ Configuration {
    Configuration^ get ();
}
[<SfcObjectAttribute(SfcObjectRelationship.ChildObject, SfcObjectCardinality.One)>]
member Configuration : Configuration
function get Configuration () : Configuration

속성 값

유형: Microsoft.SqlServer.Management.Smo.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.

Visual Basic

'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

PowerShell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
#Display all the configuration options
Foreach ($p in $srv.Configuration.Properties)
{
   Write-Host $p.DisplayName
}
Write-Host "There are" $srv.Configuration.Properties.Count "configuration options."
$min = $srv.Configuration.ShowAdvancedOptions.Minimum
$max = $srv.Configuration.ShowAdvancedOptions.Maximum
Write-Host "Minimum and Maximum values are" $min "and" $max"."
$srv.Configuration.ShowAdvancedOptions.ConfigValue = 0
$srv.Configuration.Alter()
if ($srv.Configuration.ShowAdvancedOptions.IsDynamic -eq $TRUE)
{
   Write-Host "Configuration option has been updated."
}
else 
{ 
   Write-Host "Configuration option will be updated when SQL Server is restarted."
}

참고 항목

참조

Server 클래스

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

SMO에서 SQL Server 구성

서버 관리