문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

Server.GetPropertyNames 메서드

Returns the names of the initialized properties for the specified object type

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

public StringCollection GetPropertyNames(
	Type typeObject
)

매개 변수

typeObject
유형: System.Type
A Type system object that specifies the type of object.

반환 값

유형: System.Collections.Specialized.StringCollection
A StringCollection system object that contains a list property names for the specified object.

SMO optimization allows only the minimum properties to be loaded when an object is created. You can use this method to see which properties are currently initialized for an object at any point in your application.

Visual Basic

'Connect to the local, default instance of SQL Server.
Dim srv As Server
srv = New Server
'Display all the loaded properties for the Server type.
Dim s As String
Console.WriteLine("===Before State property is accessed.===")
For Each s In srv.GetPropertyNames(srv.GetType)
    Console.WriteLine(s.ToString)
Next
'Access the State property of the Server object.
Console.WriteLine(srv.State)
'Again, display the loaded properties for the Server type.
Console.WriteLine("===After State property is accessed.===")
    For Each s In srv.GetPropertyNames(srv.GetType)
    Console.WriteLine(s.ToString)
Next

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
Write-Host "===Before State property is accessed.==="
foreach ($s in $srv.GetPropertyNames($srv.GetType()))
{
   Write-Host $s
}
Write-Host $srv.State
Write-Host "===After State property is accessed.==="
Foreach ($s in $srv.GetPropertyNames($srv.GetType()))
{
   Write-Host $s
}

커뮤니티 추가 항목

추가
표시: