Table.PartitionScheme 属性
Gets or sets the name of the partition scheme that is configured for the table.
此 API 不符合 CLS。
命名空间: Microsoft.SqlServer.Management.Smo
程序集: Microsoft.SqlServer.Smo(在 Microsoft.SqlServer.Smo.dll 中)
语法
声明
<SfcPropertyAttribute(SfcPropertyFlags.None Or SfcPropertyFlags.ReadOnlyAfterCreation Or SfcPropertyFlags.Standalone)> _
<SfcReferenceAttribute(GetType(PartitionScheme), "Server[@Name='{0}']/Database[@Name='{1}']/PartitionScheme[@Name='{2}']", _
)> _
<CLSCompliantAttribute(False)> _
Public Property PartitionScheme As String
Get
Set
用法
Dim instance As Table
Dim value As String
value = instance.PartitionScheme
instance.PartitionScheme = value
[SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.ReadOnlyAfterCreation|SfcPropertyFlags.Standalone)]
[SfcReferenceAttribute(typeof(PartitionScheme), "Server[@Name='{0}']/Database[@Name='{1}']/PartitionScheme[@Name='{2}']",
)]
[CLSCompliantAttribute(false)]
public string PartitionScheme { get; set; }
[SfcPropertyAttribute(SfcPropertyFlags::None|SfcPropertyFlags::ReadOnlyAfterCreation|SfcPropertyFlags::Standalone)]
[SfcReferenceAttribute(typeof(PartitionScheme), L"Server[@Name='{0}']/Database[@Name='{1}']/PartitionScheme[@Name='{2}']",
)]
[CLSCompliantAttribute(false)]
public:
property String^ PartitionScheme {
String^ get ();
void set (String^ value);
}
[<SfcPropertyAttribute(SfcPropertyFlags.None|SfcPropertyFlags.ReadOnlyAfterCreation|SfcPropertyFlags.Standalone)>]
[<SfcReferenceAttribute(typeof(PartitionScheme), "Server[@Name='{0}']/Database[@Name='{1}']/PartitionScheme[@Name='{2}']",
)>]
[<CLSCompliantAttribute(false)>]
member PartitionScheme : string with get, set
function get PartitionScheme () : String
function set PartitionScheme (value : String)
属性值
类型:System.String
A String value that specifies the name of the partition scheme that is configured on the table.
注释
The property specifies the name of the partition scheme. The PartitionSchemeParameters property lists the file groups that the partition scheme uses to store the table data.
示例
The following code example prints the name of the partition scheme, if one exists, for each AdventureWorks2012 table.
C#
Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];
foreach (Table tb in db.Tables)
{
if (tb.PartitionScheme != "")
{
Console.WriteLine("The " + tb.Name + " table uses the " + tb.PartitionScheme + " partition scheme.");
}
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.PartitionScheme -ne "")
{
Write-Host "The" $tb.Name "table uses the" $tb.PartitionScheme "partition scheme."
}
else
{
Write-Host "The" $tb.Name "table has no defined partition scheme."
}
}
请参阅
参考
Microsoft.SqlServer.Management.Smo 命名空间