次の方法で共有


PartitionFunctions プロパティ

PartitionFunction オブジェクトのコレクションを表します。各 PartitionFunction オブジェクトは、データベースで定義されたパーティション関数を表します。

名前空間:  Microsoft.SqlServer.Management.Smo
アセンブリ:  Microsoft.SqlServer.Smo (Microsoft.SqlServer.Smo.dll)

構文

'宣言
<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny,  _
    GetType(PartitionFunction))> _
Public ReadOnly Property PartitionFunctions As PartitionFunctionCollection
    Get
'使用
Dim instance As Database
Dim value As PartitionFunctionCollection

value = instance.PartitionFunctions
[SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(PartitionFunction))]
public PartitionFunctionCollection PartitionFunctions { get; }
[SfcObjectAttribute(SfcContainerRelationship::ObjectContainer, SfcContainerCardinality::ZeroToAny, 
    typeof(PartitionFunction))]
public:
property PartitionFunctionCollection^ PartitionFunctions {
    PartitionFunctionCollection^ get ();
}
[<SfcObjectAttribute(SfcContainerRelationship.ObjectContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(PartitionFunction))>]
member PartitionFunctions : PartitionFunctionCollection
function get PartitionFunctions () : PartitionFunctionCollection

プロパティ値

型: Microsoft.SqlServer.Management.Smo. . :: . .PartitionFunctionCollection
データベースで定義されたすべてのパーティション関数を表す PartitionFunctionCollection オブジェクト。

説明

このコレクションを使用し、パーティション関数の名前を指定することによって、特定のパーティション関数を参照できます。新しいパーティション関数をコレクションに追加するには、パーティション関数コンストラクターを呼び出します。

使用例

VB

Dim srv As Server
srv = New Server

'Reference the AdventureWorks2008R2 database.
Dim db As Database
db = srv.Databases("AdventureWorks2008R2")

'Display all the partition functions and schemes on the database.
Dim pf As PartitionFunction
For Each pf In db.PartitionFunctions
   Console.WriteLine(pf.Name)
Next
Dim ps As PartitionScheme
For Each ps In db.PartitionSchemes
   Console.WriteLine(ps.Name)
Next

PowerShell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2008R2")
Foreach ($pf in $db.PartitionFunctions)
{
   Write-Host $pf.Name
}
Foreach ($ps in $db.LogFiles)
{
   Write-Host $ps.Name
}