Propriété Table.PartitionSchemeParameters

Represents a collection of PartitionSchemeParameter objects. Each PartitionSchemeParameter object represents a partition scheme parameter defined on the table.

Espace de noms :  Microsoft.SqlServer.Management.Smo
Assembly :  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Syntaxe

'Déclaration
<SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.ZeroToAny,  _
    GetType(PartitionSchemeParameter))> _
Public ReadOnly Property PartitionSchemeParameters As PartitionSchemeParameterCollection 
    Get
'Utilisation
Dim instance As Table 
Dim value As PartitionSchemeParameterCollection 

value = instance.PartitionSchemeParameters
[SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(PartitionSchemeParameter))]
public PartitionSchemeParameterCollection PartitionSchemeParameters { get; }
[SfcObjectAttribute(SfcContainerRelationship::ChildContainer, SfcContainerCardinality::ZeroToAny, 
    typeof(PartitionSchemeParameter))]
public:
property PartitionSchemeParameterCollection^ PartitionSchemeParameters {
    PartitionSchemeParameterCollection^ get ();
}
[<SfcObjectAttribute(SfcContainerRelationship.ChildContainer, SfcContainerCardinality.ZeroToAny, 
    typeof(PartitionSchemeParameter))>]
member PartitionSchemeParameters : PartitionSchemeParameterCollection
function get PartitionSchemeParameters () : PartitionSchemeParameterCollection

Valeur de propriété

Type : Microsoft.SqlServer.Management.Smo.PartitionSchemeParameterCollection
A PartitionSchemeParameter object that represents all the partition scheme parameters that are defined on the table. The partition scheme parameters represent the file groups on which the partition scheme is placed.

Exemples

The following code example prints the ID of each partition scheme parameter for each AdventureWorks2012 table, if any have been defined.

C#

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];

foreach (Table tb in db.Tables) 
{
   if (tb.PartitionSchemeParameters != null)
   {
      Foreach (PartitionSchemeParameter psp in tb.PartitionSchemeParameters)
      {
         Console.WriteLine(psp.ID);
      }
   }
   else
   {
      Console.WriteLine("The " + tb.Name + " table has no defined partition scheme.");
   }
}

Powershell

$srv = new-Object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = New-Object Microsoft.SqlServer.Management.Smo.Database
$db = $srv.Databases.Item("AdventureWorks2012")

Foreach ($tb in $db.Tables) 
{
   if ($tb.PartitionSchemeParameters -ne $NULL)
   {
      foreach ($psp in $tb.PartitionSchemeParameters)
      {
         Write-Host $pspi.ID
      }
   }
   else
   {
   Write-Host "The" $tb.Name "table has no defined partition scheme." 
   }
}

Voir aussi

Référence

Table Classe

Espace de noms Microsoft.SqlServer.Management.Smo

Autres ressources

CREATE PARTITION SCHEME (Transact-SQL)

Tables

CREATE TABLE (Transact-SQL)